Plasma Engine  2.0
Loading...
Searching...
No Matches
plParticleEffectInstance Class Reference

Public Member Functions

void Construct (plParticleEffectHandle hEffectHandle, const plParticleEffectResourceHandle &hResource, plWorld *pWorld, plParticleWorldModule *pOwnerModule, plUInt64 uiRandomSeed, bool bIsShared, plArrayPtr< plParticleEffectFloatParam > floatParams, plArrayPtr< plParticleEffectColorParam > colorParams)
 
void Destruct ()
 
void Interrupt ()
 
const plParticleEffectHandleGetHandle () const
 
void SetEmitterEnabled (bool bEnable)
 
bool GetEmitterEnabled () const
 
bool HasActiveParticles () const
 
void ClearParticleSystems ()
 
void ClearEventReactions ()
 
bool IsContinuous () const
 
plWorldGetWorld () const
 
plParticleWorldModuleGetOwnerWorldModule () const
 
const plParticleEffectResourceHandleGetResource () const
 
const plHybridArray< plParticleSystemInstance *, 4 > & GetParticleSystems () const
 
void AddParticleEvent (const plParticleEvent &pe)
 
plRandomGetRNG ()
 
plUInt64 GetRandomSeed () const
 
void RequestWindSamples ()
 
void UpdateWindSamples (plTime diff)
 
plUInt64 GetNumActiveParticles () const
 Returns the number of currently active particles across all systems.
 

Friends

class plParticleWorldModule
 
class plParticleEffectUpdateTask
 

Updates

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

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 plTransform &transform, const plVec3 &vParticleStartVelocity)
 Sets the transformation of this instance.
 
void SetTransformForNextFrame (const plTransform &transform, const plVec3 &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 plTransformGetTransform () 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.
 
plSimdVec4f GetWindAt (const plSimdVec4f &vPosition) const
 Returns the wind at the given position.
 

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 (plParticleEffectInstance *pOtherVisible)
 
bool IsVisible () const
 Whether the effect has been marked as visible recently.
 
void GetBoundingVolume (plBoundingBoxSphere &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 plTempHashedString &sName, float value)
 
void SetParameter (const plTempHashedString &sName, const plColor &value)
 
plInt32 FindFloatParameter (const plTempHashedString &sName) const
 
float GetFloatParameter (const plTempHashedString &sName, float fDefaultValue) const
 
float GetFloatParameter (plUInt32 uiIdx) const
 
plInt32 FindColorParameter (const plTempHashedString &sName) const
 
const plColorGetColorParameter (const plTempHashedString &sName, const plColor &defaultValue) const
 
const plColorGetColorParameter (plUInt32 uiIdx) const
 

Member Function Documentation

◆ GetTotalEffectLifeTime()

plTime plParticleEffectInstance::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()

plSimdVec4f plParticleEffectInstance::GetWindAt ( const plSimdVec4f & 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: