Particle Playground - Script Reference  3.0.1
Framework for controlling particles in the Unity Engine.
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PlaygroundSplines.PlaygroundSpline Class Reference

Holds information about a spline and contains functions for working with the nodes and bezier handles. More...

Inheritance diagram for PlaygroundSplines.PlaygroundSpline:

Public Member Functions

bool IsReady ()
 
bool AddUser (Transform thisTransform)
 Adds a user to the spline. This helps keeping track of which objects are using the spline. More...
 
bool RemoveUser (Transform thisTransform)
 Removes a user from the spline. This helps keeping track of which objects are using the spline. More...
 
bool HasUser (Transform thisTransform)
 Determines whether this spline has the user of passed in transform. More...
 
Vector3 GetControlPoint (int index)
 Gets the control point. More...
 
void SetControlPoint (int index, Vector3 point, Vector3 offset)
 Sets the control point and withdraws the offset. More...
 
void SetControlPoint (int index, Vector3 point)
 Sets the control point. More...
 
void SetPoints (Vector3[] vectors)
 Sets all points from an array. Please ensure the same length of your passed in vectors as PlaygroundSpline.ControlPointCount. More...
 
bool PointHasTransform (int index)
 
void TranslateSpline (Vector3 translation)
 Moves the entire spline separate from its transform component. Use this if you'd like to offset the spline from its transform separately from the positionOffset. More...
 
Vector3 GetTransformPosition ()
 
Quaternion GetTransformRotation ()
 
Vector3 GetTransformScale ()
 
BezierControlPointMode GetControlPointMode (int index)
 
void SetControlPointMode (int index, BezierControlPointMode mode)
 
Vector3 GetPoint (float t)
 Get position from time. More...
 
Vector3 GetVelocity (float t)
 
Vector3 GetPoint (int index)
 Get position from node index in the spline. If the node consists of an available transform its position will be returned, otherwise the user-specified Vector3 position. More...
 
Vector3 GetInversePoint (int index)
 
Vector3 GetPointWorldSpace (int index)
 
float ClosestTimeFromPoint (Vector3 aP)
 
Vector3 ClosestPointFromPosition (Vector3 aP)
 
Vector3 GetDirection (float t)
 
void AddNode ()
 Adds a node at the last position of the node index. More...
 
void AddNode (int index)
 Adds a node at specified node index. More...
 
void RemoveFirst ()
 Removes the first node in the node index. More...
 
void RemoveLast ()
 Removes the last node in the node index. More...
 
void RemoveNode (int index)
 Removes a node at specified node index. More...
 
void ReverseAllNodes ()
 Reverses all nodes in the node index. More...
 
void SwapNodes (int from, int to)
 
Transform[] ExportToTransforms ()
 Exports all nodes to Transform[]. Enable exportWithNodeStructure to parent each bezier handle to their node. More...
 
Vector3[] ExportToVector3 ()
 Exports all nodes to Vector3[]. More...
 
void Reset ()
 Reset this Playground Spline. Two nodes and two bezier handles will be created. More...
 

Public Attributes

List< TransformNodetransformNodes = new List<TransformNode>()
 The list of transform nodes to set positions live of an existing node. More...
 
bool reverse
 Determines if the spline time should be reversed. If you'd like to physically reverse the arrays making the spline then call ReverseAllNodes(). More...
 
float timeOffset
 The time offset of the spline. More...
 
Vector3 positionOffset
 The position offset of the spline in relation to its transform. More...
 
Transform splineTransform
 
Matrix4x4 splineTransformMx
 
List< Transform > usedBy = new List<Transform>()
 
float fixedVelocityOnNewNode = .5f
 
bool moveTransformsAsBeziers = false
 
bool exportWithNodeStructure = false
 
bool drawGizmo = true
 
float bezierWidth = 2f
 

Static Public Attributes

static bool drawSplinePreviews = true
 

Properties

bool Loop [get, set]
 Gets or sets a value indicating whether this PlaygroundSplines.PlaygroundSpline is set to loop. More...
 
int ControlPointCount [get]
 Gets the control point count. More...
 
int NodeCount [get]
 

Detailed Description

Holds information about a spline and contains functions for working with the nodes and bezier handles.

Member Function Documentation

void PlaygroundSplines.PlaygroundSpline.AddNode ( )

Adds a node at the last position of the node index.

