Class ControlPoint
Namespace: ValveResourceFormat.Particles
Assembly: ValveResourceFormat.dll
Control point used in Valve particle systems. Control point 0 is the default spawn position. Each system holds its own copy, and a write reaches the same control point of every system below the one it is made on, never the systems above.
public class ControlPointInheritance
object ← ControlPoint
Constructors
ControlPoint()
Creates a control point that belongs to no system.
public ControlPoint()Properties
AttachType
Different attachment styles.
public ParticleAttachment AttachType { get; set; }Property Value
ChangeAge
How long ago the control point last changed. One more than the owner's age when it never has.
public float ChangeAge { get; }Property Value
float
ChangeTime
The age of ControlPoint.Owner when the position or orientation last changed, or -1 when neither has.
public float ChangeTime { get; }Property Value
float
Forward
The forward axis, (1, 0, 0) until something orients the control point.
public Vector3 Forward { get; }Property Value
ForwardPrevious
The forward axis at the end of the previous frame.
public Vector3 ForwardPrevious { get; }Property Value
Left
The left axis, (0, 1, 0) until something orients the control point.
public Vector3 Left { get; }Property Value
LeftPrevious
The left axis at the end of the previous frame.
public Vector3 LeftPrevious { get; }Property Value
Model
The model bound to this control point, such as the model an effect is attached to, or null when none is. Model inputs of type PM_TYPE_CONTROL_POINT read it. Setting it does not count as a change of the control point.
public Model? Model { get; set; }Property Value
ModelObject
The object carrying a model this control point is bound to, such as the entity an effect is attached to, or null when none is. Setting it also sets ControlPoint.Model, and like that it does not count as a change of the control point.
public IParticleModelObject? ModelObject { get; set; }Property Value
Orientation
The forward direction of this control point. Setting it builds left and up around the new forward, and a zero direction restores the default axes.
public Vector3 Orientation { get; set; }Property Value
OrientationPrevious
The forward direction at the end of the previous frame.
public Vector3 OrientationPrevious { get; }Property Value
Position
The position of this control point. Sometimes this is used for things other than position. Setting a different value counts as a change of the control point.
public Vector3 Position { get; set; }Property Value
PositionPrevious
The position this control point had at the end of the previous frame, used to derive the control point's velocity.
public Vector3 PositionPrevious { get; }Property Value
PreviousStepTime
Real time the move recorded in ControlPoint.PositionPrevious took, in seconds.
public float PreviousStepTime { get; }Property Value
float
Rotation
The rotation carrying +X to ControlPoint.Forward, +Y to ControlPoint.Left and +Z to ControlPoint.Up; never null when read. Setting null restores the default axes.
public Quaternion? Rotation { get; set; }Property Value
RotationPrevious
The rotation at the end of the previous frame.
public Quaternion? RotationPrevious { get; }Property Value
StepDelta
How far the control point moved over the last recorded step.
public Vector3 StepDelta { get; }Property Value
Up
The up axis, (0, 0, 1) until something orients the control point.
public Vector3 Up { get; }Property Value
UpPrevious
The up axis at the end of the previous frame.
public Vector3 UpPrevious { get; }Property Value
Velocity
The control point's velocity in units per second, derived from ControlPoint.PositionPrevious over the time that move took. Zero until a step has been recorded.
public Vector3 Velocity { get; }Property Value
Methods
GetBasisAtTime(float)
The axes as rows and ControlPoint.GetPositionAtTime(float) as the translation. The axes are the previous ones at exactly the start of the step and the current ones otherwise.
public Matrix4x4 GetBasisAtTime(float time)Parameters
time float
The time to locate, such as a particle's creation time.
Returns
GetPositionAtTime(float)
The position at time within the step ControlPoint.Owner is simulating, between the previous and the current position. A point without an owner answers with its current position.
public Vector3 GetPositionAtTime(float time)Parameters
time float
The time to locate, such as a particle's creation time.
Returns
GetPreviousRotation()
The control point's rotation at the end of the previous frame.
public Quaternion GetPreviousRotation()Returns
GetPreviousRotationMatrix()
The rotation matrix of the previous frame's axes.
public Matrix4x4 GetPreviousRotationMatrix()Returns
GetRotation()
The control point's rotation.
public Quaternion GetRotation()Returns
GetRotationMatrix()
The rotation matrix with ControlPoint.Forward, ControlPoint.Left and ControlPoint.Up as its rows.
public Matrix4x4 GetRotationMatrix()Returns
GetTransform()
The rotation matrix with ControlPoint.Position as its translation.
public Matrix4x4 GetTransform()Returns
SetComponent(int, float)
Write potentially non positional data to the control point, for the particle to read.
public void SetComponent(int component, float value)Parameters
component int
0, 1, 2
value float
Number
SetOrientation(Vector3, Vector3, Vector3)
Sets the three axes. A change of any of them counts as a change of the control point.
public void SetOrientation(Vector3 forward, Vector3 left, Vector3 up)Parameters
forward Vector3
The forward axis.
left Vector3
The left axis.
up Vector3
The up axis.
SetOrientation(Quaternion)
Sets the three axes from a rotation.
public void SetOrientation(Quaternion rotation)Parameters
rotation Quaternion
The rotation, which carries +X to forward.
StepFraction(ParticleSystemState, float)
How far from the previous to the current state time falls within the step state is simulating, clamped to [0, 1]. A time at the end of the step, or a zero step, reads as current.
public static float StepFraction(ParticleSystemState state, float time)Parameters
state ParticleSystemState
The asking system, whose clock time is on.
time float
The time to locate, such as a particle's creation time.
Returns
float

