OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::ParticleSystemDef Class Reference

A ParticleSystemDef does not form part of the scene. More...

#include <OgreParticleSystem2.h>

+ Inheritance diagram for Ogre::ParticleSystemDef:

Public Member Functions

 ParticleSystemDef (IdType id, ObjectMemoryManager *objectMemoryManager, SceneManager *ogre_nullable manager, ParticleSystemManager2 *particleSystemManager, const String &name, const bool bIsBillboardSet)
 
 ~ParticleSystemDef () override
 
ParticleSystem2_createParticleSystem (ObjectMemoryManager *objectMemoryManager)
 For internal use. Don't call this directly. See SceneManager::createParticleSystem2. More...
 
void _destroy (VaoManager *ogre_nullable vaoManager)
 
void _destroyAllParticleSystems ()
 For internal use. Don't call this directly. See SceneManager::destroyAllParticleSystems2. More...
 
void _destroyParticleSystem (ParticleSystem2 *system)
 For internal use. Don't call this directly. See SceneManager::destroyParticleSystem2. More...
 
ConstBufferPacked_getGpuCommonBuffer () const
 
ReadOnlyBufferPacked_getGpuDataBuffer () const
 
void _notifyAttached (Node *parent) override
 Overridden from MovableObject. More...
 
ParticleAffector2addAffector (IdString name)
 
EmitterDefDataaddEmitter (IdString name)
 
ParticleSystemDefclone (const String &newName, ParticleSystemManager2 *ogre_nullable dstManager=0)
 Clones this ParticleSystemDef with a new name into a new ParticleSystemManager2. More...
 
const FastArray< ParticleAffector2 * > & getAffectors () const
 
const Vector3getCommonDirection () const
 Returns the common direction for all particles. See setCommonDirection(). More...
 
const Vector3getCommonUpVector () const
 Gets the common up-vector for all particles. See setCommonUpVector(). More...
 
const FastArray< EmitterDefData * > & getEmitters () const
 
const LightListgetLights () const override
 Gets a list of lights, ordered relative to how close they are to this renderable. More...
 
const String getName () const
 
size_t getNumAffectors () const
 
size_t getNumEmitters () const
 
size_t getNumSimdActiveParticles () const
 Returns the number of active particles rounded up to match up SIMD processing. More...
 
ParticleCpuData getParticleCpuData () const
 
size_t getParticlesToRenderTighter () const
 Like getNumSimdActiveParticles(), we have to consider SIMD. More...
 
ParticleType::ParticleType getParticleType () const override
 Used by ParticleSystemDef to indicate Hlms they want specific shader code. More...
 
uint32 getQuota () const
 
void getRenderOperation (v1::RenderOperation &op, bool casterPass) override
 Gets the render operation required to send this object to the frame buffer. More...
 
ParticleRotationType::ParticleRotationType getRotationType () const
 
bool getUseIdentityWorldMatrix () const override
 Returns whether the world matrix is an identity matrix. More...
 
void getWorldTransforms (Matrix4 *xform) const override
 Gets the world transform matrix / matrices for this renderable object. More...
 
void init (VaoManager *vaoManager)
 
bool isInitialized () const
 
void reserveNumAffectors (size_t numAffectors)
 If you know in advance how many times you will call addAffector() call this function to achieve optimum memory use. More...
 
void reserveNumEmitters (size_t numEmitters)
 If you know in advance how many times you will call addEmitter() call this function to achieve optimum memory use. More...
 
void setCommonDirection (const Vector3 &vec)
 Use this to specify the common direction given to particles when type is ParticleType::OrientedCommon and ParticleType::PerpendicularCommon. More...
 
void setCommonUpVector (const Vector3 &vec)
 Use this to specify the common up-vector given to billboards of type ParticleType::PerpendicularCommon and ParticleType::PerpendicularSelf. More...
 
void setCommonVectors (const Vector3 &commonDir, const Vector3 &commonUp)
 See setCommonDirection() and setCommonUpVector(). More...
 
void setParticleQuota (size_t quota) override
 Sets the maximum number of particles this system is allowed to have active at once. More...
 
void setParticleType (ParticleType::ParticleType particleType)
 
void setRotationType (ParticleRotationType::ParticleRotationType rotationType)
 
