Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Curve3 Interface Reference

Represents three 2D curves, where every four floats next to each other in the underlying array are organized as (x, y0, y1, y2). More...

Inheritance diagram for Curve3:
[legend]

Public Member Functions

vector GetPoint (int pointIndex, int curveIndex)
 
void SetPointValue (int pointIndex, int curveIndex, float value)
 
- Public Member Functions inherited from array< float >
proto native int Count ()
 O(1) complexity.
 
proto native bool IsEmpty ()
 
proto native void Clear ()
 Destroys all elements of the array and sets the Count to 0.
 
proto native void Compact ()
 Frees any underlying memory which is not used.
 
proto void Set (int n, T value)
 Sets n-th element to given value.
 
proto int Find (T value)
 Tries to find the first occurrence of value in the array.
 
proto bool Contains (T value)
 Returns whether value is in array or not.
 
proto T Get (int n)
 
proto int Insert (T value)
 Inserts element at the end of array.
 
proto int InsertAt (T value, int index)
 Inserts element at certain position and moves all elements behind this position by one.
 
void InsertAll (notnull array< T > from)
 Inserts all elements from array.
 
proto native void Remove (int index)
 Removes element from array.
 
proto native void RemoveOrdered (int index)
 Removes element from array, but retains all elements ordered.
 
proto native void Resize (int newSize)
 Resizes the array to given size.
 
proto native void Reserve (int newSize)
 Reserve memory for given number of elements.
 
proto native void Swap (notnull array< T > other)
 Swaps the contents of this and other arrays.
 
proto native void Sort (bool reverse=false)
 Sorts elements of array, depends on underlying type.
 
proto native bool IsIndexValid (int index)
 Returns whether provided element index of array is valid.
 
proto int Copy (notnull array< T > from)
 Copies contents of from array to this array.
 
proto int Init (T init[])
 
proto bool RemoveItem (T value)
 Removes element from array.
 
proto bool RemoveItemOrdered (T value)
 Removes element from array, but retain all elements ordered.
 
void Debug ()
 Print all elements in array.
 
int GetRandomIndex ()
 Returns a random index of array.
 
GetRandomElement ()
 Returns a random element of array.
 
void SwapItems (int item1_index, int item2_index)
 

Detailed Description

Represents three 2D curves, where every four floats next to each other in the underlying array are organized as (x, y0, y1, y2).

Curve points share the x value, and then three separate y values are present, one for each curve.

It is indended to be used as a property in following way:

Curve3 m_Curve;
Definition: attributes.c:259
Represents three 2D curves, where every four floats next to each other in the underlying array are or...
Definition: Math.c:95
Definition: attributes.c:38
static const string GraphDialog
Editor for splines which opens a dialog where the curve can be edited.
Definition: attributes.c:235

It may then be evaluated with following code, where i is index of the curve to be evaluated, ranging from 0 to 2:

Math3D.Curve3(ECurveType.CatmullRom, t, m_Curve, i);
ECurveType
Definition: ECurveType.c:13
Definition: Math3D.c:13
static proto vector Curve3(ECurveType type, float param, notnull Curve3 points, int curveIndex, array< float > knots=null)
Evaluates a single curve from multicurve object.

Member Function Documentation

◆ GetPoint()

vector Curve3.GetPoint ( int  pointIndex,
int  curveIndex 
)
Returns
Vector in format (x, y, 0).

◆ SetPointValue()

void Curve3.SetPointValue ( int  pointIndex,
int  curveIndex,
float  value 
)

The documentation for this interface was generated from the following file: