class Spline

in global :: Sandbox

Collection of curves in 3D space. Shape and behavior of the curves are controled through points , 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.


public Action SplineChanged

Invoked everytime the spline shape or the properties of the spline change.

public bool IsLoop { get; set; }

Whether the spline forms a loop.

public Spline.Sample SampleAtDistance( float distance )

Calculates a bunch of information about the spline at a specific distance.

public Spline.Sample SampleAtClosestPosition( Vector3 position )

Calculates a bunch of information about the spline at the position closest to the specified position.

public float Length { get; }

Total length of the spline.

public BBox Bounds { get; }

Total bounds of the spline.

public float GetDistanceAtPoint( int pointIndex )

Fetches how far along the spline a point is.

public float GetSegmentLength( int segmentIndex )

Fetches the length of an individual spline segment.

public BBox GetSegmentBounds( int segmentIndex )

Bounds of an individual spline segment.

public Spline.Point GetPoint( int pointIndex )

Access the information about a spline point.

public int PointCount { get; }

Number of points in the spline.

public int SegmentCount { get; }

Number of segments in the spline, a spline contains one less segment than points.

public void UpdatePoint( int pointIndex, Spline.Point updatedPoint )

Update the information stored at a spline point.

public void InsertPoint( int pointIndex, Spline.Point newPoint )

Adds a point at an index

public void AddPoint( Spline.Point newPoint )

Adds a point to the end of the spline.

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.

public void RemovePoint( int pointIndex )

Removes the point at the specified index.

public void Clear( )

😔 No documentation found.

public void ConvertToPolyline( ref List<Vector3> outPolyLine )

😔 No documentation found.

public List<Vector3> ConvertToPolyline( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public Spline( )

😔 No documentation found.