A list of transforms that usually represents a path in 3D space. These form the basis for brush strokes and camera paths
Name | Return Type | Description |
---|---|---|
count | number Read-only | Returns the number of points in this path |
this[index] | Transform Read-only | Returns the point at the specified index |
last | Transform Read-only | Returns the last point in this path |
Creates a new empty Path
Returns: Path
myPath = Path:New()
Creates a path from a list of Transforms
Returns: Path
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transformList | Transform[] | The list of transforms |
myPath = Path:New({transform1, transform2, transform3})
Creates a path from a list of Vector3 positions
Returns: Path
Parameters:
Name | Type | Default | Description |
---|---|---|---|
positionList | Vector3[] | The list of positions |
myPath = Path:New({position1, position2, position3})
Generates a hermite spline
Returns: Path (A new Path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
startTransform | Transform | Starting transformation | |
endTransform | Transform | End transformation | |
startTangent | Vector3 | Starting tangent | |
endTangent | Vector3 | End tangent | |
resolution | number | Resolution of the spline | |
tangentStrength | number | 1 | Strength of the tangent |
myPath:Hermite(startTransform, endTransform, startTangent, endTangent, resolution, tangentStrength)
Returns a vector representing the direction of the path at the given point
Returns: Vector3
Parameters:
Name | Type | Default | Description |
---|---|---|---|
index | number | Index of control point to use |
myPath:GetDirection(3)
Returns a vector representing the normal of the path at the given point
Returns: Vector3
Parameters:
Name | Type | Default | Description |
---|---|---|---|
index | number | Index of control point to use |
myPath:GetNormal(3)
Returns a vector representing the tangent of the path at the given point
Returns: Vector3
Parameters:
Name | Type | Default | Description |
---|---|---|---|
index | number | Index of control point to use |
myPath:GetTangent(3)
Draws this path as a brush stroke using current settings
Returns: nil
myPath:Draw()
Inserts a new point at the end of the path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | Transform | The transform to be inserted at the end of the path |
myPath:Insert(myTransform
Inserts a new point at the specified index
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | Transform | The transform to be inserted | |
index | number | The index at which to insert the transform |
myPath:Insert(transform, index)
Transforms all points in the path by the specific amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | Transform | The transform to be applied to all points in the path |
myPath:TransformBy(transform)
Changes the position of all points in the path by a given amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
amount | Vector3 | The distance to move the points |
myPath:TranslateBy(Vector3:up)
Rotates all points in the path around the origin by a given amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
amount | Rotation | The amount by which to rotate the path |
myPath:RotateBy(Rotation.New(45, 0, 0)
Scales the path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
scale | Vector3 | The scaling factor to apply to the path |
myPath:ScaleBy(Vector3:New(2, 1, 1)
Moves all points on the path so that their common center is the origin
Returns: nil
myPath:Center()
Reorders the points so that point at the given index is shifted to be the first point
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
index | number | The index of the point to make the new first point |
myPath:StartingFrom(3)
Returns the index of the point closest to the given position
Returns: number
Parameters:
Name | Type | Default | Description |
---|---|---|---|
point | Vector3 | The 3D position that we are seeking the closest to |
myPath:FindClosest(Vector3:New(10, 2, 4)
Returns the index of the point with the smallest X value
Returns: number
myPath:FindMinimumX()
Returns the index of the point with the smallest Y value
Returns: number
myPath:FindMinimumY()
Returns the index of the point with the smallest Z value
Returns: number
myPath:FindMinimumZ()
Returns the index of the point with the biggest X value
Returns: number
myPath:FindMaximumX()
Returns the index of the point with the biggest Y value
Returns: number
myPath:FindMaximumY()
Returns the index of the point with the biggest Z value
Returns: number
myPath:FindMaximumZ()
Scales and shifts all points so that they fit in a cube of the given size at the origin
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
size | number | 1 | The size of the cube to fit the path into |
myPath:Normalize(size)
Resamples the path evenly by distance
Returns: nil (The new path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
spacing | number | The space between points in the new path |
myPath:SampleByDistance(spacing)
Resamples the path evenly into the specified number of points
Returns: nil (The new path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
count | number | The number of points in the new path |
myPath:SampleByCount(count)
Subdivides each path segment into the specified number of parts
Returns: nil (The new path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parts | number | Number of parts to subdivide into |
myPath:SubdivideSegments(parts)