void PlaygroundSplines.PlaygroundSpline.AddNode ( int  index)

Adds a node at specified node index.

Parameters
indexIndex.
bool PlaygroundSplines.PlaygroundSpline.AddUser ( Transform  thisTransform)

Adds a user to the spline. This helps keeping track of which objects are using the spline.

Returns
true, if user was added, false otherwise.

.

Transform [] PlaygroundSplines.PlaygroundSpline.ExportToTransforms ( )

Exports all nodes to Transform[]. Enable exportWithNodeStructure to parent each bezier handle to their node.

Returns
A built-in array of Transforms.
Vector3 [] PlaygroundSplines.PlaygroundSpline.ExportToVector3 ( )

Exports all nodes to Vector3[].

Returns
A built-in array of Vector3
Vector3 PlaygroundSplines.PlaygroundSpline.GetControlPoint ( int  index)

Gets the control point.

Returns
The control point.
Parameters
indexIndex.
Vector3 PlaygroundSplines.PlaygroundSpline.GetPoint ( float  t)

Get position from time.

Returns
The point in world space.
Parameters
tTime.
Vector3 PlaygroundSplines.PlaygroundSpline.GetPoint ( int  index)

Get position from node index in the spline. If the node consists of an available transform its position will be returned, otherwise the user-specified Vector3 position.

Returns
The point in world space.
Parameters
indexIndex.
bool PlaygroundSplines.PlaygroundSpline.HasUser ( Transform  thisTransform)

Determines whether this spline has the user of passed in transform.

Returns
true if this spline has the user of the passed in transform; otherwise, false.
Parameters
thisTransformThis transform.
void PlaygroundSplines.PlaygroundSpline.RemoveFirst ( )

Removes the first node in the node index.

void PlaygroundSplines.PlaygroundSpline.RemoveLast ( )

Removes the last node in the node index.

void PlaygroundSplines.PlaygroundSpline.RemoveNode ( int  index)

Removes a node at specified node index.

Parameters
indexIndex.
bool PlaygroundSplines.PlaygroundSpline.RemoveUser ( Transform  thisTransform)

Removes a user from the spline. This helps keeping track of which objects are using the spline.

Returns
true, if user was removed, false otherwise.

.

void PlaygroundSplines.PlaygroundSpline.Reset ( )

Reset this Playground Spline. Two nodes and two bezier handles will be created.

void PlaygroundSplines.PlaygroundSpline.ReverseAllNodes ( )

Reverses all nodes in the node index.

void PlaygroundSplines.PlaygroundSpline.SetControlPoint ( int  index,
Vector3  point,
Vector3  offset 
)

Sets the control point and withdraws the offset.

Parameters
indexIndex.
pointPoint.
offsetOffset.
void PlaygroundSplines.PlaygroundSpline.SetControlPoint ( int  index,
Vector3  point 
)

Sets the control point.

Parameters
indexIndex.
pointPosition.
void PlaygroundSplines.PlaygroundSpline.SetPoints ( Vector3[]  vectors)

Sets all points from an array. Please ensure the same length of your passed in vectors as PlaygroundSpline.ControlPointCount.

Parameters
vectorsVectors.
void PlaygroundSplines.PlaygroundSpline.TranslateSpline ( Vector3  translation)

Moves the entire spline separate from its transform component. Use this if you'd like to offset the spline from its transform separately from the positionOffset.

Parameters
translationThe amount to move the spline in Units.

Member Data Documentation

Vector3 PlaygroundSplines.PlaygroundSpline.positionOffset

The position offset of the spline in relation to its transform.

bool PlaygroundSplines.PlaygroundSpline.reverse

Determines if the spline time should be reversed. If you'd like to physically reverse the arrays making the spline then call ReverseAllNodes().

float PlaygroundSplines.PlaygroundSpline.timeOffset

The time offset of the spline.

List<TransformNode> PlaygroundSplines.PlaygroundSpline.transformNodes = new List<TransformNode>()

The list of transform nodes to set positions live of an existing node.

Property Documentation

int PlaygroundSplines.PlaygroundSpline.ControlPointCount
get

Gets the control point count.

The control point count.

bool PlaygroundSplines.PlaygroundSpline.Loop
getset

Gets or sets a value indicating whether this PlaygroundSplines.PlaygroundSpline is set to loop.

true if set to loop; otherwise, false.


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