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

Rig collider. More...

Inheritance diagram for Dragengine.Scenery.ColliderRig:
Dragengine.Scenery.Collider Dragengine.Scenery.ColliderComponent

Public Member Functions

Constructors
ColliderRig new ()
 Create rig collider. More...
 
Bones
DVector boneGetPosition (int bone)
 Center mass position of bone in world coordinates. More...
 
void boneSetPosition (int bone, DVector position)
 Set center mass position of bone in world coordinates. More...
 
Quaternion boneGetOrientation (int bone)
 Center mass orientation of bone in world coordinates. More...
 
void boneSetOrientation (int bone, Quaternion orientation)
 Set center mass orientation of bone in world coordinates. More...
 
Vector boneGetLinearVelocity (int bone)
 Center mass linear velocity of bone in m/s in world coordinates. More...
 
void boneSetLinearVelocity (int bone, Vector velocity)
 Set center mass linear velocity of bone in m/s in world coordinates. More...
 
Vector boneGetAngularVelocity (int bone)
 Center mass angular velocity of bone in degrees/s in world coordinates. More...
 
void boneSetAngularVelocity (int bone, Vector velocity)
 Set center mass angular velocity of bone in degrees/s in world coordinates. More...
 
DMatrix boneGetMatrix (int bone)
 Center mass matrix of bone in world coordinates. More...
 
DMatrix boneGetInverseMatrix (int bone)
 Inverse center mass matrix of bone in world coordinates. More...
 
void enableRigBoneConstraints (int bone, bool enable)
 Enable or disable bone constraints defined in rig. More...
 
void copyStatesFromCollider (ColliderRig collider)
 Copy bone states from collider. More...
 
void copyStateFromCollider (int bone, ColliderRig collider)
 Copy bone state from collider. More...
 
void copyStateFromCollider (int boneFrom, int boneTo, ColliderRig collider)
 Copy bone state from collider bone. More...
 
Attachments
void attachRig (Object resource)
 Attach collider rig or component synchronizing bone states. More...
 
void attachBone (Object resource, String targetBone)
 Attach collider at bone relative to current position. More...
 
void attachBone (Object resource, String targetBone, Vector position, Quaternion orientation)
 Attach collider at bone with specific position. More...
 
void attachWeight (Object resource, CollisionInfo colInfo)
 Attach collider at position defined by weighting bones. More...
 
Force and Impuls
void boneApplyImpuls (int bone, Vector impuls)
 Apply impulse at center mass point of bone. More...
 
void boneApplyImpulsAt (int bone, Vector impuls, Vector position)
 Apply impulse at position relative to bone. More...
 
void boneApplyTorque (int bone, Vector torque)
 Apply torque at center mass point of bone. More...
 
void boneApplyTorqueImpuls (int bone, Vector torqueImpuls)
 Apply torque and impulse at center mass point of bone. More...
 
void boneApplyForce (int bone, Vector force)
 Apply force at center mass point of bone. More...
 
void boneApplyForceAt (int bone, Vector force, Vector position)
 Apply force at position relative to bone. More...
 
- Public Member Functions inherited from Dragengine.Scenery.Collider
int getAttachmentCount ()
 Number of attachments. More...
 
Object getAttachedResource (int index)
 Resource of attachment at index. More...
 
void attachStatic (Object resource)
 Attach resource using static mode relative to current position. More...
 
void attachStatic (Object resource, Vector position, Quaternion orientation)
 Attach resource using static mode with specific position. More...
 
void attachRelativeMovement (Object resource)
 Attach collider keeping relative position and orientation. More...
 
void detach (Object resource)
 Detach resource. More...
 
void detachAll ()
 Detach all resources. More...
 
void attachmentsForceUpdate ()
 Force update of all attachments. More...
 
int getConstraintCount ()
 Number of constraints. More...
 
void addConstraint (ColliderConstraint constraint)
 Add constraint from a collider constraint. More...
 
bool hasConstraint (ColliderConstraint constraint)
 Constraint with same bone, target collider and target bone is present. More...
 
int indexOfConstraint (ColliderConstraint constraint)
 Index of constraint with same bone, target collider and target bone or -1 if absent. More...
 
ColliderConstraint getConstraintAt (int index)
 Constraint at index. More...
 
void setConstraintAt (int index, ColliderConstraint constraint)
 Set constraint from a collider constraint. More...
 
void removeConstraint (ColliderConstraint constraint)
 Remove constraint with same bone, target collider and target bone. More...
 
void removeConstraintFrom (int index)
 Remove constraint from index. More...
 