- Public Member Functions inherited from Ogre::ParticleSystem
 ParticleSystem (IdType id, ObjectMemoryManager *objectMemoryManager, SceneManager *manager, const String &resourceGroupName, uint8 renderQueueId=110u, bool bCreateRenderer=true)
 Creates a particle system with no emitters or affectors. More...
 
virtual ~ParticleSystem () override
 
ParticleIterator _getIterator ()
 Returns an iterator for stepping through all particles in this system. More...
 
void _notifyOrigin (const String &origin)
 Notify this particle system of it's origin. More...
 
virtual void _notifyParticleResized ()
 Internal callback used by Particles to notify their parent that they have been resized. More...
 
virtual void _notifyParticleRotated ()
 Internal callback used by Particles to notify their parent that they have been rotated. More...
 
void _update (Real timeElapsed)
 Updates the particles in the system based on time elapsed. More...
 
void _updateBounds ()
 Internal method for updating the bounds of the particle system. More...
 
void _updateRenderQueue (RenderQueue *queue, Camera *camera, const Camera *lodCamera) override
 Overridden from MovableObject. More...
 
ParticleAffectoraddAffector (const String &affectorType)
 Adds an affector to this particle system. More...
 
ParticleEmitteraddEmitter (const String &emitterType)
 Adds an emitter to this particle system. More...
 
void clear ()
 Empties this set of all particles. More...
 
ParticlecreateEmitterParticle (const String &emitterName)
 Manually add an emitter particle to the system. More...
 
ParticlecreateParticle ()
 Manually add a particle to the system. More...
 
void fastForward (Real time, Real interval=Real(0.1))
 Fast-forwards this system by the required number of seconds. More...
 
ParticleAffectorgetAffector (unsigned short index) const
 Retrieves an affector by it's index (zero-based). More...
 
virtual bool getCullIndividually () const
 Returns whether or not particles in this are tested individually for culling. More...
 
virtual Real getDefaultHeight () const
 See setDefaultDimensions - this gets 1 component individually. More...
 
virtual Real getDefaultWidth () const
 See setDefaultDimensions - this gets 1 component individually. More...
 
size_t getEmittedEmitterQuota () const
 Returns the maximum number of emitted emitters this system is allowed to have active at once. More...
 
ParticleEmittergetEmitter (unsigned short index) const
 Retrieves an emitter by it's index (zero-based). More...
 
bool getEmitting () const
 Returns true if the particle system emitting flag is turned on. More...
 
Real getIterationInterval () const
 Gets a 'iteration interval' on this particle system. More...
 
bool getKeepParticlesInLocalSpace () const
 Gets whether particles (and any affector effects) remain relative to the node the particle system is attached to. More...
 
virtual const StringgetMaterialName () const
 Sets the name of the material to be used for this billboard set. More...
 
const StringgetMovableType () const override
 Overridden from MovableObject. More...
 
Real getNonVisibleUpdateTimeout () const
 Gets when the particle system should stop updating after it hasn't been visible for a while. More...
 
unsigned short getNumAffectors () const
 Returns the number of affectors for this particle system. More...
 
unsigned short getNumEmitters () const
 Returns the number of emitters for this particle system. More...
 
size_t getNumParticles () const
 Gets the number of individual particles in the system right now. More...
 
const StringgetOrigin () const
 Get the origin of this particle system, e.g. More...
 
ParticlegetParticle (size_t index)
 Retrieve a particle from the system for manual tweaking. More...
 
SceneNodegetParticleEmitterRootNode () const
 This is used to attach the particle Emmiters to an own node independent from the Scenenode the Particlesystem is attached to. More...
 
size_t getParticleQuota () const
 Returns the maximum number of particles this system is allowed to have active at once. More...
 
ParticleSystemRenderergetRenderer () const
 Gets the ParticleRenderer to be used to render this particle system. More...
 
const StringgetRendererName () const
 Gets the name of the ParticleRenderer to be used to render this particle system. More...
 
virtual const StringgetResourceGroupName () const
 Return the resource group to be used to load dependent resources. More...
 
bool getSortingEnabled () const
 Gets whether particles are sorted relative to the camera. More...
 
Real getSpeedFactor () const
 Gets the 'speed factor' on this particle system. More...
 
bool getTranslateParticleDirectionIntoWorldSpace () const
 Gets whether particles emitts in direction with is translated into worldspace or not (may only apply to some settings in regards of settings "Localspace" and "ParticleEmitterRootNode") More...
 
