![]() |
Plasma Engine
2.0
|
This world module stores all particle effect data that is active in a given plWorld instance. More...
#include <ParticleWorldModule.h>
Public Member Functions | |
plParticleWorldModule (plWorld *pWorld) | |
virtual void | Initialize () override |
This method is called after the constructor. A derived type can override this method to do initialization work. Typically this is the method where updates function are registered. | |
virtual void | Deinitialize () override |
This method is called before the destructor. A derived type can override this method to do deinitialization work. | |
plParticleEffectHandle | CreateEffectInstance (const plParticleEffectResourceHandle &hResource, plUInt64 uiRandomSeed, const char *szSharedName, const void *&inout_pSharedInstanceOwner, plArrayPtr< plParticleEffectFloatParam > floatParams, plArrayPtr< plParticleEffectColorParam > colorParams) |
void | DestroyEffectInstance (const plParticleEffectHandle &hEffect, bool bInterruptImmediately, const void *pSharedInstanceOwner) |
This does not actually the effect, it first stops it from emitting and destroys it once all particles have actually died of old age. | |
bool | TryGetEffectInstance (const plParticleEffectHandle &hEffect, plParticleEffectInstance *&out_pEffect) |
bool | TryGetEffectInstance (const plParticleEffectHandle &hEffect, const plParticleEffectInstance *&out_pEffect) const |
void | ExtractEffectRenderData (const plParticleEffectInstance *pEffect, plMsgExtractRenderData &ref_msg, const plTransform &systemTransform) const |
Extracts render data for the given effect. | |
plParticleSystemInstance * | CreateSystemInstance (plUInt32 uiMaxParticles, plWorld *pWorld, plParticleEffectInstance *pOwnerEffect, float fSpawnMultiplier) |
void | DestroySystemInstance (plParticleSystemInstance *pInstance) |
plParticleStream * | CreateStreamDefaultInitializer (plParticleSystemInstance *pOwner, const char *szFullStreamName) const |
plWorldModule * | GetCachedWorldModule (const plRTTI *pRtti) const |
Can be called at any time (e.g. during plParticleBehaviorFactory::CopyBehaviorProperties()) to query a previously cached world module, even if that happens on a thread which would not be allowed to query this from the plWorld at that time. | |
template<class T > | |
void | CacheWorldModule () |
Should be called by plParticleModule::RequestRequiredWorldModulesForCache() to cache a pointer to a world module that is needed later. | |
void | CacheWorldModule (const plRTTI *pRtti) |
Should be called by plParticleModule::RequestRequiredWorldModulesForCache() to cache a pointer to a world module that is needed later. | |
![]() | |
plWorld * | GetWorld () |
Returns the corresponding world to this module. | |
const plWorld * | GetWorld () const |
Returns the corresponding world to this module. | |
plUInt32 | GetWorldIndex () const |
Same as GetWorld()->GetIndex(). Needed to break circular include dependencies. | |
![]() | |
virtual const plRTTI * | GetDynamicRTTI () const |
bool | IsInstanceOf (const plRTTI *pType) const |
Returns whether the type of this instance is of the given type or derived from it. | |
template<typename T > | |
PL_ALWAYS_INLINE bool | IsInstanceOf () const |
Returns whether the type of this instance is of the given type or derived from it. | |
Private Member Functions | |
virtual void | WorldClear () override |
Called by plWorld::Clear(). Can be used to clear cached data when a world is completely cleared of objects (but not deleted). | |
Additional Inherited Members | |
![]() | |
static const plRTTI * | GetStaticRTTI () |
![]() | |
using | UpdateFunction = plDelegate<void(const UpdateContext&)> |
Update function delegate. | |
![]() | |
plWorldModule (plWorld *pWorld) | |
void | RegisterUpdateFunction (const UpdateFunctionDesc &desc) |
Registers the given update function at the world. | |
void | DeregisterUpdateFunction (const UpdateFunctionDesc &desc) |
De-registers the given update function from the world. Note that only the m_Function and the m_Phase of the description have to be valid for de-registration. | |
plAllocator * | GetAllocator () |
Returns the allocator used by the world. | |
plInternal::WorldLargeBlockAllocator * | GetBlockAllocator () |
Returns the block allocator used by the world. | |
bool | GetWorldSimulationEnabled () const |
Returns whether the world simulation is enabled. | |
virtual void | OnSimulationStarted () |
This method is called at the start of the next world update when the world is simulated. This method will be called after the initialization method. | |
![]() | |
plWorld * | m_pWorld |
This world module stores all particle effect data that is active in a given plWorld instance.
It is used to update all effects in one world and also to render them. When an effect is stopped, it only stops emitting new particles, but it lives on until all particles are dead. Therefore particle effects need to be managed outside of components. When a component dies, it only tells the world module to 'destroy' it's effect, the rest is handled behind the scenes.
|
overridevirtual |
This method is called before the destructor. A derived type can override this method to do deinitialization work.
Reimplemented from plWorldModule.
|
overridevirtual |
This method is called after the constructor. A derived type can override this method to do initialization work. Typically this is the method where updates function are registered.
Reimplemented from plWorldModule.
|
overrideprivatevirtual |
Called by plWorld::Clear(). Can be used to clear cached data when a world is completely cleared of objects (but not deleted).
Reimplemented from plWorldModule.