Class ParticleSystemState
Namespace: ValveResourceFormat.Particles
Assembly: ValveResourceFormat.dll
Represents an entire particle system.
public class ParticleSystemStateInheritance
Constructors
ParticleSystemState(ParticleSystemState?)
Creates the state for one system.
public ParticleSystemState(ParticleSystemState? parentSystem = null)Parameters
parentSystem ParticleSystemState?
The state of the system running this one as a child.
Fields
Default
A state with no system behind it, read by functions evaluated outside a running system.
public static readonly ParticleSystemState DefaultField Value
Properties
Age
How long the system has been running, in seconds.
public float Age { get; set; }Property Value
CameraPosition
World-space position of the render camera, updated once per simulation step.
public Vector3 CameraPosition { get; set; }Property Value
Data
The system this state belongs to. Null for .
public ParticleSystemSimulation? Data { get; init; }Property Value
DestroyInstantlyOnEnd
Whether ending the system drops the particles still alive instead of letting them finish.
public bool DestroyInstantlyOnEnd { get; }Property Value
DetailLevel
Active particle detail tier, used by PF_TYPE_PARTICLE_DETAIL_LEVEL inputs and by the child systems' own m_nDetailLevel; child systems inherit the root system's tier.
public ParticleDetailLevel DetailLevel { get; set; }Property Value
EndCapAge
How long the endcap has been running, or 0 outside it.
public float EndCapAge { get; }Property Value
EndCapStartAge
System age at which the endcap began.
public float EndCapStartAge { get; }Property Value
EndEarly
Whether the system stops at rather than running until it empties.
public bool EndEarly { get; set; }Property Value
EndTime
System age at which the scheduled stop or restart fires.
public float EndTime { get; }Property Value
Frozen
Whether simulation is held in place. sets it when its timer runs out, and it stays set until the system restarts.
public bool Frozen { get; set; }Property Value
HighestControlPoint
Highest control point index this system has touched; some emitters scale their rate by it.
public int HighestControlPoint { get; }Property Value
InEndCap
Whether the system is playing its endcap, the phase an effect runs once it has been told to stop. Only functions whose m_nOpEndCapState allows it run in each phase, so an endcap swaps part of the operator list for another.
public bool InEndCap { get; }Property Value
ParentSystem
The state of the system running this one as a child, or null for a root system.
public ParticleSystemState? ParentSystem { get; }Property Value
ParticleCount
How many particles the system has spawned over its life.
public long ParticleCount { get; set; }Property Value
PlayEndCapOnEnd
Whether reaching also starts the endcap.
public bool PlayEndCapOnEnd { get; }Property Value
RestartOnEnd
Whether reaching replays the system rather than ending it.
public bool RestartOnEnd { get; }Property Value
WorldTime
The renderer's clock, in seconds, as fed to the shaders' g_flTime. Unlike
it to decorrelate repeat plays of an effect actually get a different sample each time. Child systems read the root's value.
public float WorldTime { get; set; }Property Value
Methods
ClearEndCap()
Leaves the endcap phase and unfreezes.
public void ClearEndCap()GetControlPoint(int)
Gets a control point, creating it and every index below it on first use.
public ControlPoint GetControlPoint(int cp)Parameters
cp int
The control point index.
Returns
GetControlPointSnapshot(int)
Gets the snapshot bound to a control point, preferring this system's own binding and falling back to an ancestor so a child can read a snapshot inherited from a parent control point.
public ParticleSnapshot? GetControlPointSnapshot(int cp)Parameters
cp int
Returns
SetControlPoint(int, ControlPoint)
Replaces a control point, on the root system so every child sees it.
public void SetControlPoint(int cp, ControlPoint point)Parameters
cp int
The control point index.
point ControlPoint
The control point to store.
SetControlPointOrientation(int, Vector3)
Set the orientation/direction of a control point in the particle system.
public void SetControlPointOrientation(int cp, Vector3 orientation)Parameters
cp int
Control point index.
orientation Vector3
Orientation direction to assign.
SetControlPointRotation(int, Quaternion)
Set the full rotation of a control point, keeping its forward direction in sync.
public void SetControlPointRotation(int cp, Quaternion rotation)Parameters
cp int
Control point index.
rotation Quaternion
Full rotation to assign.
SetControlPointValue(int, Vector3)
Set the value/position of a control point in the particle system.
public void SetControlPointValue(int cp, Vector3 position)Parameters
cp int
Control point index.
position Vector3
World-space position to assign.
SetControlPointValueComponent(int, int, float)
Writes one component of a control point's position.
public void SetControlPointValueComponent(int cp, int component, float value)Parameters
cp int
The control point index.
component int
Which of the three position components to write.
value float
The value to write.
SetRestartTime(float)
Replays the system from the beginning after duration.
public void SetRestartTime(float duration)Parameters
duration float
SetStopTime(float, bool, bool)
Ends the system after duration: emission stops, and with destroyInstantly the particles still alive are dropped instead of being left to finish their lifetimes. With playEndCap the stop also starts the endcap.
public void SetStopTime(float duration, bool destroyInstantly, bool playEndCap)Parameters
duration float
destroyInstantly bool
playEndCap bool
StartEndCap()
Enters the endcap phase, unless the system is in it already.
public void StartEndCap()
