PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
EffectParticle Class Reference

Wrapper class for managing particles through SEffectManager. More...

Private Member Functions

EffectType

Information about what type of effect the Effect is, without the need for casting

override EffectType GetEffectType ()
 Get what type of effect the Effect is.
 
override bool IsParticle ()
 Check whether the Effect is EffectParticle without casting.
 
Main particle

Set or get the main particle which this Effect will manage

void SetParticle (Particle p)
 Sets the main particle which this Effect will manage.
 
Particle GetParticle ()
 Gets the main particle which this Effect is managing.
 
Playback

Methods to Play/Stop Effect Generally, SEffectManager.Play methods are used instead of Start

override void Start ()
 Plays all elements this effect consists of.
 
override void Stop ()
 Stops all elements this effect consists of.
 
Attach

Helper methods for attaching to prent

void AttachTo (Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_to_world=false)
 Read Particle.AddAsChild.
 
void ReAttach ()
 Helper method to attach to parent using stored settings.
 
protected void AddAsChild (Object obj, vector local_pos, vector local_ori, bool force_rotation_to_world)
 Helper method to attach to parent.
 
Events

Various events that can be overriden for custom behaviour

void Event_OnPlayStart ()
 Event which just simply exists (DEPRECATED)
 
void Event_OnPlayStarted ()
 Event which just simply exists (DEPRECATED)
 
Generic API

Setters and getters for generic data and properties

void SetParticleID (int id)
 Sets the id of the particle to be used.
 
int GetParticleID ()
 Gets the id of the particle to be used.
 
void SetCurrentParticleID (int id)
 Sets the id of the particle to be used.
 
int GetCurrentParticleID ()
 Gets the current id of the managed Particle.
 
override void SetCurrentParent (Object parent_obj, bool updateCached=true)
 Set current parent of the managed Particle.
 
override Object GetCurrentParent ()
 Get the current parent of the managed Particle.
 
override void SetCurrentPosition (vector pos, bool updateCached=true)
 Set the current world position of the managed Particle.
 
override vector GetCurrentPosition ()
 Get the current world position of the managed Particle.
 
override void SetCurrentLocalPosition (vector pos, bool updateCached=true)
 Set the current local position of the managed Particle.
 
override vector GetCurrentLocalPosition ()
 Get the current local position of the managed Particle.
 
void SetOrientation (vector ori)
 Set orientation of the EffectParticle.
 
vector GetOrientation ()
 Get the orientation of the EffectParticle.
 
void SetCurrentOrientation (vector ori, bool updateCached=true)
 Set the current orientation of the managed Particle.
 
vector GetCurrentOrientation ()
 Get the current orientation of the managed Particle.
 
void ForceParticleRotationRelativeToWorld (bool state)
 Set orientation setting to be used by the effect when the Effect starts.
 
bool IsParticleRotationRelativeToWorld ()
 Get the orientation setting to be used by the effect when the Effect starts.
 
bool IsParticleCurrentRotationRelativeToWorld ()
 Get the current orientation setting to be used by the managed Particle.
 

Private Attributes

protected Particle m_ParticleObj
 The main Particle effect that this Effect wrapper manages.
 
Generic data

Generic data for the particle

protected int m_ParticleID
 The ID in the ParticleList to create Particle from.
 
protected vector m_Orientation
 Orientation set by SetOrientation.
 
protected bool m_ForceRotationRelativeToWorld
 Orientation setting to be used by the effect when the Effect starts.
 

DEPRECATED

Methods which exist for backwards compatibility and are no longer in use or have never been in use

protected vector m_ParticleOrientation
 
protected Object m_Object
 
void EffectParticle ()
 ctor
 
void ~EffectParticle ()
 dtor
 
override void InitEffect ()
 init
 
override string GetDebugName ()
 Override when getting debug information.
 
override void ValidateStart ()
 Validation whether an effect truly started playing or if the Effect should stop as none is present.
 
void CheckLifeSpan ()
 Was never called and probably should never be called.
 
void SetDecalOwner (Object o)
 

Detailed Description

Wrapper class for managing particles through SEffectManager.

Constructor & Destructor Documentation

◆ EffectParticle()

void EffectParticle ( )
inlineprivate

ctor

◆ ~EffectParticle()

void ~EffectParticle ( )
inlineprivate

dtor

Member Function Documentation

◆ AddAsChild()

