ezEngine  Release 25.03
ezParticleEffectInstance Class Reference

Public Member Functions

void Construct (ezParticleEffectHandle hEffectHandle, const ezParticleEffectResourceHandle &hResource, ezWorld *pWorld, ezParticleWorldModule *pOwnerModule, ezUInt64 uiRandomSeed, bool bIsShared, ezArrayPtr< ezParticleEffectFloatParam > floatParams, ezArrayPtr< ezParticleEffectColorParam > colorParams)
 
void Destruct ()
 
void Interrupt ()
 
const ezParticleEffectHandleGetHandle () const
 
void SetEmitterEnabled (bool bEnable)
 
bool GetEmitterEnabled () const
 
bool HasActiveParticles () const
 
void ClearParticleSystems ()
 
void ClearEventReactions ()
 
bool IsContinuous () const
 
ezWorldGetWorld () const
 
ezParticleWorldModuleGetOwnerWorldModule () const
 
const ezParticleEffectResourceHandleGetResource () const
 
const ezHybridArray< ezParticleSystemInstance *, 4 > & GetParticleSystems () const
 
void AddParticleEvent (const ezParticleEvent &pe)
 
ezRandomGetRNG ()
 
ezUInt64 GetRandomSeed () const
 
void RequestWindSamples ()
 
void UpdateWindSamples (ezTime diff)
 
ezUInt64 GetNumActiveParticles () const
 Returns the number of currently active particles across all systems.
 

Friends

class ezParticleWorldModule
 
class ezParticleEffectUpdateTask
 

Transform Related

bool IsSimulatedInLocalSpace () const
 Whether the effect is simulated around the origin and thus not affected by instance position and rotation.
 
void SetTransform (const ezTransform &transform, const ezVec3 &vParticleStartVelocity)
 Sets the transformation of this instance.
 
void SetTransformForNextFrame (const ezTransform &transform, const ezVec3 &vParticleStartVelocity)
 Sets the transformation of this instance that should be used next frame. This function is typically used to set the transformation while the particle simulation is running to prevent race conditions.
 
const ezTransformGetTransform () const
 Returns the transform of the main or shared instance.
 
bool NeedsToApplyTransform () const
 For the renderer to know whether the instance transform has to be applied to each particle position.
 
ezSimdVec4f GetWindAt (const ezSimdVec4f &vPosition) const
 Returns the wind at the given position. More...
 

Updates

class ezParticleEffectController
 
bool Update (const ezTime &diff)
 Returns false when the effect is finished.
 
ezTime GetTotalEffectLifeTime () const
 Returns the total (game) time that the effect is alive and has been updated. More...
 

Shared Instances

bool IsSharedEffect () const
 Returns true, if this effect is configured to be simulated once per frame, but rendered by multiple instances.
 

Visibility and Culling

void SetIsVisible () const
 Marks this effect as visible from at least one view. This affects simulation update rates.
 
void SetVisibleIf (ezParticleEffectInstance *pOtherVisible)
 
bool IsVisible () const
 Whether the effect has been marked as visible recently.
 
void GetBoundingVolume (ezBoundingBoxSphere &ref_volume) const
 Returns the bounding volume of the effect. The volume is in the local space of the effect.
 

Effect Parameters

void SetParameter (const ezTempHashedString &sName, float value)
 
void SetParameter (const ezTempHashedString &sName, const ezColor &value)
 
ezInt32 FindFloatParameter (const ezTempHashedString &sName) const
 
float GetFloatParameter (const ezTempHashedString &sName, float fDefaultValue) const
 
float GetFloatParameter (ezUInt32 uiIdx) const
 
ezInt32 FindColorParameter (const ezTempHashedString &sName) const
 
const ezColorGetColorParameter (const ezTempHashedString &sName, const ezColor &defaultValue) const
 
const ezColorGetColorParameter (ezUInt32 uiIdx) const
 

Member Function Documentation

◆ GetTotalEffectLifeTime()

ezTime ezParticleEffectInstance::GetTotalEffectLifeTime ( ) const
inline

Returns the total (game) time that the effect is alive and has been updated.

Use this time, instead of a world clock, for time-dependent calculations. It is mostly tied to the world clock (game update), but additionally includes pre-simulation timings, which would otherwise be left out which can break some calculations.

◆ GetWindAt()

ezSimdVec4f ezParticleEffectInstance::GetWindAt ( const ezSimdVec4f vPosition) const

Returns the wind at the given position.

Returns a zero vector, if no wind value is available (invalid index).


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