API

Did you read the API Introduction?

The complete API reference can be found here, this is just a summary of the most important methods and properties, listed by category:

General

This applies both to CurvySpline and CurvySplineGroup

IsInitialized

Before using any spline API, be sure to check whether the spline is fully initialized, see API Introduction

Refresh()

Refreshes the spline (i.e. updates the cache). This is called automatically at the regular Update() call if neccessary. The only reason you may need to call this by yourself is if you manipulate the spline by code and want to read data from the spline directly afterwards.

Refresh() rebuilds the cache only if neccessary, so calling it multiple times won't affect performance!

Unit Conversion

CurvySpline

TFToDistance()

Converts a given TF value into world units distance from spline's start

DistanceToTF()

Converts a given world units distance value into TF

CurvySplineSegment

LocalFToDistance()

Converts a given F value into world unit distance from segment's start

DistanceToLocalF()

Converts a given world units distance value into F

LocalFToTF()

Converts a local F into TF

Getting spline data

This applies to both CurvySpline and CurvySplineSegment

Interpolate()

Gets the position for a given TF or F

GetTangent()

Gets the tangent/direction for a given TF or F

GetOrientationUpFast()

Gets the Up vector for a given TF or F

GetOrientationFast()

Gets the rotation for a given TF or F, i.e. LookRotation(tangent,up)

Movement

Movement methods work by changing an input TF value to reflect a movement over a certain portion of the spline

Move()

Moves by a certain TF distance

MoveBy()

Moves by a certain world units distance by extrapolating the distance using the current curvation

MoveByLengthFast()

Moves by a certain world units distance by using the cached distances

Add/Delete Control Points

Add()

Adds one or more Control Points

Delete()

Deletes a Control Point

Clear()

Remove all Control Points

Discussion

Enter your comment:
R I G D Y
 
Last modified: 2017/02/16 08:58 by Jake