void removeAllConstraints ()
 Remove all constraints. More...
 
int getIgnoreColliderCount ()
 Number of colliders to ignore. More...
 
Collider getIgnoreColliderAt (int index)
 Ignore collider at index. More...
 
bool hasIgnoreCollider (Collider collider)
 Ignore collider is present. More...
 
void addIgnoreCollider (Collider collider)
 Add collider to ignore. More...
 
void removeIgnoreCollider (Collider collider)
 Remove collider to ignore. More...
 
void removeAllIgnoreColliders ()
 Remove all colliders to ignore. More...
 
int getCollisionTestCount ()
 Number of post physics collision tests. More...
 
ColliderCollisionTest getCollisionTestAt (int index)
 Post physics collision test at index. More...
 
void addCollisionTest (ColliderCollisionTest collisionTest)
 Add post physics collision test. More...
 
void removeCollisionTest (ColliderCollisionTest collisionTest)
 Remove post physics collision test. More...
 
void removeAllCollisionTests ()
 Remove all post physics collision tests. More...
 
void applyImpuls (Vector impuls)
 Apply impulse at central mass point. More...
 
void applyImpulsAt (Vector impuls, Vector position)
 Apply impulse at position. More...
 
void applyTorque (Vector torque)
 Apply torque at central mass point. More...
 
void applyTorqueImpuls (Vector torqueImpuls)
 Apply torque and impulse at center mass point. More...
 
void applyForce (Vector force)
 Apply force at central mass point. More...
 
void applyForceAt (Vector force, Vector position)
 Apply force at position. More...
 
ColliderListener getColliderListener ()
 Collider listener or null if not set. More...
 
void setColliderListener (ColliderListener listener)
 Set collider listener or null to clear. More...
 
bool colliderListenerGetCustomCanHit ()
 Custom can hit callback is enabled. More...
 
void colliderListenerSetCustomCanHit (bool customCanHit)
 Set if custom can hit callback is enabled. More...
 
ColliderBreakingListener getBreakingListener ()
 Breaking listener or null if not set. More...
 
void setBreakingListener (ColliderBreakingListener listener)
 Set breaking listener or null if not set. More...
 
bool pointInside (DVector point)
 Point is inside collider. More...
 
void rayHits (DVector rayOrigin, Vector rayDirection, ColliderListener listener)
 Ray cast intersection test. More...
 
void rayHitsClosest (DVector rayOrigin, Vector rayDirection, ColliderListener listener)
 Closest ray cast intersection test. More...
 
void colliderHits (Collider collider, ColliderListener listener)
 Test collider for intersection. More...
 
void colliderMoveHits (Collider collider, Vector displacement, ColliderListener listener)
 Tests moving collider for collision. More...
 
void colliderMoveHitsCLosest (Collider collider, Vector displacement, ColliderListener listener)
 Tests moving collider for collision. More...
 
void colliderRotateHits (Collider collider, ColliderListener listener)
 Test rotating collider for collision. More...
 
void colliderRotateHitsClosest (Collider collider, ColliderListener listener)
 Test rotating collider for collision. More...
 
void colliderMoveRotateHits (Collider collider, Vector displacement, ColliderListener listener)
 Test moving and rotating collider for collision. More...
 
void colliderMoveRotateHitsClosest (Collider collider, Vector displacement, ColliderListener listener)
 Test moving and rotating collider for collision. More...
 
DVector getPosition ()
 Position. More...
 
void setPosition (DVector position)
 Set position. More...
 
Quaternion getOrientation ()
 Oorientation. More...
 
void setOrientation (Quaternion orientation)
 Set orientation. More...
 
Vector getScale ()
 Scale. More...
 
void setScale (Vector scale)
 Set scale. More...
 
void setGeometry (DVector position, Quaternion orientation)
 Set position and orientation at the same time. More...
 
void setGeometry (DVector position, Quaternion orientation, Vector scale)
 Set position and orientation at the same time. More...
 
Vector getView ()
 View direction. More...
 
Vector getUp ()
 Up direction. More...
 
Vector getRight ()
 Right direction. More...
 
DMatrix getMatrix ()
 Get matrix. More...
 
DMatrix getInverseMatrix ()
 Get inverse matrix. More...
 
Vector getLinearVelocity ()
 Linear velocity in m/s. More...
 
void setLinearVelocity (Vector linVelo)
 Set linear velocity in m/s. More...
 
Vector getAngularVelocity ()
 Angular velocity in degrees/s. More...
 
void setAngularVelocity (Vector angVelo)
 Set angular velocity degrees/s. More...
 
