Class RailPoseSampler
Pure helper that samples a world-space position and orientation from an ordered list of RailNodePosition nodes using piecewise-linear interpolation. Lives in the Unity layer because it produces UnityEngine.Vector3 and UnityEngine.Quaternion.
Inherited Members
Namespace: Serenity.GameRail.Infrastructure.Utils
Assembly: Serenity.UnityGameRail.Infrastructure.dll
Syntax
public static class RailPoseSampler
Methods
Sample(IReadOnlyList<RailNodePosition>, float, bool, float)
Samples position and orientation along a rail path at the given normalized progress.
Declaration
public static RailPoseSampler.PoseResult Sample(IReadOnlyList<RailNodePosition> nodes, float progress, bool applyOrientation = true, float lookAheadEpsilon = 0.001)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<RailNodePosition> | nodes | Ordered rail nodes (must have at least 2). |
| float | progress | Normalized progress [0..1]. |
| bool | applyOrientation | When true, rotation is derived from the tangent; otherwise identity. |
| float | lookAheadEpsilon | Small offset used to compute the forward tangent direction. |
Returns
| Type | Description |
|---|---|
| RailPoseSampler.PoseResult | Sampled pose, or identity pose if nodes are insufficient. |
ToUnity(RailNodePosition)
Converts an engine-agnostic RailNodePosition to a Unity Vector3.
Declaration
public static Vector3 ToUnity(RailNodePosition node)
Parameters
| Type | Name | Description |
|---|---|---|
| RailNodePosition | node |
Returns
| Type | Description |
|---|---|
| Vector3 |