ParticleSystemoperator= (const ParticleSystem &rhs)
 Assignment operator for copying. More...
 
void removeAffector (unsigned short index)
 Removes an affector from the system. More...
 
void removeAllAffectors ()
 Removes all the affectors from this system. More...
 
void removeAllEmitters ()
 Removes all the emitters from this system. More...
 
void removeEmitter (ParticleEmitter *emitter)
 Removes an emitter from the system. More...
 
void removeEmitter (unsigned short index)
 Removes an emitter from the system. More...
 
void setBoundsAutoUpdated (bool autoUpdate, Real stopIn=0.0f)
 Sets whether the bounds will be automatically updated for the life of the particle system. More...
 
virtual void setCullIndividually (bool cullIndividual)
 Sets whether culling tests particles in this individually as well as in a group. More...
 
virtual void setDefaultDimensions (Real width, Real height)
 Sets the default dimensions of the particles in this set. More...
 
virtual void setDefaultHeight (Real height)
 See setDefaultDimensions - this sets 1 component individually. More...
 
virtual void setDefaultWidth (Real width)
 See setDefaultDimensions - this sets 1 component individually. More...
 
void setEmittedEmitterQuota (size_t quota)
 Sets the maximum number of emitted emitters this system is allowed to have active at once. More...
 
void setEmitting (bool v)
 This is used to turn on or off particle emission for this system. More...
 
void setIterationInterval (Real iterationInterval)
 Sets a 'iteration interval' on this particle system. More...
 
void setKeepParticlesInLocalSpace (bool keepLocal)
 Sets whether particles (and any affector effects) remain relative to the node the particle system is attached to. More...
 
