![]() |
ezEngine
Release 25.03
|
This world module stores all particle effect data that is active in a given ezWorld instance. More...
#include <ParticleWorldModule.h>
Public Member Functions | |
ezParticleWorldModule (ezWorld *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. | |
ezParticleEffectHandle | CreateEffectInstance (const ezParticleEffectResourceHandle &hResource, ezUInt64 uiRandomSeed, const char *szSharedName, const void *&inout_pSharedInstanceOwner, ezArrayPtr< ezParticleEffectFloatParam > floatParams, ezArrayPtr< ezParticleEffectColorParam > colorParams) |
void | DestroyEffectInstance (const ezParticleEffectHandle &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 ezParticleEffectHandle &hEffect, ezParticleEffectInstance *&out_pEffect) |
bool | TryGetEffectInstance (const ezParticleEffectHandle &hEffect, const ezParticleEffectInstance *&out_pEffect) const |
void | ExtractEffectRenderData (const ezParticleEffectInstance *pEffect, ezMsgExtractRenderData &ref_msg, const ezTransform &systemTransform) const |
Extracts render data for the given effect. | |
ezParticleSystemInstance * | CreateSystemInstance (ezUInt32 uiMaxParticles, ezWorld *pWorld, ezParticleEffectInstance *pOwnerEffect, float fSpawnMultiplier) |
void | DestroySystemInstance (ezParticleSystemInstance *pInstance) |
ezParticleStream * | CreateStreamDefaultInitializer (ezParticleSystemInstance *pOwner, const char *szFullStreamName) const |
ezWorldModule * | GetCachedWorldModule (const ezRTTI *pRtti) const |
Can be called at any time (e.g. during ezParticleBehaviorFactory::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 ezWorld at that time. | |
template<class T > | |
void | CacheWorldModule () |
Should be called by ezParticleModule::RequestRequiredWorldModulesForCache() to cache a pointer to a world module that is needed later. | |
void | CacheWorldModule (const ezRTTI *pRtti) |
Should be called by ezParticleModule::RequestRequiredWorldModulesForCache() to cache a pointer to a world module that is needed later. | |
![]() | |
ezWorld * | GetWorld () |
Returns the corresponding world to this module. | |
const ezWorld * | GetWorld () const |
Returns the corresponding world to this module. | |
ezUInt32 | GetWorldIndex () const |
Same as GetWorld()->GetIndex(). Needed to break circular include dependencies. | |
![]() | |
virtual const ezRTTI * | GetDynamicRTTI () const |
bool | IsInstanceOf (const ezRTTI *pType) const |
Returns whether the type of this instance is of the given type or derived from it. | |
template<typename T > | |
EZ_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 ezWorld::Clear(). Can be used to clear cached data when a world is completely cleared of objects (but not deleted). | |
Additional Inherited Members | |
![]() | |
static const ezRTTI * | GetStaticRTTI () |
![]() | |
using | UpdateFunction = ezDelegate< void(const UpdateContext &)> |
Update function delegate. | |
![]() | |
ezWorldModule (ezWorld *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. | |
ezAllocator * | GetAllocator () |
Returns the allocator used by the world. | |
ezInternal::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. | |
![]() | |
ezWorld * | m_pWorld |
This world module stores all particle effect data that is active in a given ezWorld 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.