Splineclass
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.
Constructors1
Showing 1 constructors
public Spline()
No results match this filter.
Methods14
Showing 14 methods
public void AddPoint(Sandbox.Spline.Point newPoint)
Adds a point to the end of the spline.
| Parameter | Type | Description |
|---|---|---|
| newPoint | Point | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| distance | float | — |
| inferTangentModes = False | bool | — |
int—public void Clear()
Removes all points from the spline.
void—public float GetDistanceAtPoint(int pointIndex)
Fetches how far along the spline a point is.
| Parameter | Type | Description |
|---|---|---|
| pointIndex | int | — |
float—public Sandbox.Spline.Point GetPoint(int pointIndex)
Access the information about a spline point.
| Parameter | Type | Description |
|---|---|---|
| pointIndex | int | — |
public BBox GetSegmentBounds(int segmentIndex)
Bounds of an individual spline segment.
| Parameter | Type | Description |
|---|---|---|
| segmentIndex | int | — |
public float GetSegmentLength(int segmentIndex)
Fetches the length of an individual spline segment.
| Parameter | Type | Description |
|---|---|---|
| segmentIndex | int | — |
float—public void InsertPoint(int pointIndex, Sandbox.Spline.Point newPoint)
Adds a point at an index
| Parameter | Type | Description |
|---|---|---|
| pointIndex | int | — |
| newPoint | Point | — |
void—public void RemovePoint(int pointIndex)
Removes the point at the specified index.
| Parameter | Type | Description |
|---|---|---|
| pointIndex | int | — |
void—public Sandbox.Spline.Sample SampleAtClosestPosition(Vector3 position)
Calculates a bunch of information about the spline at the position closest to the specified position.
| Parameter | Type | Description |
|---|---|---|
| position | Vector3 | — |
No results match this filter.
Properties5
Showing 5 properties
public bool Sandbox.Spline.IsLoop { get; set; }
Whether the spline forms a loop.
bool—public int Sandbox.Spline.PointCount { get; set; }
Number of points in the spline.
int—public int Sandbox.Spline.SegmentCount { get; set; }
Number of segments in the spline, a spline contains one less segment than points.
int—No results match this filter.