virtual void setMaterialName (const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Sets the name of the material to be used for this billboard set. More...
 
void setNonVisibleUpdateTimeout (Real timeout)
 Sets when the particle system should stop updating after it hasn't been visible for a while. More...
 
void setParticleEmitterRootNode (SceneNode *sceneNode)
 This is used to attach the particle Emmiters to an own node independent from the Scenenode the Particlesystem is attached to. More...
 
void setRenderer (const String &typeName)
 Sets the ParticleRenderer to be used to render this particle system. More...
 
void setRenderQueueGroup (uint8 queueID) override
 Sets the render queue group this entity will be rendered through. More...
 
void setRenderQueueSubGroup (uint8 subGroup)
 Sets the render queue sub group. More...
 
void setSortingEnabled (bool enabled)
 Set whether or not particles are sorted according to the camera. More...
 
void setSpeedFactor (Real speedFactor)
 Sets a 'speed factor' on this particle system, which means it scales the elapsed real time which has passed by this factor before passing it to the emitters, affectors, and the particle life calculation. More...
 
void setTranslateParticleDirectionIntoWorldSpace (bool value)
 Sets whether particles emitts in direction with is translated into worldspace or not (may only apply to some settings in regards of settings "Localspace" and "ParticleEmitterRootNode") More...
 
- Public Member Functions inherited from Ogre::StringInterface
 StringInterface ()
 
virtual ~StringInterface ()
 Virtual destructor, see Effective C++. More...
 
virtual void copyParametersTo (StringInterface *dest) const
 Method for copying this object's parameters to another object. More...
 
ParamDictionarygetParamDictionary ()
 Retrieves the parameter dictionary for this class. More...
 
const ParamDictionarygetParamDictionary () const
 
virtual String getParameter (const String &name) const
 Generic parameter retrieval method. More...
 
const ParameterListgetParameters () const
 Retrieves a list of parameters valid for this object. More...
 
virtual bool setParameter (const String &name, const String &value)
 Generic parameter setting method. More...
 
virtual void setParameterList (const NameValuePairList &paramList)
 Generic multiple parameter setting method. More...
 
- Public Member Functions inherited from Ogre::MovableObject
 MovableObject (IdType id, ObjectMemoryManager *objectMemoryManager, SceneManager *manager, uint8 renderQueueId)
 Constructor. More...
 
 MovableObject (ObjectData *objectDataPtrs)
 Don't use this constructor unless you know what you're doing. More...
 
virtual ~MovableObject ()
 Virtual destructor - read Scott Meyers if you don't know why this is needed. More...
 
LightList_getLightList ()
 Returns a pointer to the current list of lights for this object. More...
 
SceneManager_getManager () const
 Get the manager of this object, if any (internal use only) More...
 
ObjectData_getObjectData ()
 Returns a direct access to the ObjectData state. More...
 
const Matrix4_getParentNodeFullTransform () const
 Returns the full transformation of the parent sceneNode or the attachingPoint node. More...
 
void _notifyManager (SceneManager *man)
 Notify the object of it's manager (internal use only) More...
 
virtual void _notifyParentNodeMemoryChanged ()
 
virtual void _notifyStaticDirty () const
 Called by SceneManager when it is telling we're a static MovableObject being dirty Don't call this directly. More...
 
virtual void _releaseManualHardwareResources ()
 Notifies the movable object that hardware resources were lost. More...
 
virtual void _restoreManualHardwareResources ()
 Notifies the movable object that hardware resources should be restored. More...
 
void addQueryFlags (uint32 flags)
 As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object. More...
 
void addVisibilityFlags (uint32 flags)
 As setVisibilityFlags, except the flags passed as parameters are appended to the existing flags on this object. More...
 
void detachFromParent ()
 Detaches an object from a parent SceneNode if attached. More...
 
RealAsUint getCachedDistanceToCamera () const
 Returns the distance to camera as calculated in cullFrustum() More...
 
Real getCachedDistanceToCameraAsReal () const
 Returns the distance to camera as calculated in cullFrustum() More...
 
bool getCastShadows () const
 Returns whether shadow casting is enabled for this object. More...
 
unsigned char getCurrentMeshLod () const
 
uint32 getLightMask () const
 Get a bitwise mask which will filter the lights affecting this object. More...
 
ListenergetListener () const
 Gets the current listener for this object. More...
 
Aabb getLocalAabb () const
 Retrieves the local axis-aligned bounding box for this object. More...
 
float getLocalRadius () const
 See getLocalAabb and getWorldRadius. More...
 
const StringgetName () const
 Returns the name of this object. More...
 
NodegetParentNode () const
 Returns the node to which this object is attached. More...
 
SceneNodegetParentSceneNode () const
 
uint32 getQueryFlags () const
 Returns the query flags relevant for this object. More...
 
Real getRenderingDistance () const
 Gets the distance at which batches are no longer rendered. More...
 
Real getRenderingMinPixelSize () const
 Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered. More...
 
uint8 getRenderQueueGroup () const
 Gets the queue group for this entity, see setRenderQueueGroup for full details. More...
 
Real getShadowRenderingDistance () const
 Gets the distance at which batches are no longer casting shadows. More...
 
SkeletonInstancegetSkeletonInstance () const
 
UserObjectBindingsgetUserObjectBindings ()
 Return an instance of user objects binding associated with this class. More...
 
const UserObjectBindingsgetUserObjectBindings () const
 Return an instance of user objects binding associated with this class. More...
 
uint32 getVisibilityFlags () const
 Returns the visibility flags relevant for this object. More...
 
bool getVisible () const
 Gets this object whether to be visible or not, if it has a renderable component. More...
 
Aabb getWorldAabb () const
 Gets the axis aligned box in world space. More...
 
Aabb getWorldAabbUpdated ()
 Gets the axis aligned box in world space. More...
 
float getWorldRadius () const
 Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ). More...
 
float getWorldRadiusUpdated ()
 Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ). More...
 
virtual void instanceBatchCullFrustumThreaded (const Frustum *frustum, const Camera *lodCamera, uint32 combinedVisibilityFlags)
 
bool isAttached () const
 Returns true if this object is attached to a Node. More...
 
bool isStatic () const
 Checks whether this MovableObject is static. More...
 
bool isVisible () const
 Returns whether or not this object is supposed to be visible or not. More...
 
const LightListqueryLights () const
 Gets a list of lights, ordered relative to how close they are to this movable object. More...
 
void removeQueryFlags (uint32 flags)
 As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object. More...
 
void removeVisibilityFlags (uint32 flags)
 As setVisibilityFlags, except the flags passed as parameters are removed from the existing flags on this object. More...
 
void resetMeshLod ()
 Sets mCurrentMeshLod to 0. More...
 
void setCastShadows (bool enabled)
 Sets whether or not this object will cast shadows. More...
 
void setLightMask (uint32 lightMask)
 Set a bitwise mask which will filter the lights affecting this object. More...
 
void setListener (Listener *listener)
 Sets a listener for this object. More...
 
