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

Collider constraint. More...

Inheritance diagram for Dragengine.Scenery.ColliderConstraint:

Public Member Functions

Constructors
ColliderConstraint new ()
 Create collider constraint.
Management
Collider getTargetCollider ()
 Target collider or null to target the world.
void setTargetCollider (Collider collider)
 Set target collider or null to target the world.
String getTargetBone ()
 Taret bone or empty string if not targeting a bone.
void setTargetBone (String bone)
 Set target bone or empty string if not targeting a bone.
Vector getPosition1 ()
 Position of the reference coordinate system.
void setPosition1 (Vector position)
 Set position of the reference coordinate system.
Quaternion getOrientation1 ()
 Orientation of the reference coordinate system.
void setOrientation1 (Quaternion orientation)
 Set orientation of the target coordinate system.
Vector getPosition2 ()
 Position of the target coordinate system.
void setPosition2 (Vector position)
 Set position of the target coordinate system.
Quaternion getOrientation2 ()
 Orientation of the target coordinate system.
void setOrientation2 (Quaternion orientation)
 Set orientation of the reference coordinate system.
int getBone ()
 Bone index or -1 if attached to the entire component.
void setBone (int bone)
 Set bone index or -1 if attached to the entire component.
Degree of freedom (DOF) limits
float getLowerLimitFor (ColliderConstraintDof dof)
 Lower limit for DOF.
float getUpperLimitFor (ColliderConstraintDof dof)
 Upper limit for DOF.
void setLimitsFor (ColliderConstraintDof dof, float lowerLimit, float upperLimit)
 Set lower and upper limit.
void setLockedFor (ColliderConstraintDof dof)
 Set given DOF to locked.
void setFreeFor (ColliderConstraintDof dof)
 Set given DOF free.
Vector getLinearLowerLimits ()
 Lower limits for all linear DOFs as a vector.
Vector getLinearUpperLimits ()
 Upper limits for all linear DOFs as a vector.
void setLinearLimits (Vector lowerLimits, Vector upperLimits)
 Set limits for linear all linear DOFs from vectors.
Vector getAngularLowerLimits ()
 Lower limits for all angular DOFs as a vector.
Vector getAngularUpperLimits ()
 Upper limits for all angular DOFs as a vector.
void setAngularLimits (Vector lowerLimits, Vector upperLimits)
 Set limits for angular all angular DOFs from vectors.
void lockAll ()
 Lock all DOFs.
void setToBallJoint ()
 Lock all linear DOFs and sets all angular DOFs free.
void setToHingeJoint (ColliderConstraintDof dof, float lowerLimit, float upperLimit)
 Set upper and lower limit for the given angular DOF and locks all others.
void setPistonJoint (ColliderConstraintDof dof, float lowerLimit, float upperLimit)
 Set upper and lower limit for the given linear DOF and locks all others.
Degree of freedom (DOF) friction and spring
float getStaticFrictionFor (ColliderConstraintDof dof)
 Static friction force.
void setStaticFrictionFor (ColliderConstraintDof dof, float friction)
 Set static friction force.
float getKinematicFrictionFor (ColliderConstraintDof dof)
 Kinematic friction factor.
void setKinematicFrictionFor (ColliderConstraintDof dof, float friction)
 Set kinematic friction factor.
float getSpringStiffnessFor (ColliderConstraintDof dof)
 Spring stiffness.
void setSpringStiffnessFor (ColliderConstraintDof dof, float stiffness)
 Set spring stiffness.
Degree of freedom (DOF) damping
float getLinearDamping ()
 Linear damping for DOF.
void setLinearDamping (float damping)
 Set linear damping for DOF.
float getAngularDamping ()
 Angular damping for DOF.
void setAngularDamping (float damping)
 Set angular damping for DOF.
float getSpringDamping ()
 Spring damping for DOF.
void setSpringDamping (float damping)
 Set spring damping for DOF.
Rope
bool getIsRope ()
 Use rope physics.
void setIsRope (bool isRope)
 Set use rope physics.
Breaking
float getBreakingThreshold ()
 Breaking threshold impulse.
void setBreakingThreshold (float impuls)
 Set breaking threshold impulse.

Detailed Description

Collider constraint.

Collider constraints define a physical constraint between two colliders or a collider and the world. Optionally bones inside the colliders can be referenced.

Constraints are defined by a reference coordinate system, a target coordinate system and up to 6 constraint limits one for each degree of freedom.

The reference and target coordinate system are relative to the collider position and orientation. If bones are used the reference respectively target coordinate system is relative to the rig bone position and orientation. The bone center mass position is not used. This is contrary to ColliderRig where the position and orientation is the position and orientation of the bone center mass point in world coordinates. Keep this in mind if you create collider constraints during runtime for collider bones.

This is a native class.

Member Function Documentation

◆ getAngularDamping()

float Dragengine.Scenery.ColliderConstraint.getAngularDamping ( )

Angular damping for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getKinematicFrictionFor().

Referenced by setBreakingThreshold().

◆ getAngularLowerLimits()

