Drag[en]gine Game Engine  1.21
deColliderConstraintDof Class Reference

Collider Constraint Degree of Freedom. More...

#include <deColliderConstraintDof.h>

Public Member Functions

Constructors and Destructors
 deColliderConstraintDof ()
 Create new collider constraint degree of freedom. More...
 
 deColliderConstraintDof (const deColliderConstraintDof &dof)
 Create new collider constraint degree of freedom as a copy of another constraint degree of freedom. More...
 
 ~deColliderConstraintDof ()
 Clean up collider constraint degree of freedom. More...
 
Management
float GetLowerLimit () const
 Lower limit. More...
 
void SetLowerLimit (float lowerLimit)
 Set lower limit. More...
 
float GetUpperLimit () const
 Upper limit. More...
 
void SetUpperLimit (float upperLimit)
 Set upper limit. More...
 
void SetLocked (float value)
 Set limits to locked. Both the upper and lower limit are set to the same value. More...
 
void SetLimited (float lower, float upper)
 Set limits to limited. Ensures the upper value is not less than the lower value. More...
 
void SetFree ()
 Set limits to free. Sets lower to 1 and upper to 0. More...
 
float GetStaticFriction () const
 Static friction force. More...
 
void SetStaticFriction (float friction)
 Set static friction force. More...
 
float GetKinematicFriction () const
 Kinematic friction factor. More...
 
void SetKinematicFriction (float friction)
 Set kinematic friction factor. More...
 
float GetSpringStiffness () const
 Spring stiffness. More...
 
void SetSpringStiffness (float stiffness)
 Set spring stiffness. More...
 
Operators
deColliderConstraintDofoperator= (const deColliderConstraintDof &dof)
 Set degree of freedom from another degree of freedom. More...
 

Detailed Description

Collider Constraint Degree of Freedom.

Defines a degree of freedom constraint for a collider. A degree of freedom can be either locked, limited or free depending on the values of the lower and upper limits. If the upper limit is equal to the lower limit the degree of freedom is locked. For performance and stability reason it is best to set as many degrees of freedom to locked as possible. If the upper limit is larger than the lower limit the degree of freedom is limited and is kept between those limits. If the upper limit is lower than the lower limit the degree of freedom is free in which case any movement is valid. A free degree of freedom is second best to locked in terms of performance and stability. To avoid issues with floating point values physics modules are required to use a safe zone of FLOAT_SAFE_EPSYLON between the two limit values before calling a degree of freedom free instead of locked. Hence to mark a degree of freedom as free best practise is to make the upper limit smaller than the lower limit by a good amount. If you want to be safe use the setLocked, setLimited and setFree functions. By default a degree of freedom is locked.

Joints in the real world exhibit friction while moving. This situation is modelled using the static and kinematic friction. The static friction defines the force that is needed to get a join moving in a certain direction. The physical formula is staticFrictionForce = normalForce * staticFrictionCoefficient. Calculating normalForce for a join is usually difficult so the the static friction force is used instead. This is simple to retrieve from real world objects by measuring the force required to get an object moving. While moving the kinematic friction is used. This is again physically defined as kinematicFriction = normalForce * kinematicFrictionCoefficient. Here too the normalForce is a problem. For this reason the force acting on the joint is used instead. This allows to use the kinematicFrictionCoefficient as kinematic friction. Hence the static friction is the force neede to get a joint moving and the kinematic friction the percentage of the applying force absorbed by the inner friction. Once the movement force drops below the static friction force the movement grinds to a halt again.

In addition a degree of freedom can be turned into a spring. A degree of freedom can be limited or free while being a spring or not. The spring is defined using the constants found in Hooke's Law therefore F=-k*x . The stiffness spring constant equals to the k constant defining the percentage of the distance stretched away from the equilibrium position applied as force. Hence k is given as [N/m]. The spring damping determines the amount of energy lost over time. A stiffness of 0 disables spring behavior.

Constructor & Destructor Documentation

◆ deColliderConstraintDof() [1/2]

deColliderConstraintDof::deColliderConstraintDof ( )

Create new collider constraint degree of freedom.

◆ deColliderConstraintDof() [2/2]

deColliderConstraintDof::deColliderConstraintDof ( const deColliderConstraintDof dof)

Create new collider constraint degree of freedom as a copy of another constraint degree of freedom.

◆ ~deColliderConstraintDof()

deColliderConstraintDof::~deColliderConstraintDof ( )

Clean up collider constraint degree of freedom.

Member Function Documentation

◆ GetKinematicFriction()

float deColliderConstraintDof::GetKinematicFriction ( ) const
inline

Kinematic friction factor.

◆ GetLowerLimit()

float deColliderConstraintDof::GetLowerLimit ( ) const
inline

Lower limit.

◆ GetSpringStiffness()

float deColliderConstraintDof::GetSpringStiffness ( ) const
inline

Spring stiffness.

◆ GetStaticFriction()

float deColliderConstraintDof::GetStaticFriction ( ) const
inline

Static friction force.

◆ GetUpperLimit()

float deColliderConstraintDof::GetUpperLimit ( ) const
inline

Upper limit.

◆ operator=()

deColliderConstraintDof& deColliderConstraintDof::operator= ( const deColliderConstraintDof dof)

Set degree of freedom from another degree of freedom.

◆ SetFree()

void deColliderConstraintDof::SetFree ( )

Set limits to free. Sets lower to 1 and upper to 0.

◆ SetKinematicFriction()

void deColliderConstraintDof::SetKinematicFriction ( float  friction)

Set kinematic friction factor.

◆ SetLimited()

void deColliderConstraintDof::SetLimited ( float  lower,
float  upper 
)

Set limits to limited. Ensures the upper value is not less than the lower value.

◆ SetLocked()

void deColliderConstraintDof::SetLocked ( float  value)

Set limits to locked. Both the upper and lower limit are set to the same value.

◆ SetLowerLimit()

void deColliderConstraintDof::SetLowerLimit ( float  lowerLimit)

Set lower limit.

◆ SetSpringStiffness()

void deColliderConstraintDof::SetSpringStiffness ( float  stiffness)

Set spring stiffness.

◆ SetStaticFriction()

void deColliderConstraintDof::SetStaticFriction ( float  friction)

Set static friction force.

◆ SetUpperLimit()

void deColliderConstraintDof::SetUpperLimit ( float  upperLimit)

Set upper limit.


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