Px1DConstraint Struct Reference

A constraint. More...

#include <PxConstraintDesc.h>

Collaboration diagram for Px1DConstraint:

Public Attributes

PxVec3 linear0
 linear component of velocity jacobian in world space More...
 
PxReal geometricError
 geometric error of the constraint along this axis More...
 
PxVec3 angular0
 angular component of velocity jacobian in world space More...
 
PxReal velocityTarget
 velocity target for the constraint along this axis More...
 
PxVec3 linear1
 linear component of velocity jacobian in world space More...
 
PxReal minImpulse
 minimum impulse the solver may apply to enforce this constraint More...
 
PxVec3 angular1
 angular component of velocity jacobian in world space More...
 
PxReal maxImpulse
 maximum impulse the solver may apply to enforce this constraint More...
 
union {
   struct SpringModifiers {
      PxReal   stiffness
 spring parameter, for spring constraints More...
 
      PxReal   damping
 damping parameter, for spring constraints More...
 
   }   spring
 
   struct RestitutionModifiers {
      PxReal   restitution
 restitution parameter for determining additional "bounce" More...
 
      PxReal   velocityThreshold
 minimum impact velocity for bounce More...
 
   }   bounce
 
mods
 
PxReal forInternalUse
 for internal use only More...
 
PxU16 flags
 a set of Px1DConstraintFlags More...
 
PxU16 solveHint
 constraint optimization hint, should be an element of PxConstraintSolveHint More...
 

Detailed Description

A constraint.

A constraint is expressed as a set of 1-dimensional constraint rows which define the required constraint on the objects' velocities.

Each constraint is either a hard constraint or a spring. We define the velocity at the constraint to be the quantity

v = body0vel.dot(lin0,ang0) - body1vel.dot(lin1, ang1)

For a hard constraint, the solver attempts to generate

1. a set of velocities for the objects which, when integrated, respect the constraint errors:

v + (geometricError / timestep) = velocityTarget

2. a set of velocities for the objects which respect the constraints:

v = velocityTarget

Hard constraints support restitution: if the impact velocity exceeds the bounce threshold, then the target velocity of the constraint will be set to restitution * -v

Alternatively, the solver can attempt to resolve the velocity constraint as an implicit spring:

F = stiffness * -geometricError + damping * (velocityTarget - v)

where F is the constraint force or acceleration. Springs are fully implicit: that is, the force or acceleration is a function of the position and velocity after the solve.

All constraints support limits on the minimum or maximum impulse applied.

Member Data Documentation

◆ angular0

PxVec3 Px1DConstraint::angular0

angular component of velocity jacobian in world space

◆ angular1

PxVec3 Px1DConstraint::angular1

angular component of velocity jacobian in world space

◆ bounce

struct { ... } ::RestitutionModifiers Px1DConstraint::bounce

◆ damping

PxReal Px1DConstraint::damping

damping parameter, for spring constraints

◆ flags

PxU16 Px1DConstraint::flags

a set of Px1DConstraintFlags

◆ forInternalUse

PxReal Px1DConstraint::forInternalUse

for internal use only

◆ geometricError

PxReal Px1DConstraint::geometricError

geometric error of the constraint along this axis

◆ linear0

PxVec3 Px1DConstraint::linear0

linear component of velocity jacobian in world space

◆ linear1

PxVec3 Px1DConstraint::linear1

linear component of velocity jacobian in world space

◆ maxImpulse

PxReal Px1DConstraint::maxImpulse

maximum impulse the solver may apply to enforce this constraint

◆ minImpulse

PxReal Px1DConstraint::minImpulse

minimum impulse the solver may apply to enforce this constraint

◆ mods

union { ... } Px1DConstraint::mods

◆ restitution

PxReal Px1DConstraint::restitution

restitution parameter for determining additional "bounce"

◆ solveHint

PxU16 Px1DConstraint::solveHint

constraint optimization hint, should be an element of PxConstraintSolveHint

◆ spring

struct { ... } ::SpringModifiers Px1DConstraint::spring

◆ stiffness

PxReal Px1DConstraint::stiffness

spring parameter, for spring constraints

◆ velocityTarget

PxReal Px1DConstraint::velocityTarget

velocity target for the constraint along this axis

◆ velocityThreshold

PxReal Px1DConstraint::velocityThreshold

minimum impact velocity for bounce


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