Vector Dragengine.Scenery.ColliderConstraint.getAngularLowerLimits ( )

Lower limits for all angular DOFs as a vector.

References setLimitsFor().

Referenced by getStaticFrictionFor().

◆ getAngularUpperLimits()

Vector Dragengine.Scenery.ColliderConstraint.getAngularUpperLimits ( )

Upper limits for all angular DOFs as a vector.

Referenced by setStaticFrictionFor().

◆ getBone()

int Dragengine.Scenery.ColliderConstraint.getBone ( )

Bone index or -1 if attached to the entire component.

References getPosition2().

Referenced by getLowerLimitFor().

◆ getBreakingThreshold()

float Dragengine.Scenery.ColliderConstraint.getBreakingThreshold ( )

Breaking threshold impulse.

Referenced by setBreakingThreshold().

◆ getIsRope()

bool Dragengine.Scenery.ColliderConstraint.getIsRope ( )

Use rope physics.

References setSpringStiffnessFor().

Referenced by setBreakingThreshold().

◆ getKinematicFrictionFor()

float Dragengine.Scenery.ColliderConstraint.getKinematicFrictionFor ( ColliderConstraintDof dof)

Kinematic friction factor.

Version
1.11
Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References lockAll().

Referenced by getAngularDamping().

◆ getLinearDamping()

float Dragengine.Scenery.ColliderConstraint.getLinearDamping ( )

Linear damping for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

Referenced by setBreakingThreshold().

◆ getLinearLowerLimits()

Vector Dragengine.Scenery.ColliderConstraint.getLinearLowerLimits ( )

Lower limits for all linear DOFs as a vector.

References getUpperLimitFor().

Referenced by setPistonJoint().

◆ getLinearUpperLimits()

Vector Dragengine.Scenery.ColliderConstraint.getLinearUpperLimits ( )

Upper limits for all linear DOFs as a vector.

Referenced by setPistonJoint().

◆ getLowerLimitFor()

float Dragengine.Scenery.ColliderConstraint.getLowerLimitFor ( ColliderConstraintDof dof)

Lower limit for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getBone(), and setOrientation2().

Referenced by setLockedFor().

◆ getOrientation1()

Quaternion Dragengine.Scenery.ColliderConstraint.getOrientation1 ( )

Orientation of the reference coordinate system.

References getPosition1().

Referenced by setPosition2().

◆ getOrientation2()

Quaternion Dragengine.Scenery.ColliderConstraint.getOrientation2 ( )

Orientation of the target coordinate system.

Referenced by setBone().

◆ getPosition1()

Vector Dragengine.Scenery.ColliderConstraint.getPosition1 ( )

Position of the reference coordinate system.

References setTargetBone().

Referenced by getOrientation1().

◆ getPosition2()

Vector Dragengine.Scenery.ColliderConstraint.getPosition2 ( )

Position of the target coordinate system.

References setPosition1().

Referenced by getBone().

◆ getSpringDamping()

float Dragengine.Scenery.ColliderConstraint.getSpringDamping ( )

Spring damping for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

Referenced by setBreakingThreshold().

◆ getSpringStiffnessFor()

float Dragengine.Scenery.ColliderConstraint.getSpringStiffnessFor ( ColliderConstraintDof dof)

Spring stiffness.

Version
1.11
Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References setPistonJoint().

Referenced by setSpringDamping().

◆ getStaticFrictionFor()

float Dragengine.Scenery.ColliderConstraint.getStaticFrictionFor ( ColliderConstraintDof dof)

Static friction force.

Version
1.11
Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getAngularLowerLimits().

Referenced by setSpringStiffnessFor().

◆ getTargetBone()

String Dragengine.Scenery.ColliderConstraint.getTargetBone ( )

Taret bone or empty string if not targeting a bone.

References setTargetCollider().

Referenced by setTargetBone().

◆ getTargetCollider()

Collider Dragengine.Scenery.ColliderConstraint.getTargetCollider ( )

Target collider or null to target the world.

References getTargetCollider().

Referenced by getTargetCollider().

◆ getUpperLimitFor()

float Dragengine.Scenery.ColliderConstraint.getUpperLimitFor ( ColliderConstraintDof dof)

Upper limit for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References setBone().

Referenced by getLinearLowerLimits().

◆ lockAll()

void Dragengine.Scenery.ColliderConstraint.lockAll ( )

Lock all DOFs.

Referenced by getKinematicFrictionFor().

◆ new()

ColliderConstraint Dragengine.Scenery.ColliderConstraint.new ( )

Create collider constraint.

References new().

Referenced by new().

◆ setAngularDamping()

void Dragengine.Scenery.ColliderConstraint.setAngularDamping ( float damping)

Set angular damping for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References setKinematicFrictionFor().

Referenced by setBreakingThreshold().

◆ setAngularLimits()

void Dragengine.Scenery.ColliderConstraint.setAngularLimits ( Vector lowerLimits,
Vector upperLimits )

Set limits for angular all angular DOFs from vectors.

References setLockedFor().

