public class Sandbox.Spline
Collection of curves in 3D space. Shape and behavior of the curves are controled through points `Sandbox.Spline.Point`, each with customizable handles, roll, scale, and up vectors. Two consecutive points define a segment/curve of the spline. By adjusting the handles both smooth and sharp corners can be created. The spline can also be turned into a loop, combined with linear tangents this can be used to create polygons. Splines can also be used used for animations, camera movements, marking areas, or procedural geometry generation.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 1 constructors
public Spline()
No results match this filter.
Methods
Showing 14 methods
public int AddPointAtDistance(float distance, bool inferTangentModes = False)
Adds a point at a specific distance along the spline. Returns the index of the added spline point. Tangents of the new point and adjacent points will be calculated so the spline shape remains the same. Unless inferTangentModes is set to true, in which case the tangent modes will be inferred from the adjacent points.
Parameters
inferTangentModes: Default: False
public void Clear()
Removes all points from the spline.
public float GetDistanceAtPoint(int pointIndex)
Fetches how far along the spline a point is.
public BBox GetSegmentBounds(int segmentIndex)
Bounds of an individual spline segment.
public float GetSegmentLength(int segmentIndex)
Fetches the length of an individual spline segment.
public void RemovePoint(int pointIndex)
Removes the point at the specified index.
public Sandbox.Spline.Sample SampleAtClosestPosition(Vector3 position)
Calculates a bunch of information about the spline at the position closest to the specified position.
No results match this filter.
Properties
Showing 5 properties
public bool Sandbox.Spline.IsLoop { get; set; }
Whether the spline forms a loop.
public int Sandbox.Spline.PointCount { get; set; }
Number of points in the spline.
public int Sandbox.Spline.SegmentCount { get; set; }
Number of segments in the spline, a spline contains one less segment than points.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Sandbox.Spline |