protected void AddAsChild ( Object  obj,
vector  local_pos,
vector  local_ori,
bool  force_rotation_to_world 
)
inlineprivate

Helper method to attach to parent.

References Particle::AddAsChild(), and GetParticle().

Referenced by AttachTo(), and ReAttach().

◆ AttachTo()

void AttachTo ( Object  obj,
vector  local_pos = "0 0 0",
vector  local_ori = "0 0 0",
bool  force_rotation_to_world = false 
)
inlineprivate

◆ CheckLifeSpan()

void CheckLifeSpan ( )
inlineprivate

Was never called and probably should never be called.

Warning
Emptied the functionality as it is relatively unsafe...

◆ Event_OnPlayStart()

void Event_OnPlayStart ( )
inlineprivate

Event which just simply exists (DEPRECATED)

Warning
Never called or used
Note
Use Event_OnStarted instead

◆ Event_OnPlayStarted()

void Event_OnPlayStarted ( )
inlineprivate

Event which just simply exists (DEPRECATED)

Warning
Never called or used
Note
Use Event_OnStarted instead

◆ ForceParticleRotationRelativeToWorld()

void ForceParticleRotationRelativeToWorld ( bool  state)
inlineprivate

Set orientation setting to be used by the effect when the Effect starts.

Warning
Only caches it into a variable to be used by Start, does not live update when called afterwards
Note
There is no way to update this immediately
Parameters
statebool Whether to keep WS orientation when attaching it to parent

References m_ForceRotationRelativeToWorld.

Referenced by AttachTo(), and SEffectManager::PlayOnObject().

◆ GetCurrentLocalPosition()

override vector GetCurrentLocalPosition ( )
inlineprivate

Get the current local position of the managed Particle.

Returns
vector The current local position of the managed Particle

References GetParent(), and GetParticle().

◆ GetCurrentOrientation()

vector GetCurrentOrientation ( )
inlineprivate

Get the current orientation of the managed Particle.

Returns
vector The current orientation of the managed Particle

References GetParticle(), and vector::Zero.

◆ GetCurrentParent()

override Object GetCurrentParent ( )
inlineprivate

Get the current parent of the managed Particle.

Returns
Object The currrent parent of the Particle

References GetParticle().

◆ GetCurrentParticleID()

int GetCurrentParticleID ( )
inlineprivate

Gets the current id of the managed Particle.

Returns
int Particle ID registered in ParticleList

References GetParticle(), Particle::GetParticleID(), and ParticleList::INVALID.

◆ GetCurrentPosition()

override vector GetCurrentPosition ( )
inlineprivate

Get the current world position of the managed Particle.

Returns
vector The current world position of the managed Particle

References GetParticle().

◆ GetDebugName()

override string GetDebugName ( )
inlineprivate

Override when getting debug information.

References string::Format(), GetParticle(), and m_ParticleID.

◆ GetEffectType()

override EffectType GetEffectType ( )
inlineprivate

Get what type of effect the Effect is.

Returns
EffectType What type of effect the Effect is

◆ GetOrientation()

vector GetOrientation ( )
inlineprivate

Get the orientation of the EffectParticle.

Warning
Only gets the cached variable, for immediate effect use GetCurrent variant
Returns
vector The orientation of EffectParticle

References m_Orientation.

Referenced by Start().

◆ GetParticle()

◆ GetParticleID()

int GetParticleID ( )
inlineprivate

Gets the id of the particle to be used.

Warning
Only gets the cached variable, for immediate effect use GetCurrent variant
Returns
int Particle ID registered in ParticleList

References m_ParticleID.

◆ InitEffect()

override void InitEffect ( )
inlineprivate

◆ IsParticle()

override bool IsParticle ( )
inlineprivate

Check whether the Effect is EffectParticle without casting.

Returns
bool Whether the Effect is EffectParticle

◆ IsParticleCurrentRotationRelativeToWorld()

bool IsParticleCurrentRotationRelativeToWorld ( )
inlineprivate

Get the current orientation setting to be used by the managed Particle.

Returns
bool Whether the managed Particle is only updating position from parent

References GetParticle().

◆ IsParticleRotationRelativeToWorld()

bool IsParticleRotationRelativeToWorld ( )
inlineprivate

Get the orientation setting to be used by the effect when the Effect starts.

Warning
Only gets the cached variable, for immediate effect use IsParticleCurrentRotationRelativeToWorld
Returns
bool Whether to keep WS orientation when attaching it to parent