Referenced by setStaticFrictionFor().

◆ setBone()

void Dragengine.Scenery.ColliderConstraint.setBone ( int bone)

Set bone index or -1 if attached to the entire component.

References getOrientation2(), and setPosition2().

Referenced by getUpperLimitFor().

◆ setBreakingThreshold()

void Dragengine.Scenery.ColliderConstraint.setBreakingThreshold ( float impuls)

◆ setFreeFor()

void Dragengine.Scenery.ColliderConstraint.setFreeFor ( ColliderConstraintDof dof)

Set given DOF free.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

Referenced by setToBallJoint().

◆ setIsRope()

void Dragengine.Scenery.ColliderConstraint.setIsRope ( bool isRope)

Set use rope physics.

Referenced by setBreakingThreshold().

◆ setKinematicFrictionFor()

void Dragengine.Scenery.ColliderConstraint.setKinematicFrictionFor ( ColliderConstraintDof dof,
float friction )

Set kinematic friction factor.

Version
1.11
Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References setToBallJoint(), and setToHingeJoint().

Referenced by setAngularDamping().

◆ setLimitsFor()

void Dragengine.Scenery.ColliderConstraint.setLimitsFor ( ColliderConstraintDof dof,
float lowerLimit,
float upperLimit )

Set lower and upper limit.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

Referenced by getAngularLowerLimits().

◆ setLinearDamping()

void Dragengine.Scenery.ColliderConstraint.setLinearDamping ( float damping)

Set linear damping for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References setStaticFrictionFor().

Referenced by setBreakingThreshold().

◆ setLinearLimits()

void Dragengine.Scenery.ColliderConstraint.setLinearLimits ( Vector lowerLimits,
Vector upperLimits )

Set limits for linear all linear DOFs from vectors.

Referenced by setPistonJoint().

◆ setLockedFor()

void Dragengine.Scenery.ColliderConstraint.setLockedFor ( ColliderConstraintDof dof)

Set given DOF to locked.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getLowerLimitFor().

Referenced by setAngularLimits().

◆ setOrientation1()

void Dragengine.Scenery.ColliderConstraint.setOrientation1 ( Quaternion orientation)

Set orientation of the target coordinate system.

Referenced by setOrientation2().

◆ setOrientation2()

void Dragengine.Scenery.ColliderConstraint.setOrientation2 ( Quaternion orientation)

Set orientation of the reference coordinate system.

References setOrientation1().

Referenced by getLowerLimitFor().

◆ setPistonJoint()

void Dragengine.Scenery.ColliderConstraint.setPistonJoint ( ColliderConstraintDof dof,
float lowerLimit,
float upperLimit )

Set upper and lower limit for the given linear DOF and locks all others.

References getLinearLowerLimits(), getLinearUpperLimits(), and setLinearLimits().

Referenced by getSpringStiffnessFor().

◆ setPosition1()

void Dragengine.Scenery.ColliderConstraint.setPosition1 ( Vector position)

Set position of the reference coordinate system.

Referenced by getPosition2().

◆ setPosition2()

void Dragengine.Scenery.ColliderConstraint.setPosition2 ( Vector position)

Set position of the target coordinate system.

References getOrientation1().

Referenced by setBone().

◆ setSpringDamping()

void Dragengine.Scenery.ColliderConstraint.setSpringDamping ( float damping)

Set spring damping for DOF.

Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getSpringStiffnessFor().

Referenced by setBreakingThreshold().

◆ setSpringStiffnessFor()

void Dragengine.Scenery.ColliderConstraint.setSpringStiffnessFor ( ColliderConstraintDof dof,
float stiffness )

Set spring stiffness.

Version
1.11
Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getStaticFrictionFor().

Referenced by getIsRope().

◆ setStaticFrictionFor()

void Dragengine.Scenery.ColliderConstraint.setStaticFrictionFor ( ColliderConstraintDof dof,
float friction )

Set static friction force.

Version
1.11
Exceptions
EInvalidParamdegreeOfFreedom is not a valid value.

References getAngularUpperLimits(), and setAngularLimits().

Referenced by setLinearDamping().

◆ setTargetBone()

void Dragengine.Scenery.ColliderConstraint.setTargetBone ( String bone)

Set target bone or empty string if not targeting a bone.

References getTargetBone().

Referenced by getPosition1().

◆ setTargetCollider()

void Dragengine.Scenery.ColliderConstraint.setTargetCollider ( Collider collider)

Set target collider or null to target the world.

Referenced by getTargetBone().

◆ setToBallJoint()

void Dragengine.Scenery.ColliderConstraint.setToBallJoint ( )

Lock all linear DOFs and sets all angular DOFs free.

References setFreeFor().

Referenced by setKinematicFrictionFor().

◆ setToHingeJoint()

void Dragengine.Scenery.ColliderConstraint.setToHingeJoint ( ColliderConstraintDof dof,
float lowerLimit,
float upperLimit )

Set upper and lower limit for the given angular DOF and locks all others.

Referenced by setKinematicFrictionFor().


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