Vixen
02b45cc4
csharp
public readonly record struct SplinePoint

One control point of a Spline.

Read the guide page for this →

Remarks

Two tangents rather than one, so a corner is expressible. A single tangent forces the curve to be smooth everywhere, and the thing a road and a camera track both need is the occasional hard corner — which is TangentIn ≠ −TangentOut. Mirroring them is what SmoothTangents does, and it is a choice the author makes per point.

Offsets, not directions. Their length is the curve's speed leaving the point, which is what a Hermite segment is parameterised by. Normalising them here would make every segment take the same shape regardless of how far apart its ends are.

Fields and properties (4)

  • public Vector3 Position

    Where it is.

  • public Vector3 TangentIn

    The tangent the curve arrives on, as an offset from .

  • public Vector3 TangentOut

    The tangent the curve leaves on, as an offset from .

  • public float Roll

    How far the frame is twisted about the tangent at this point, in radians.

Methods (3)

  • public SplinePoint(Vector3 Position, Vector3 TangentIn, Vector3 TangentOut, float Roll = 0)

    One control point of a Spline.

  • public static SplinePoint At(Vector3 position)

    A point with no tangents, which makes the segments through it straight.

  • public static SplinePoint Smooth(Vector3 position, Vector3 tangent, float roll = 0)

    A point whose two tangents mirror one another, so the curve is smooth through it.

Used by (13)

  • SplineVixen.Core.Mathematics
  • SplineAssetVixen.Core.Mathematics
  • SplineAssetTestsVixen.Core.Mathematics.Tests
  • SplineTestsVixen.Core.Mathematics.Tests
  • TerrainSplineTestsVixen.Terrain.Tests
  • TrackedDollyTestsVixen.Engine.Tests
  • TypeRegistrationVixen.Core.Mathematics
  • Vixen_Core_Mathematics_SplinePointSerializerVixen.Core.Mathematics
  • SplineCommandVixen.Editor.SceneView
  • SplineEditVixen.Editor.SceneView
  • SplineEditTestsVixen.Editor.SceneView.Tests
  • SplineOverlayVixen.Editor.SceneView
  • SplineOverlayTestsVixen.Editor.SceneView.Tests