float getMass ()
 Mass in kg. More...
 
void setMass (float mass)
 Set mass in kg. More...
 
Vector getGravity ()
 Constant acceleration in N/s^2. More...
 
void setGravity (Vector force)
 Set constant acceleration in N/s^2. More...
 
bool getEnabled ()
 Collider is enabled. More...
 
void setEnabled (bool enabled)
 Set if collider is enabled. More...
 
CollisionResponse getResponseType ()
 Response type. More...
 
void setResponseType (CollisionResponse responseType)
 Set response type. More...
 
bool getUseLocalGravity ()
 Collider defined gravity is used instead of World gravity. More...
 
void setUseLocalGravity (bool useLocalGravity)
 Set if collider defined gravity is used instead of World gravity. More...
 
Object getOwner ()
 Object owning the collider for interaction or null if not used. More...
 
void setOwner (Object owner)
 Set object owning the collider for interaction or null if not used. More...
 
float getForceFieldDirect ()
 Factor for direct type force fields. More...
 
void setForceFieldDirect (float factor)
 Set factor for direct type force fields. More...
 
float getForceFieldSurface ()
 Factor for surface type force fields. More...
 
void setForceFieldSurface (float factor)
 Set factor for surface type force fields. More...
 
float getForceFieldMass ()
 Factor for mass type force fields. More...
 
void setForceFieldMass (float factor)
 Set factor for mass type force fields. More...
 
float getForceFieldSpeed ()
 Factor for speed type force fields. More...
 
void setForceFieldSpeed (float factor)
 Set factor for speed type force fields. More...
 
CollisionFilter getCollisionFilter ()
 Collision filter. More...
 
void setCollisionFilter (CollisionFilter collisionFilter)
 Set collision filter. More...
 

Management

Rig getRig ()
 Rig or null if not set. More...
 
void setRig (Rig rig)
 Set rig or null if not set. More...
 
bool equals (Object other)
 Collider is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 
static bool equals (Collider collider1, Collider collider2)
 Two colliders are equal. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Dragengine.Scenery.Collider
Constructors

Detailed Description

Rig collider.

Supports complex colliders using a rig. Manages bone states matching the rig bone structure. The physics module simulates and updates the bone data. Resources can be attached to individual bones or groups of bones. Other ColliderRig objects can be attached in rig mode to synchronize their bone states (for example cloth on an actor). For physics simulation bone constraints can be enabled and disabled.

Bones

The position and orientation of collider bones is located at the center mass point not the rig bone origin in world space. If you use collider bone position or matrix you have to subtract the Rig.boneGetCentralMassPoint(int) for the respective bone to obtain the world position of the rig bone as used by animations.

This is a native class.

Member Function Documentation

◆ attachBone() [1/2]

void Dragengine.Scenery.ColliderRig.attachBone ( Object  resource,
String  targetBone 
)

Attach collider at bone relative to current position.

◆ attachBone() [2/2]

void Dragengine.Scenery.ColliderRig.attachBone ( Object  resource,
String  targetBone,
Vector  position,
Quaternion  orientation 
)

Attach collider at bone with specific position.

◆ attachRig()

void Dragengine.Scenery.ColliderRig.attachRig ( Object  resource)

Attach collider rig or component synchronizing bone states.

◆ attachWeight()

void Dragengine.Scenery.ColliderRig.attachWeight ( Object  resource,
CollisionInfo  colInfo 
)

Attach collider at position defined by weighting bones.

◆ boneApplyForce()

void Dragengine.Scenery.ColliderRig.boneApplyForce ( int  bone,
Vector  force 
)

Apply force at center mass point of bone.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneApplyForceAt()

void Dragengine.Scenery.ColliderRig.boneApplyForceAt ( int  bone,
Vector  force,
Vector  position 
)

Apply force at position relative to bone.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneApplyImpuls()

void Dragengine.Scenery.ColliderRig.boneApplyImpuls ( int  bone,
Vector  impuls 
)

Apply impulse at center mass point of bone.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneApplyImpulsAt()

void Dragengine.Scenery.ColliderRig.boneApplyImpulsAt ( int  bone,
Vector  impuls,
Vector  position 
)

Apply impulse at position relative to bone.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneApplyTorque()

void Dragengine.Scenery.ColliderRig.boneApplyTorque ( int  bone,
Vector  torque 
)

Apply torque at center mass point of bone.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneApplyTorqueImpuls()

void Dragengine.Scenery.ColliderRig.boneApplyTorqueImpuls ( int  bone,
Vector  torqueImpuls 
)

Apply torque and impulse at center mass point of bone.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneGetAngularVelocity()