void setLocalAabb (const Aabb box)
 Sets the local axis-aligned bounding box for this object. More...
 
void setName (const String &name)
 Sets a custom name for this node. More...
 
void setQueryFlags (uint32 flags)
 Sets the query flags for this object. More...
 
void setRenderingDistance (Real dist)
 Sets the distance at which the object is no longer rendered. More...
 
void setRenderingMinPixelSize (Real pixelSize)
 Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered. More...
 
void setShadowRenderingDistance (Real dist)
 Sets the distance at which the object is no longer casting shadows. More...
 
bool setStatic (bool bStatic)
 Turns this Node into static or dynamic. More...
 
void setVisibilityFlags (uint32 flags)
 Sets the visibility flags for this object. More...
 
void setVisible (bool visible)
 Tells this object whether to be visible or not, if it has a renderable component. More...
 
- Public Member Functions inherited from Ogre::AnimableObject
 AnimableObject ()
 
virtual ~AnimableObject ()
 
virtual AnimableValuePtr createAnimableValue (const String &valueName)
 Create a reference-counted AnimableValuePtr for the named value. More...
 
const StringVectorgetAnimableValueNames () const
 Gets a list of animable value names for this object. More...
 
- Public Member Functions inherited from Ogre::IdObject
 IdObject (IdType id)
 We don't call generateNewId() here, to prevent objects in the stack (i.e. More...
 
IdType getId () const
 Get the unique id of this object. More...
 
bool operator() (const IdObject &left, const IdObject &right)
 
bool operator() (const IdObject *left, const IdObject *right)
 

Static Public Member Functions

static const ParticleSystemDefcastFromRenderable (const Renderable *a)
 
static RenderablecastToRenderable (ParticleSystemDef *a)
 
- Static Public Member Functions inherited from Ogre::ParticleSystem
static Real getDefaultIterationInterval ()
 Get the default iteration interval for all ParticleSystem instances. More...
 
static Real getDefaultNonVisibleUpdateTimeout ()
 Get the default nonvisible timeout for all ParticleSystem instances. More...
 
static void setDefaultIterationInterval (Real iterationInterval)
 Set the default iteration interval for all ParticleSystem instances. More...
 
static void setDefaultNonVisibleUpdateTimeout (Real timeout)
 Set the default nonvisible timeout for all ParticleSystem instances. More...
 
- Static Public Member Functions inherited from Ogre::StringInterface
static void cleanupDictionary ()
 Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. More...
 
- Static Public Member Functions inherited from Ogre::MovableObject
static void buildLightList (const size_t numNodes, ObjectData t, const LightListInfo &globalLightList)
 
static void calculateCastersBox (const size_t numNodes, ObjectData t, uint32 sceneVisibilityFlags, AxisAlignedBox *outBox)
 
static void cullFrustum (const size_t numNodes, ObjectData t, const Camera *frustum, MovableObjectArray &outCulledObjects, const CullFrustumPreparedData &pd)
 
static void cullFrustumPrepare (const Camera *frustum, uint32 sceneVisibilityFlags, const Camera *lodCamera, CullFrustumPreparedData &pd)
 
static void cullLights (const size_t numNodes, ObjectData t, uint32 sceneLightMask, LightListInfo &outGlobalLightList, const FrustumVec &frustums, const FrustumVec &cubemapFrustums)
 See SceneManager::cullLights & see MovableObject::cullFrustum. More...
 
static uint32 getDefaultLightMask ()
 Get the default light mask for all future MovableObject instances. More...
 
static uint32 getDefaultQueryFlags ()
 Get the default query flags for all future MovableObject instances. More...
 
static uint32 getDefaultVisibilityFlags ()
 Get the default visibility flags for all future MovableObject instances. More...
 
static void setDefaultLightMask (uint32 mask)
 Set the default light mask for all future MovableObject instances. More...
 
static void setDefaultQueryFlags (uint32 flags)
 Set the default query flags for all future MovableObject instances. More...
 
static void setDefaultVisibilityFlags (uint32 flags)
 Set the default visibility flags for all future MovableObject instances. More...
 
static void updateAllBounds (const size_t numNodes, ObjectData t)
 

Static Public Attributes

static constexpr uint32 InvalidHandle = 0xFFFFFFFF
 
- Static Public Attributes inherited from Ogre::MovableObject
static const FastArray< Realc_DefaultLodMesh
 

Additional Inherited Members

