Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.RigBuilder Class Reference

Rig builder. More...

Inheritance diagram for Dragengine.Scenery.RigBuilder:

Public Member Functions

Constructors
RigBuilder new ()
 Create rig builder. More...
 

Management

Rig build (String filename)
 Build rig using filename. More...
 
void buildRig ()
 Build rig. More...
 
void setModelCollision (bool modelCollision)
 Set if component model is used for collision instead of shapes if present. More...
 
void addBone (String name, int parent, Vector position, Vector rotation, Vector centralMassPoint, bool dynamic, float mass, Vector ikLimitsLower, Vector ikLimitsUpper, Vector ikResistance, bool ikLockedX, bool ikLockedY, bool ikLockedZ, ShapeList shapes)
 Add bone. More...
 
void setBoneShapeProperties (int index, Array properties)
 Set shape properties to bone. More...
 
void addBoneConstraint (int bone, Vector referencePosition, Quaternion referenceOrientation, Vector boneOffset, float linearDamping, float angularDamping, float springDamping, bool isRope, float breakingThreshold, int parentBone)
 Add bone constraint. More...
 
void setBoneConstraintDof (int bone, int constraint, ColliderConstraintDof dof, float lowerLimit, float upperLimit, float staticFriction, float kinematicFriction, float springStiffness)
 Set bone constraint dof. More...
 
void setRootBone (int bone)
 Set root bone. More...
 
void setShapes (ShapeList shapes)
 Set shapes. More...
 
void setShapeProperties (Array properties)
 Set shape properties. More...
 

Detailed Description

Rig builder.

Builds rig resource without requiring a rig resource file. The created rig can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named rigs can not clash with filenames present in the virtual file system. For this reason use unnamed rigs if possible. Using named rigs though can be useful if you want to provide rig resources to scripts not needing to know if the path they try to load is a build rig instead of a resource one.

To use the rig builder create a subclass and implement RigBuilder.buildRig() . You are only allowed to call methods from RigBuilder from inside this function call. To create the rig call RigBuilder.build() . This will call RigBuilder.buildRig() to fill a new rig resource with content. Once finished the build method returns the ready to use rig resource. Otherwise an exception is thrown.

This is a native class.

Member Function Documentation

◆ addBone()

void Dragengine.Scenery.RigBuilder.addBone ( String  name,
int  parent,
Vector  position,
Vector  rotation,
Vector  centralMassPoint,
bool  dynamic,
float  mass,
Vector  ikLimitsLower,
Vector  ikLimitsUpper,
Vector  ikResistance,
bool  ikLockedX,
bool  ikLockedY,
bool  ikLockedZ,
ShapeList  shapes 
)
protected

Add bone.

Resets all bone shape properties to empty string.

◆ addBoneConstraint()

void Dragengine.Scenery.RigBuilder.addBoneConstraint ( int  bone,
Vector  referencePosition,
Quaternion  referenceOrientation,
Vector  boneOffset,
float  linearDamping,
float  angularDamping,
float  springDamping,
bool  isRope,
float  breakingThreshold,
int  parentBone 
)
protected

Add bone constraint.

◆ build()

Rig Dragengine.Scenery.RigBuilder.build ( String  filename)

Build rig using filename.

The created rig can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named rigs can not clash with filenames present in the virtual file system. For this reason use unnamed rigs if possible. Using named rigs though can be useful if you want to provide rig resources to scripts not needing to know if the path they try to load is a build rig instead of a resource one.

To create the rig call build() . This will call buildRig() to fill a new rig resource with content. Once finished the build method returns the ready to use rig resource. Otherwise an exception is thrown.

◆ buildRig()

void Dragengine.Scenery.RigBuilder.buildRig ( )
protected

Build rig.

Called by build(String) to fill a new rig resource with content. You are only allowed to call methods from RigBuilder from inside this function call.

◆ new()

RigBuilder Dragengine.Scenery.RigBuilder.new ( )

Create rig builder.

◆ setBoneConstraintDof()

void Dragengine.Scenery.RigBuilder.setBoneConstraintDof ( int  bone,
int  constraint,
ColliderConstraintDof  dof,
float  lowerLimit,
float  upperLimit,
float  staticFriction,
float  kinematicFriction,
float  springStiffness 
)
protected

Set bone constraint dof.

◆ setBoneShapeProperties()

void Dragengine.Scenery.RigBuilder.setBoneShapeProperties ( int  index,
Array  properties 
)
protected

Set shape properties to bone.

Properties array has to contain the same number of objects as the bone has shapes. The first array object is assigned to the first bone shape and so forth. The array should contain strings but any object supporting an appropriate toString() implementation is valid too.

◆ setModelCollision()

void Dragengine.Scenery.RigBuilder.setModelCollision ( bool  modelCollision)
protected

Set if component model is used for collision instead of shapes if present.

◆ setRootBone()

void Dragengine.Scenery.RigBuilder.setRootBone ( int  bone)
protected

Set root bone.

◆ setShapeProperties()

void Dragengine.Scenery.RigBuilder.setShapeProperties ( Array  properties)
protected

Set shape properties.

Properties array has to contain the same number of objects as the rig has shapes. The first array object is assigned to the first rig shape and so forth. The array should contain strings but any object supporting an appropriate toString() implementation is valid too.

◆ setShapes()

void Dragengine.Scenery.RigBuilder.setShapes ( ShapeList  shapes)
protected

Set shapes.

Resets all shape properties to empty string.


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