Vector Dragengine.Scenery.ColliderRig.boneGetAngularVelocity ( int  bone)

Center mass angular velocity of bone in degrees/s in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneGetInverseMatrix()

DMatrix Dragengine.Scenery.ColliderRig.boneGetInverseMatrix ( int  bone)

Inverse center mass matrix of bone in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneGetLinearVelocity()

Vector Dragengine.Scenery.ColliderRig.boneGetLinearVelocity ( int  bone)

Center mass linear velocity of bone in m/s in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneGetMatrix()

DMatrix Dragengine.Scenery.ColliderRig.boneGetMatrix ( int  bone)

Center mass matrix of bone in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneGetOrientation()

Quaternion Dragengine.Scenery.ColliderRig.boneGetOrientation ( int  bone)

Center mass orientation of bone in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneGetPosition()

DVector Dragengine.Scenery.ColliderRig.boneGetPosition ( int  bone)

Center mass position of bone in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneSetAngularVelocity()

void Dragengine.Scenery.ColliderRig.boneSetAngularVelocity ( int  bone,
Vector  velocity 
)

Set center mass angular velocity of bone in degrees/s in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneSetLinearVelocity()

void Dragengine.Scenery.ColliderRig.boneSetLinearVelocity ( int  bone,
Vector  velocity 
)

Set center mass linear velocity of bone in m/s in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneSetOrientation()

void Dragengine.Scenery.ColliderRig.boneSetOrientation ( int  bone,
Quaternion  orientation 
)

Set center mass orientation of bone in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ boneSetPosition()

void Dragengine.Scenery.ColliderRig.boneSetPosition ( int  bone,
DVector  position 
)

Set center mass position of bone in world coordinates.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ copyStateFromCollider() [1/2]

void Dragengine.Scenery.ColliderRig.copyStateFromCollider ( int  bone,
ColliderRig  collider 
)

Copy bone state from collider.

Rigs do not have to match. The bone is matched by bone name. If not matching the bone keeps its current state.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ copyStateFromCollider() [2/2]

void Dragengine.Scenery.ColliderRig.copyStateFromCollider ( int  boneFrom,
int  boneTo,
ColliderRig  collider 
)

Copy bone state from collider bone.

Rigs do not have to match. This call allows to copy states of bones not matching by their names.

Exceptions
EOutOfBoundaryboneFrom is less than 0 or larger than or equal to this collider rig bone count.
EOutOfBoundaryboneTo is less than 0 or larger than or equal to other collider rig bone count.

◆ copyStatesFromCollider()

void Dragengine.Scenery.ColliderRig.copyStatesFromCollider ( ColliderRig  collider)

Copy bone states from collider.

Rigs do not have to match. Bones are matched by bone names. Unmatched bones keep their current state.

◆ enableRigBoneConstraints()

void Dragengine.Scenery.ColliderRig.enableRigBoneConstraints ( int  bone,
bool  enable 
)

Enable or disable bone constraints defined in rig.

Exceptions
EOutOfBoundarybone is less than 0 or larger than or equal to rig bone count.

◆ equals() [1/2]

static bool Dragengine.Scenery.ColliderRig.equals ( Collider  collider1,
Collider  collider2 
)
static

Two colliders are equal.

This is an extended version of equals() accepting also null for collider1 and collider2. equals() would thrown an exception if null is compared to anything. This call though allows to compare null against colliders or even null itself. If collider1 or collider2 is null false is returned. If both are null true is returned.

Reimplemented from Dragengine.Scenery.Collider.

Reimplemented in Dragengine.Scenery.ColliderComponent.

◆ equals() [2/2]

bool Dragengine.Scenery.ColliderRig.equals ( Object  other)

Collider is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Collider and both point to the same engine collider.

Reimplemented from Dragengine.Scenery.Collider.

Reimplemented in Dragengine.Scenery.ColliderComponent.

◆ getRig()

Rig Dragengine.Scenery.ColliderRig.getRig ( )

Rig or null if not set.

◆ hashCode()

int Dragengine.Scenery.ColliderRig.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

Reimplemented from Dragengine.Scenery.Collider.

Reimplemented in Dragengine.Scenery.ColliderComponent.

◆ new()

ColliderRig Dragengine.Scenery.ColliderRig.new ( )

Create rig collider.

Reimplemented from Dragengine.Scenery.Collider.

Reimplemented in Dragengine.Scenery.ColliderComponent.

◆ setRig()

void Dragengine.Scenery.ColliderRig.setRig ( Rig  rig)

Set rig or null if not set.


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