- Public Types inherited from Ogre::MovableObject
typedef FastArray< MovableObject * > MovableObjectArray
 
- Public Attributes inherited from Ogre::MovableObject
size_t mGlobalIndex
 Index in the vector holding this MO reference (could be our parent node, or a global array tracking all movable objecst to avoid memory leaks). More...
 
size_t mParentIndex
 Index in the vector holding this MO reference (could be our parent node, or a global array tracking all movable objecst to avoid memory leaks). More...
 
RenderableArray mRenderables
 

Detailed Description

A ParticleSystemDef does not form part of the scene.

The reason it derives from ParticleSystem (& hence MovableObject) is to keep backwards compatibility with the interface of the older ParticleFX plugin for much easier migration/porting.

Do NOT attach it to a SceneNode.

For performance reasons, all particle system instances share the same RenderQueue ID. ParticleSystemDef must be cloned to use instances on another ID.

Constructor & Destructor Documentation

◆ ParticleSystemDef()

Ogre::ParticleSystemDef::ParticleSystemDef ( IdType  id,
ObjectMemoryManager objectMemoryManager,
SceneManager *ogre_nullable  manager,
ParticleSystemManager2 particleSystemManager,
const String name,
const bool  bIsBillboardSet 
)

◆ ~ParticleSystemDef()

Ogre::ParticleSystemDef::~ParticleSystemDef ( )
override

Member Function Documentation

◆ _createParticleSystem()

ParticleSystem2* Ogre::ParticleSystemDef::_createParticleSystem ( ObjectMemoryManager objectMemoryManager)

For internal use. Don't call this directly. See SceneManager::createParticleSystem2.

◆ _destroy()

void Ogre::ParticleSystemDef::_destroy ( VaoManager *ogre_nullable  vaoManager)

◆ _destroyAllParticleSystems()

void Ogre::ParticleSystemDef::_destroyAllParticleSystems ( )

For internal use. Don't call this directly. See SceneManager::destroyAllParticleSystems2.

◆ _destroyParticleSystem()

void Ogre::ParticleSystemDef::_destroyParticleSystem ( ParticleSystem2 system)

For internal use. Don't call this directly. See SceneManager::destroyParticleSystem2.

◆ _getGpuCommonBuffer()

ConstBufferPacked* Ogre::ParticleSystemDef::_getGpuCommonBuffer ( ) const
inline

◆ _getGpuDataBuffer()

ReadOnlyBufferPacked* Ogre::ParticleSystemDef::_getGpuDataBuffer ( ) const
inline

◆ _notifyAttached()

void Ogre::ParticleSystemDef::_notifyAttached ( Node parent)
overridevirtual

Overridden from MovableObject.

See also
MovableObject

Reimplemented from Ogre::ParticleSystem.

◆ addAffector()

ParticleAffector2* Ogre::ParticleSystemDef::addAffector ( IdString  name)

◆ addEmitter()

EmitterDefData* Ogre::ParticleSystemDef::addEmitter ( IdString  name)

◆ castFromRenderable()

static const ParticleSystemDef* Ogre::ParticleSystemDef::castFromRenderable ( const Renderable a)
inlinestatic

◆ castToRenderable()

static Renderable* Ogre::ParticleSystemDef::castToRenderable ( ParticleSystemDef a)
inlinestatic

◆ clone()

ParticleSystemDef* Ogre::ParticleSystemDef::clone ( const String newName,
ParticleSystemManager2 *ogre_nullable  dstManager = 0 
)

Clones this ParticleSystemDef with a new name into a new ParticleSystemManager2.

Spawned particle instances are not cloned.

This is useful if you need a different material or need to alter a few settings.

Remarks
This function can throw.
Parameters
newNameNew name. Must be unique in dstManager
dstManagerThe ParticleSystemManager2 where it will be cloned into. If nullptr, it's the same ParticleSystemManager2 as the manager this definition belongs to.
Returns
The cloned particle system definition.

◆ getAffectors()

const FastArray<ParticleAffector2 *>& Ogre::ParticleSystemDef::getAffectors ( ) const
inline

◆ getCommonDirection()

const Vector3& Ogre::ParticleSystemDef::getCommonDirection ( ) const

Returns the common direction for all particles. See setCommonDirection().

◆ getCommonUpVector()

const Vector3& Ogre::ParticleSystemDef::getCommonUpVector ( ) const

