Spline
public class Spline Collection of curves in 3D space. Shape and behavior of the curves are controled through points 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.
Constructors
Spline() Properties
| Name | Type | Description |
|---|---|---|
IsLoop | Boolean | Whether the spline forms a loop. |
Length | Single | Total length of the spline. |
Bounds | BBox | Total bounds of the spline. |
PointCount | Int32 | Number of points in the spline. |
SegmentCount | Int32 | Number of segments in the spline, a spline contains one less segment than points. |
Methods
Sample SampleAtDistance(Single distance) Calculates a bunch of information about the spline at a specific distance.
Sample SampleAtClosestPosition(Vector3 position) Calculates a bunch of information about the spline at the position closest to the specified position.
Single GetDistanceAtPoint(Int32 pointIndex) Fetches how far along the spline a point is.
Single GetSegmentLength(Int32 segmentIndex) Fetches the length of an individual spline segment.
BBox GetSegmentBounds(Int32 segmentIndex) Bounds of an individual spline segment.
Point GetPoint(Int32 pointIndex) Access the information about a spline point.
Void UpdatePoint(Int32 pointIndex, Point updatedPoint) Update the information stored at a spline point.
Void InsertPoint(Int32 pointIndex, Point newPoint) Adds a point at an index
Void AddPoint(Point newPoint) Adds a point to the end of the spline.
Int32 AddPointAtDistance(Single distance, Boolean 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.
Void RemovePoint(Int32 pointIndex) Removes the point at the specified index.
Void Clear() Removes all points from the spline.
Void ConvertToPolyline(List<Vector3> outPolyLine) List<Vector3> ConvertToPolyline() Converts the spline to a polyline.
Fields
| Name | Type | Description |
|---|---|---|
SplineChanged | Action | Invoked everytime the spline shape or the properties of the spline change. |