Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.RigBuilder Class Reference

Rig builder. More...

Inheritance diagram for Dragengine.Scenery.RigBuilder:

Public Member Functions

Constructors
RigBuilder new ()
 Create rig builder.

Management

Rig build (String filename)
 Build rig using filename.
void buildRig ()
 Build rig.
void setModelCollision (bool modelCollision)
 Set if component model is used for collision instead of shapes if present.
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.
void setBoneShapeProperties (int index, Array properties)
 Set shape properties to bone.
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.
void setBoneConstraintDof (int bone, int constraint, ColliderConstraintDof dof, float lowerLimit, float upperLimit, float staticFriction, float kinematicFriction, float springStiffness)
 Set bone constraint dof.
void setRootBone (int bone)
 Set root bone.
void setShapes (ShapeList shapes)
 Set shapes.
void setShapeProperties (Array properties)
 Set shape properties.

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.

References setModelCollision().

Referenced by setBoneShapeProperties().

◆ 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.

Referenced by setRootBone().

◆ 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.

References build().

Referenced by build().

◆ 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.

References buildRig().

Referenced by buildRig().

◆ new()

RigBuilder Dragengine.Scenery.RigBuilder.new ( )

Create rig builder.

References new().

Referenced by new().

◆ 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.

References setBoneShapeProperties().

Referenced by setShapes().

◆ 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.

References addBone().

Referenced by setBoneConstraintDof().

◆ setModelCollision()

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

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

Referenced by addBone().

◆ setRootBone()

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

Set root bone.

References addBoneConstraint().

Referenced by setShapeProperties().

◆ 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.

References setRootBone(), setShapeProperties(), and setShapes().

Referenced by setShapeProperties().

◆ setShapes()

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

Set shapes.

Resets all shape properties to empty string.

References setBoneConstraintDof().

Referenced by setShapeProperties().


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