Gets the common up-vector for all particles. See setCommonUpVector().

◆ getEmitters()

const FastArray<EmitterDefData *>& Ogre::ParticleSystemDef::getEmitters ( ) const
inline

◆ getLights()

const LightList& Ogre::ParticleSystemDef::getLights ( ) const
overridevirtual

Gets a list of lights, ordered relative to how close they are to this renderable.

Remarks
Directional lights, which have no position, will always be first on this list.

Implements Ogre::Renderable.

◆ getName()

const String Ogre::ParticleSystemDef::getName ( ) const
inline

◆ getNumAffectors()

size_t Ogre::ParticleSystemDef::getNumAffectors ( ) const

◆ getNumEmitters()

size_t Ogre::ParticleSystemDef::getNumEmitters ( ) const

◆ getNumSimdActiveParticles()

size_t Ogre::ParticleSystemDef::getNumSimdActiveParticles ( ) const
inline

Returns the number of active particles rounded up to match up SIMD processing.

e.g.

  • ARRAY_PACKED_REALS = 4
  • mFirstParticleIdx = 3
  • mLastParticleIdx = 6
  • Num Active Particles = mLastParticleIdx - mFirstParticleIdx = 3
  • Therefore getActiveParticlesPackOffset() = 0

However we must process: 0. inactive

  1. inactive
  2. inactive
  3. active
  4. inactive
  5. active
  6. inactive
  7. inactive

That means the following code:

mParticleCpuData.advancePack( getActiveParticlesPackOffset() );
mParticleCpuData.advancePack();
#define ARRAY_PACKED_REALS
Definition: OgreArrayConfig.h:227
size_t getNumSimdActiveParticles() const
Returns the number of active particles rounded up to match up SIMD processing.
Definition: OgreParticleSystem2.h:364
void advancePack(size_t numAdvance=1u)
Definition: OgreParticle2.h:76

Must iterate 2 times. However if getNumSimdActiveParticles() returns 3 (3 = 5 - 3 + 1), it will only iterate once. Rounding 3 up to ARRAY_PACKED_REALS is also no good, because if it returns 4, it still iterates once.

It must return 8 (ARRAY_PACKED_REALS * 2).

Note that there can be a lot of inactive particles between mFirstParticleIdx & mLastParticleIdx. However this should be rare since particle FXs tend to follow FIFO.

References ARRAY_PACKED_REALS.

◆ getParticleCpuData()

ParticleCpuData Ogre::ParticleSystemDef::getParticleCpuData ( ) const
inline

◆ getParticlesToRenderTighter()

size_t Ogre::ParticleSystemDef::getParticlesToRenderTighter ( ) const
inline

Like getNumSimdActiveParticles(), we have to consider SIMD.

However given the same example we only need to return 6, not 8.

There's not much we can do about the waste at the beginning (in a API-compatible way), but we can do something about the last 2 vertices that are waste.

This function is called "tighter" because it returns 6 instead of 8, but it is not fully "tight" because if that were the case, we'd return 3.

References ARRAY_PACKED_REALS.

◆ getParticleType()

ParticleType::ParticleType Ogre::ParticleSystemDef::getParticleType ( ) const
overridevirtual

Used by ParticleSystemDef to indicate Hlms they want specific shader code.

Reimplemented from Ogre::Renderable.

◆ getQuota()

uint32 Ogre::ParticleSystemDef::getQuota ( ) const

◆ getRenderOperation()

void Ogre::ParticleSystemDef::getRenderOperation ( v1::RenderOperation op,
bool  casterPass 
)
overridevirtual

Gets the render operation required to send this object to the frame buffer.

Implements Ogre::Renderable.

◆ getRotationType()

ParticleRotationType::ParticleRotationType Ogre::ParticleSystemDef::getRotationType ( ) const

◆ getUseIdentityWorldMatrix()

bool Ogre::ParticleSystemDef::getUseIdentityWorldMatrix ( ) const
inlineoverridevirtual

Returns whether the world matrix is an identity matrix.

Remarks
It is up to the Hlms implementation whether to honour this request. Take in mind changes of this value at runtime may not be seen until the datablock is flushed. It is implemented as a virtual call because this functionality isn't required very often (hence we save per-Renderable space for those that don't use it) and this function will be called at creation time to use a different shader; not during rendering time per Renderable.

Reimplemented from Ogre::Renderable.

