Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::Particle::CParticleTrail Class Reference
Inheritance diagram for Skylicht::Particle::CParticleTrail:
Skylicht::Particle::IParticleCallback

Public Member Functions

 CParticleTrail (CGroup *group)
virtual void update (CCamera *camera)
 Updates ribbon geometry based on particle history and camera position.
virtual void OnParticleUpdate (CParticle *particles, int num, CGroup *group, float dt)
 Callback: records new particle positions into trails.
virtual void OnParticleBorn (CParticle &p)
 Callback: initializes trail for a new particle.
virtual void OnParticleDead (CParticle &p)
 Callback: moves trail to dead list for fading or removes it.
virtual void OnSwapParticleData (CParticle &p1, CParticle &p2)
 Callback: swaps trail indices when particles are reordered.
virtual void OnGroupDestroy ()
 Callback: handles parent group destruction.
IMeshBuffergetMeshBuffer ()
 Gets raw access to trail mesh.
CMaterialgetMaterial ()
 Gets active material.
void setWidth (float f)
 Sets ribbon width.
float getWidth ()
 Gets ribbon width.
void setSegmentLength (float f)
 Sets segment separation distance.
float getSegmentLength ()
 Gets segment separation distance.
bool isDestroyedWhenParticleDead ()
 Checks death destruction policy.
void enableDestroyWhenParticleDead (bool b)
 Configures death destruction policy.
float getDeadAlphaReduction ()
 Gets fading speed for dead trails.
void setDeadAlphaReduction (float a)
 Sets fading speed for dead trails.
void enableCustomMaterial (bool b)
 Enables/disables custom material.
void setCustomMaterial (CMaterial *material)
 Sets custom material.
bool useCustomMaterial ()
 Checks if custom material is active.
const char * getCustomMaterial ()
 Gets path to custom material.
const wchar_t * getGroupName ()
 Gets name of linked group.
void setLength (float l)
 Sets max trail length.
float getLength ()
 Gets max trail length.
void setTexture (ITexture *texture)
 Directly sets ribbon texture.
void applyMaterial ()
 Updates material parameters in the mesh buffer.
void setTexturePath (const char *path)
 Loads ribbon texture by path.
const char * getTexturePath ()
 Gets ribbon texture path.
void setEmission (bool b)
 Enables/disables emission.
bool isEmission ()
 Checks if emission is enabled.
void setEmissionIntensity (float f)
 Sets emission intensity.
float getEmissionIntensity ()
 Gets emission intensity.
void setBillboard (bool b)
 Enables/disables camera billboarding.
bool isBillboard ()
 Checks if billboarding is enabled.
void setUpVector (const core::vector3df &up)
 Sets custom up vector for orientation.
const core::vector3dfgetUpVector ()
 Gets custom up vector.

Protected Member Functions

void updateDeadTrail ()
 Internal: manages fading of dead trails.
void setWorld (const core::matrix4 &world)
 Internal: sets world matrix.

Protected Attributes

CGroupm_group
 The group whose particles generate these trails.
std::wstring m_name
 Friendly name.
core::array< STrailInfom_trails
 Active trails for live particles.
core::array< STrailInfom_deadTrails
 Fading trails for dead particles.
IMeshBufferm_meshBuffer
 Internal mesh buffer for the trail ribbon.
float m_segmentLength
 Distance between ribbon segments.
u32 m_maxSegmentCount
 Max number of segments per trail.
float m_width
 Ribbon width.
float m_length
 Total trail length in units.
u32 m_trailCount
 Current count of active trails.
bool m_destroyWhenParticleDead
 Whether to kill the trail immediately when its particle dies.
float m_deadAlphaReduction
 Fading speed for dead trails.
std::string m_texturePath
 Path to the ribbon texture.
CMaterialm_material
 Default material for the ribbon.
CMaterialm_customMaterial
 Optional custom material.
bool m_useCustomMaterial
 Whether to use custom material.
core::matrix4 m_world
 Local-to-world transform.
bool m_emission
 Whether the trail has emission.
float m_emissionIntensity
 Emission intensity multiplier.
bool m_billboard
 Whether the ribbon always faces the camera.
core::vector3df m_upVector
 Custom up vector if billboarding is disabled.

Friends

class CParticleTrailComponent

Member Function Documentation

◆ OnGroupDestroy()

virtual void Skylicht::Particle::CParticleTrail::OnGroupDestroy ( )
virtual

Callback: handles parent group destruction.

Reimplemented from Skylicht::Particle::IParticleCallback.

◆ OnParticleBorn()

virtual void Skylicht::Particle::CParticleTrail::OnParticleBorn ( CParticle & p)
virtual

Callback: initializes trail for a new particle.

Reimplemented from Skylicht::Particle::IParticleCallback.

◆ OnParticleDead()

virtual void Skylicht::Particle::CParticleTrail::OnParticleDead ( CParticle & p)
virtual

Callback: moves trail to dead list for fading or removes it.

Reimplemented from Skylicht::Particle::IParticleCallback.

◆ OnParticleUpdate()

virtual void Skylicht::Particle::CParticleTrail::OnParticleUpdate ( CParticle * particles,
int num,
CGroup * group,
float dt )
virtual

Callback: records new particle positions into trails.

Reimplemented from Skylicht::Particle::IParticleCallback.

◆ OnSwapParticleData()

virtual void Skylicht::Particle::CParticleTrail::OnSwapParticleData ( CParticle & p1,
CParticle & p2 )
virtual

Callback: swaps trail indices when particles are reordered.

Reimplemented from Skylicht::Particle::IParticleCallback.


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