Class PathTrack
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
path_track. A node of the track a FuncTrackTrain runs along, linked to the next one by target and optionally branching to an altpath.
public class PathTrack : BaseEntityInheritance
object ← BaseEntity ← PathTrack
Inherited Members
BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.RigidTransform, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.SpawnData, BaseEntity.NameFixup, BaseEntity.SpawnGroup, BaseEntity.KeyValues, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.SpawnTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.WorldOrigin, BaseEntity.WorldAngles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.IsShown, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.CreateRootNode(), BaseEntity.CreateEditorNode(ObjectTypeFlags), BaseEntity.CreateEffect(string?, ParticleSnapshot?, bool), BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.AcceptsTouchFrom(BaseEntity), BaseEntity.OnStartTouch(BaseEntity), BaseEntity.OnTouch(BaseEntity), BaseEntity.OnEndTouch(BaseEntity), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.JumpTo(Vector3, Vector3), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.InputKill(EntityInputData), BaseEntity.InputFireUser1(EntityInputData), BaseEntity.InputFireUser2(EntityInputData), BaseEntity.InputFireUser3(EntityInputData), BaseEntity.InputFireUser4(EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.PhysicsSimulate(float), BaseEntity.TurnsByAngleComponents, BaseEntity.IsPusher, BaseEntity.IsUnblockableByPlayer, BaseEntity.MovesWithoutPushing, BaseEntity.PushesPlayerAsTrain, BaseEntity.HasVPhysicsSolid, BaseEntity.OnStartBlocked(BaseEntity), BaseEntity.OnBlocked(BaseEntity), BaseEntity.OnEndBlocked(), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.TurnBody(Vector3, Vector3), BaseEntity.SetOriginAndAngles(Vector3, Vector3), BaseEntity.SetWorldOriginAndAngles(Vector3, Vector3), BaseEntity.AddNode(SceneNode, bool), BaseEntity.OnRemove(), BaseEntity.UpdateTransform(), BaseEntity.UpdateColliderTransform(), BaseEntity.UpdateRenderTransform(float), BaseEntity.SnapInterpolation(), BaseEntity.AngleMod(float), BaseEntity.DispatchInput(string, EntityInputData)
Constructors
PathTrack(EntitySystem, EntitySpawnInfo)
Initializes a path_track from its keyvalues.
public PathTrack(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
IsEnabled
Gets whether a train looking ahead with move set can pass this node.
public bool IsEnabled { get; }Property Value
bool
OrientationType
Gets how a train orients itself at this node.
public PathTrack.Orientation OrientationType { get; }Property Value
Speed
Gets the speed a train takes on passing this node, or 0 to keep its own.
public float Speed { get; }Property Value
float
Methods
Activate()
Called once every entity of its spawn group has spawned, to resolve other entities by name.
public override void Activate()Remarks
Only a named node links, and only forward; the link back is made by the node before it.
DispatchInput(string, EntityInputData)
Runs the handler declared with EntityInputAttribute for an input.
protected override bool DispatchInput(string inputName, EntityInputData data)Parameters
inputName string
data EntityInputData
Returns
bool
true when a handler ran.
GetNext()
Gets the node after this one, the alternate path while it is enabled going forward.
public PathTrack? GetNext()Returns
GetNextInDir(bool)
Gets PathTrack.GetNext() going forward, otherwise PathTrack.GetPrevious().
public PathTrack? GetNextInDir(bool forward)Parameters
forward bool
Returns
GetOrientation(bool)
Gets the angles a train has at this node: the node's own angles for PathTrack.Orientation.FacePathAngles, otherwise the direction of the path from this node, or into it at the end of the path.
public Vector3 GetOrientation(bool forward)Parameters
forward bool
Returns
GetPrevious()
Gets the node before this one, the alternate path while it is enabled going backward.
public PathTrack? GetPrevious()Returns
InputDisableAlternatePath(EntityInputData)
Sends trains down the main path.
[EntityInput("DisableAlternatePath")]
protected void InputDisableAlternatePath(EntityInputData data)Parameters
data EntityInputData
InputDisablePath(EntityInputData)
Stops trains passing.
[EntityInput("DisablePath")]
protected void InputDisablePath(EntityInputData data)Parameters
data EntityInputData
InputEnableAlternatePath(EntityInputData)
Sends trains down the alternate path, when there is one.
[EntityInput("EnableAlternatePath")]
protected void InputEnableAlternatePath(EntityInputData data)Parameters
data EntityInputData
InputEnablePath(EntityInputData)
Lets trains pass.
[EntityInput("EnablePath")]
protected void InputEnablePath(EntityInputData data)Parameters
data EntityInputData
InputInPass(EntityInputData)
Fires OnPass.
[EntityInput("InPass")]
protected void InputInPass(EntityInputData data)Parameters
data EntityInputData
InputToggleAlternatePath(EntityInputData)
Toggles which path trains take, when there is an alternate one.
[EntityInput("ToggleAlternatePath")]
protected void InputToggleAlternatePath(EntityInputData data)Parameters
data EntityInputData
InputTogglePath(EntityInputData)
Toggles whether trains can pass.
[EntityInput("TogglePath")]
protected void InputTogglePath(EntityInputData data)Parameters
data EntityInputData
LookAhead(ref Vector3, float, bool, out PathTrack?)
Walks the path from this node, starting at origin, for |dist| units: forward when positive, backward when negative.
public PathTrack? LookAhead(ref Vector3 origin, float dist, bool move, out PathTrack? nextNext)Parameters
origin Vector3
Where to start, in the move parent frame; receives the point reached.
dist float
The signed distance to walk.
move bool
Whether disabled nodes stop the walk. Without it, running off the end of the path carries on in a straight line past the last node.
nextNext PathTrack?
Receives the node after the returned one.
Returns
The last node passed, the one behind the point reached, or null at the end of the path.
Spawn()
Sets up the entity (model, class keyvalues, first think). Called once the entity's spawn group has created all entities of the group, after the move parent has spawned.
public override void Spawn()Remarks
An override calls this first: it builds the node from BaseEntity.CreateRootNode() and snaps the entity onto its parent's attachment, which the rest of the override reads.
ValidPath(PathTrack?, bool)
Gets node, or null when there is none or testFlag is set and it is disabled.
public static PathTrack? ValidPath(PathTrack? node, bool testFlag)Parameters
node PathTrack?
testFlag bool