References GetParticle(), and m_ForceRotationRelativeToWorld.

Referenced by ReAttach(), and Start().

◆ ReAttach()

void ReAttach ( )
inlineprivate

Helper method to attach to parent using stored settings.

References AddAsChild(), GetAttachedLocalOri(), GetLocalPosition(), GetParent(), and IsParticleRotationRelativeToWorld().

Referenced by SetCurrentLocalPosition(), and SetCurrentParent().

◆ SetCurrentLocalPosition()

override void SetCurrentLocalPosition ( vector  pos,
bool  updateCached = true 
)
inlineprivate

Set the current local position of the managed Particle.

Parameters
posvector The current local position for the managed Particle
updateCachedbool Whether to update the cached variable

References GetParent(), GetParticle(), and ReAttach().

Referenced by EOnPostSimulate(), and EffectBoatWaterBase::UpdatePosToSeaLevel().

◆ SetCurrentOrientation()

void SetCurrentOrientation ( vector  ori,
bool  updateCached = true 
)
inlineprivate

Set the current orientation of the managed Particle.

Parameters
orivector Orientation in degrees (yaw, pitch, roll)

References GetParticle(), and SetOrientation().

◆ SetCurrentParent()

override void SetCurrentParent ( Object  parent_obj,
bool  updateCached = true 
)
inlineprivate

Set current parent of the managed Particle.

Parameters
parent_objObject The parent for the Particle
updateCachedbool Whether to update the cached variable

References ReAttach().

◆ SetCurrentParticleID()

void SetCurrentParticleID ( int  id)
inlineprivate

Sets the id of the particle to be used.

Note
Particle will not update immediately, but ParticleSource will
Parameters
idint Particle ID registered in ParticleList

References GetParticle(), m_ParticleID, and Particle::SetSource().

◆ SetCurrentPosition()

override void SetCurrentPosition ( vector  pos,
bool  updateCached = true 
)
inlineprivate

Set the current world position of the managed Particle.

Parameters
posvector The current world position for the Particle
updateCachedbool Whether to update the cached variable

References GetParticle().

◆ SetDecalOwner()

void SetDecalOwner ( Object  o)
inlineprivate

References m_Object.

Referenced by ManBase::OnParticleEvent().

◆ SetOrientation()

void SetOrientation ( vector  ori)
inlineprivate

Set orientation of the EffectParticle.

Warning
Only sets the cached variable, for immediate effect use SetCurrent variant
Parameters
orivector Orientation in degrees (yaw, pitch, roll)

References m_Orientation.

Referenced by SetCurrentOrientation().

◆ SetParticle()

void SetParticle ( Particle  p)
inlineprivate

Sets the main particle which this Effect will manage.

Parameters
pParticle Main particle which this Effect will manage

References Event_OnEffectEnded, Event_OnEffectStarted, ParticleEvents::Event_OnParticleStart, ParticleEvents::Event_OnParticleStop, ScriptInvoker::Insert(), m_ParticleObj, and ScriptInvoker::Remove().

Referenced by EffBulletImpactBase::Event_OnStarted(), Start(), and Stop().

◆ SetParticleID()

◆ Start()

◆ Stop()

◆ ValidateStart()

override void ValidateStart ( )
inlineprivate

Validation whether an effect truly started playing or if the Effect should stop as none is present.

Note
Override this when inheriting to create own validation check
Is called from Event_OnStarted invoker after Event_OnStarted has been performed

References GetParticle(), and Stop().

Field Documentation

◆ m_ForceRotationRelativeToWorld

protected bool m_ForceRotationRelativeToWorld
private

Orientation setting to be used by the effect when the Effect starts.

Referenced by ForceParticleRotationRelativeToWorld(), and IsParticleRotationRelativeToWorld().

◆ m_Object

protected Object m_Object
private

Referenced by SetDecalOwner().

◆ m_Orientation

protected vector m_Orientation
private

Orientation set by SetOrientation.

Referenced by GetOrientation(), and SetOrientation().

◆ m_ParticleID

protected int m_ParticleID
private

◆ m_ParticleObj

protected Particle m_ParticleObj
private

The main Particle effect that this Effect wrapper manages.

Referenced by GetParticle(), and SetParticle().

◆ m_ParticleOrientation

protected vector m_ParticleOrientation
private

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