◆ getWorldTransforms()

void Ogre::ParticleSystemDef::getWorldTransforms ( Matrix4 xform) const
overridevirtual

Gets the world transform matrix / matrices for this renderable object.

Remarks
If the object has any derived transforms, these are expected to be up to date as long as all the SceneNode structures have been updated before this is called.
This method will populate transform with 1 matrix if it does not use vertex blending. If it does use vertex blending it will fill the passed in pointer with an array of matrices, the length being the value returned from getNumWorldTransforms.
Note
Internal Ogre never supports non-affine matrix for world transform matrix/matrices, the behavior is undefined if returns non-affine matrix here.
See also
Matrix4::isAffine.

Implements Ogre::Renderable.

◆ init()

void Ogre::ParticleSystemDef::init ( VaoManager vaoManager)

◆ isInitialized()

bool Ogre::ParticleSystemDef::isInitialized ( ) const

◆ reserveNumAffectors()

void Ogre::ParticleSystemDef::reserveNumAffectors ( size_t  numAffectors)

If you know in advance how many times you will call addAffector() call this function to achieve optimum memory use.

This is the same as std::vector::reserve. Optional.

Parameters
numAffectorsNumber of times you intend to call addAffector().

◆ reserveNumEmitters()

void Ogre::ParticleSystemDef::reserveNumEmitters ( size_t  numEmitters)

If you know in advance how many times you will call addEmitter() call this function to achieve optimum memory use.

This is the same as std::vector::reserve. Optional.

Parameters
numEmittersNumber of times you intend to call addEmitter().

◆ setCommonDirection()

void Ogre::ParticleSystemDef::setCommonDirection ( const Vector3 vec)

Use this to specify the common direction given to particles when type is ParticleType::OrientedCommon and ParticleType::PerpendicularCommon.

Remarks
Use ParticleType::OrientedCommon when you want oriented particles but you know they are always going to be oriented the same way (e.g. rain in calm weather). It is faster for the system to calculate the billboard vertices if they have a common direction.

If you need to call both setCommonDirection() and setCommonUpVector() often, prefer using setCommonVectors().

Parameters
vecThe direction for all particles.

◆ setCommonUpVector()

void Ogre::ParticleSystemDef::setCommonUpVector ( const Vector3 vec)

Use this to specify the common up-vector given to billboards of type ParticleType::PerpendicularCommon and ParticleType::PerpendicularSelf.

Remarks
Use ParticleType::PerpendicularSelf when you want oriented particles perpendicular to their own direction vector and don't face to camera. In this case, we need an additional vector to determine the billboard X, Y axis. The generated X axis perpendicular to both the own direction and up-vector, the Y axis will coplanar with both own direction and up-vector, and perpendicular to own direction.

If you need to call both setCommonDirection() and setCommonUpVector() often, prefer using setCommonVectors().

Parameters
vecThe up-vector for all particles.

◆ setCommonVectors()

void Ogre::ParticleSystemDef::setCommonVectors ( const Vector3 commonDir,
const Vector3 commonUp 
)

See setCommonDirection() and setCommonUpVector().

Use this version if you have to often change both of these at the same time.

◆ setParticleQuota()

void Ogre::ParticleSystemDef::setParticleQuota ( size_t  quota)
overridevirtual

Sets the maximum number of particles this system is allowed to have active at once.

Remarks
Particle systems all have a particle quota, i.e. a maximum number of particles they are allowed to have active at a time. This allows the application to set a keep particle systems under control should they be affected by complex parameters which alter their emission rates etc. If a particle system reaches it's particle quota, none of the emitters will be able to emit any more particles. As existing particles die, the spare capacity will be allocated equally across all emitters to be as consistent to the original particle system style as possible. The quota can be increased but not decreased after the system has been created.
Parameters
quotaThe maximum number of particles this system is allowed to have.

Reimplemented from Ogre::ParticleSystem.

◆ setParticleType()

void Ogre::ParticleSystemDef::setParticleType ( ParticleType::ParticleType  particleType)

◆ setRotationType()

void Ogre::ParticleSystemDef::setRotationType ( ParticleRotationType::ParticleRotationType  rotationType)

Member Data Documentation

◆ InvalidHandle

constexpr uint32 Ogre::ParticleSystemDef::InvalidHandle = 0xFFFFFFFF
staticconstexpr

The documentation for this class was generated from the following file: