Obi  6.4
Unified particle physics for Unity
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Obi.ObiPath Class Reference

Public Member Functions

int GetSpanCount ()
 
int GetSpanControlPointForMu (float mu, out float spanMu)
 
int GetClosestControlPointIndex (float mu)
 
float GetMuAtLenght (float length)
 
float RecalculateLenght (Matrix4x4 referenceFrame, float acc, int maxevals)
 
void SetName (int index, string name)
 
string GetName (int index)
 
void AddControlPoint (Vector3 position, Vector3 inTangentVector, Vector3 outTangentVector, Vector3 normal, float mass, float rotationalMass, float thickness, int filter, Color color, string name)
 
void InsertControlPoint (int index, Vector3 position, Vector3 inTangentVector, Vector3 outTangentVector, Vector3 normal, float mass, float rotationalMass, float thickness, int filter, Color color, string name)
 
int InsertControlPoint (float mu)
 
void Clear ()
 
void RemoveControlPoint (int index)
 
void FlushEvents ()
 

Public Attributes

ObiPointsDataChannel m_Points = new ObiPointsDataChannel()
 
UnityEvent OnPathChanged = new UnityEvent()
 
PathControlPointEvent OnControlPointAdded = new PathControlPointEvent()
 
PathControlPointEvent OnControlPointRemoved = new PathControlPointEvent()
 
PathControlPointEvent OnControlPointRenamed = new PathControlPointEvent()
 

Protected Attributes

bool dirty = false
 
const int arcLenghtSamples = 20
 
List< float > m_ArcLengthTable = new List<float>()
 
float m_TotalSplineLenght = 0.0f
 

Properties

ObiPointsDataChannel points [get]
 
ObiNormalDataChannel normals [get]
 
ObiColorDataChannel colors [get]
 
ObiThicknessDataChannel thicknesses [get]
 
ObiMassDataChannel masses [get]
 
ObiRotationalMassDataChannel rotationalMasses [get]
 
ObiPhaseDataChannel filters [get]
 
ReadOnlyCollection< float > ArcLengthTable [get]
 
float Length [get]
 
int ArcLengthSamples [get]
 
int ControlPointCount [get]
 
bool Closed [get, set]
 

Member Function Documentation

float Obi.ObiPath.GetMuAtLenght ( float  length)

Returns the curve parameter (mu) at a certain length of the curve, using linear interpolation of the values cached in arcLengthTable.

float Obi.ObiPath.RecalculateLenght ( Matrix4x4  referenceFrame,
float  acc,
int  maxevals 
)

Recalculates spline arc lenght in world space using Gauss-Lobatto adaptive integration.

Parameters
accminimum accuray desired (eg 0.00001f)
maxevalsmaximum number of spline evaluations we want to allow per segment.

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