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

Classes

class  Stitch
 

Public Member Functions

void OnEnable ()
 
void OnDisable ()
 
int AddStitch (int particle1, int particle2)
 
void RemoveStitch (int index)
 
void Clear ()
 
void PushDataToSolver ()
 

Public Attributes

ObiNativeIntList particleIndices = new ObiNativeIntList()
 
ObiNativeFloatList stiffnesses = new ObiNativeFloatList()
 
ObiNativeFloatList lambdas = new ObiNativeFloatList()
 

Properties

ObiActor Actor1 [get, set]
 
ObiActor Actor2 [get, set]
 
int StitchCount [get]
 
IEnumerable< StitchStitches [get]
 

Detailed Description

ObiStitcher will create stitch constraints between 2 actors. All actors must be assigned to the same solver.

  • Add the constraint batch to the solver once all actors have been added.
  • If any of the actors is removed from the solver, remove the stitcher too.
  • Stitch constraints can keep n particles together, respecting their masses.
  • In edit mode, select the actors to be stitched and then select groups of particles and click "stitch". Or, create stitches by closeness.

Member Function Documentation

int Obi.ObiStitcher.AddStitch ( int  particle1,
int  particle2 
)

Adds a new stitch to the stitcher. Note that unlike calling Clear(), AddStitch does not automatically perform a PushDataToSolver(). You should manually call it once you're done adding multiple stitches.

Parameters
indexof a particle in the first actor.
indexof a particle in the second actor.
Returns
constrant index, that can be used to remove it with a call to RemoveStitch.
void Obi.ObiStitcher.RemoveStitch ( int  index)

Removes. Note that unlike calling Clear(), AddStitch does not automatically perform a PushDataToSolver(). You should manually call it once you're done adding multiple stitches.

Parameters
constraintindex.

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