29#ifndef PX_SOLVER_DEFS_H
30#define PX_SOLVER_DEFS_H
32#include "PxPhysXConfig.h"
33#include "foundation/PxVec3.h"
34#include "foundation/PxMat33.h"
35#include "foundation/PxTransform.h"
36#include "PxConstraintDesc.h"
37#include "geomutils/PxContactPoint.h"
41#pragma warning(disable : 4324)
49struct PxTGSSolverBodyVel;
109 static const PxU16 RIGID_BODY = 0xffff;
151 eDYNAMIC_BODY = 1 << 0,
152 eSTATIC_BODY = 1 << 1,
153 eKINEMATIC_BODY = 1 << 2,
154 eARTICULATION = 1 << 3
275typedef PxFlags<PxArticulationMotion::Enum, PxU8> PxArticulationMotions;
285 eREVOLUTE_UNWRAPPED = 3,
302typedef PxFlags<PxArticulationFlag::Enum, PxU8> PxArticulationFlags;
421 PxU16 nbStaticInteractions;
422 PxU16 maxDynamicPartition;
434 return linearVelocity.
dot(lin) + angularVelocity.
dot(ang);
457 PxReal projectVelocity(
const PxVec3& linear,
const PxVec3& angular)
const
Definition PxSolverDefs.h:227
virtual PxU8 * reserveFrictionData(const PxU32 byteSize)=0
Allocates friction data. Friction data can be retained by the application for a given pair and provid...
virtual PxU8 * reserveConstraintData(const PxU32 byteSize)=0
Allocates constraint data. It is the application's responsibility to release this memory after PxSolv...
3x3 matrix class
Definition PxMat33.h:91
A padded version of PxVec3, to safely load its data using SIMD.
Definition PxVec3.h:392
3 Element vector class.
Definition PxVec3.h:50
PX_CUDA_CALLABLE PX_FORCE_INLINE float dot(const PxVec3 &v) const
returns the scalar product of this and other.
Definition PxVec3.h:276
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_ALIGN(alignment, decl)
Definition PxPreprocessor.h:402
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
A one-dimensional constraint.
Definition PxConstraintDesc.h:134
Definition PxSolverDefs.h:250
Enum
Definition PxSolverDefs.h:252
@ eSWING2
Rotational about eZ.
Definition PxSolverDefs.h:255
@ eTWIST
Rotational about eX.
Definition PxSolverDefs.h:253
@ eSWING1
Rotational about eY.
Definition PxSolverDefs.h:254
@ eY
Linear in eY.
Definition PxSolverDefs.h:257
@ eX
Linear in eX.
Definition PxSolverDefs.h:256
@ eZ
Linear in eZ.
Definition PxSolverDefs.h:258
Definition PxSolverDefs.h:306
Enum
Definition PxSolverDefs.h:308
@ eFORCE
The output of the implicit spring drive controller is a force/torque.
Definition PxSolverDefs.h:309
Data structure for articulation joint drive configuration.
Definition PxSolverDefs.h:359
PxArticulationDriveType::Enum driveType
The drive type.
Definition PxSolverDefs.h:414
PxReal stiffness
The drive stiffness, i.e. the proportional gain of the implicit PD controller.
Definition PxSolverDefs.h:381
PxReal damping
The drive damping, i.e. the derivative gain of the implicit PD controller.
Definition PxSolverDefs.h:394
PxReal maxForce
The drive force limit.
Definition PxSolverDefs.h:407
Definition PxSolverDefs.h:292
Enum
Definition PxSolverDefs.h:294
@ eFIX_BASE
Set articulation base to be fixed.
Definition PxSolverDefs.h:295
@ eCOMPUTE_JOINT_FORCES
Enable in order to be able to query joint solver (i.e. constraint) forces using PxArticulationCache::...
Definition PxSolverDefs.h:298
@ eDRIVE_LIMITS_ARE_FORCES
Limits for drive effort are forces and torques rather than impulses, see PxArticulationDrive::maxForc...
Definition PxSolverDefs.h:296
@ eDISABLE_SELF_COLLISION
Disable collisions between the articulation's links (note that parent/child collisions are disabled i...
Definition PxSolverDefs.h:297
Definition PxSolverDefs.h:279
Enum
Definition PxSolverDefs.h:281
Data structure to set articulation joint limits.
Definition PxSolverDefs.h:327
PxReal high
The higher limit on the joint axis position.
Definition PxSolverDefs.h:350
PxReal low
The lower limit on the joint axis position.
Definition PxSolverDefs.h:342
Definition PxSolverDefs.h:266
Enum
Definition PxSolverDefs.h:268
Struct for specifying mass scaling for a pair of rigids.
Definition PxConstraintDesc.h:184
Struct that the solver uses to store the state and other properties of a body.
Definition PxSolverDefs.h:74
PxTransform body2World
108 the body's transform
Definition PxSolverDefs.h:83
PxVec3 angularVelocity
28 Pre-solver angular velocity
Definition PxSolverDefs.h:77
PxReal penBiasClamp
72 the penetration bias clamp
Definition PxSolverDefs.h:80
PxU32 nodeIndex
76 the node idx of this solverBodyData. Used by solver to reference between solver bodies and island ...
Definition PxSolverDefs.h:81
PxReal maxContactImpulse
80 the max contact impulse
Definition PxSolverDefs.h:82
PxReal reportThreshold
32 contact force threshold
Definition PxSolverDefs.h:78
PX_ALIGN(16, PxVec3 linearVelocity)
12 Pre-solver linear velocity
PxMat33 sqrtInvInertia
68 inverse inertia in world space
Definition PxSolverDefs.h:79
PxReal invMass
16 inverse mass
Definition PxSolverDefs.h:76
PxU16 pad
112 pad
Definition PxSolverDefs.h:84
Struct that the solver uses to store velocity updates for a body.
Definition PxSolverDefs.h:55
PxVec3 angularState
Delta angular velocity state computed by the solver.
Definition PxSolverDefs.h:60
PxU16 maxSolverFrictionProgress
Progress counter used by constraint batching and parallel island solver.
Definition PxSolverDefs.h:58
PX_ALIGN(16, PxVec3) linearVelocity
Delta linear velocity computed by the solver.
PxU32 solverProgress
Progress counter used by constraint batching and parallel island solver.
Definition PxSolverDefs.h:62
PxU16 maxSolverNormalProgress
Progress counter used by constraint batching and parallel island solver.
Definition PxSolverDefs.h:57
Constraint descriptor used inside the solver.
Definition PxSolverDefs.h:108
ConstraintType
Definition PxSolverDefs.h:112
@ eCONTACT_CONSTRAINT
Defines this pair is a contact constraint.
Definition PxSolverDefs.h:113
@ eJOINT_CONSTRAINT
Defines this pair is a joint constraint.
Definition PxSolverDefs.h:114
PxSolverBody * bodyA
bodyA pointer
Definition PxSolverDefs.h:119
PxTGSSolverBodyVel * tgsBodyA
bodyA pointer
Definition PxSolverDefs.h:120
void * articulationA
Articulation pointer for body A.
Definition PxSolverDefs.h:121
void * articulationB
Articulation pointer for body B.
Definition PxSolverDefs.h:128
PxU32 bodyBDataIndex
Body B's index into the SolverBodyData array.
Definition PxSolverDefs.h:131
PxU8 * constraint
Pointer to the constraint rows to be solved.
Definition PxSolverDefs.h:135
PxTGSSolverBodyVel * tgsBodyB
BodyB pointer.
Definition PxSolverDefs.h:127
PxU16 constraintLengthOver16
constraintLength/16, max constraint length is 1MB, allows PxSolverConstraintDesc to fit in 32 bytes
Definition PxSolverDefs.h:140
PxSolverBody * bodyB
BodyB pointer.
Definition PxSolverDefs.h:126
PxU32 linkIndexB
Link index defining which link in Articulation B this constraint affects. If not an articulation,...
Definition PxSolverDefs.h:134
void * writeBack
Pointer to the writeback structure results for this given constraint are to be written to.
Definition PxSolverDefs.h:136
PxU32 bodyADataIndex
Body A's index into the SolverBodyData array.
Definition PxSolverDefs.h:130
PxU16 progressB
Internal progress counter.
Definition PxSolverDefs.h:139
PxU32 linkIndexA
Link index defining which link in Articulation A this constraint affects. If not an articulation,...
Definition PxSolverDefs.h:133
PxU16 progressA
Internal progress counter.
Definition PxSolverDefs.h:138
Data structure used for preparing constraints before solving them.
Definition PxSolverDefs.h:148
const PxSolverBodyData * data1
In: The second PxSolverBodyData. Stores mass and miscellaneous information for the second body.
Definition PxSolverDefs.h:165
const PxSolverBody * body0
In: The first body. Stores velocity information. Unused unless contact involves articulations.
Definition PxSolverDefs.h:161
PxSolverConstraintDesc * desc
Output: The PxSolverConstraintDesc filled in by contact prep.
Definition PxSolverDefs.h:159
PxConstraintInvMassScale invMassScales
In: The local mass scaling for this pair.
Definition PxSolverDefs.h:157
const PxSolverBodyData * data0
In: The first PxSolverBodyData. Stores mass and miscellaneous information for the first body.
Definition PxSolverDefs.h:164
PxTransform bodyFrame0
In: The world-space transform of the first body.
Definition PxSolverDefs.h:167
BodyState bodyState1
In: Defines what kind of actor the second body is.
Definition PxSolverDefs.h:171
const PxSolverBody * body1
In: The second body. Stores velocity information. Unused unless contact involves articulations.
Definition PxSolverDefs.h:162
BodyState bodyState0
In: Defines what kind of actor the first body is.
Definition PxSolverDefs.h:170
PxTransform bodyFrame1
In: The world-space transform of the second body.
Definition PxSolverDefs.h:168
Data structure used for preparing constraints before solving them.
Definition PxSolverDefs.h:178
PxU32 numRows
The number of rows.
Definition PxSolverDefs.h:180
PX_ALIGN(16, Px1DConstraint *rows)
The start of the constraint rows.
bool driveLimitsAreForces
Indicates whether drive limits are forces.
Definition PxSolverDefs.h:187
void * writeback
Pointer to constraint writeback structure. Reports back joint breaking. If not required,...
Definition PxSolverDefs.h:184
PxReal minResponseThreshold
The minimum response threshold.
Definition PxSolverDefs.h:183
bool extendedLimits
Indicates whether we want to use extended limits.
Definition PxSolverDefs.h:188
PxVec3p body0WorldOffset
Body0 world offset.
Definition PxSolverDefs.h:191
bool disableConstraint
Disables constraint.
Definition PxSolverDefs.h:189
bool improvedSlerp
Use improved slerp model.
Definition PxSolverDefs.h:186
bool disablePreprocessing
Disable joint pre-processing. Pre-processing can improve stability but under certain circumstances,...
Definition PxSolverDefs.h:185
PxReal angBreakForce
Break forces.
Definition PxSolverDefs.h:182
Definition PxSolverDefs.h:446
PxReal penBiasClamp
The penetration bias clamp.
Definition PxSolverDefs.h:450
PxReal maxContactImpulse
The max contact impulse.
Definition PxSolverDefs.h:448
PxVec3 originalAngularVelocity
Pre-solver angular velocity.
Definition PxSolverDefs.h:449
PxU32 nodeIndex
The node idx of this solverBodyData. Used by solver to reference between solver bodies and island bod...
Definition PxSolverDefs.h:453
PX_ALIGN(16, PxVec3) originalLinearVelocity
Pre-solver linear velocity.
PxReal reportThreshold
Contact force threshold.
Definition PxSolverDefs.h:454
PxReal invMass
Inverse mass.
Definition PxSolverDefs.h:452
Definition PxSolverDefs.h:440
PxMat33 sqrtInvInertia
inverse inertia in world space
Definition PxSolverDefs.h:442
Definition PxSolverDefs.h:419
Definition PxSolverDefs.h:464
PxSolverContactDesc::BodyState bodyState0
In: Defines what kind of actor the first body is.
Definition PxSolverDefs.h:481
const PxTGSSolverBodyTxInertia * body0TxI
In: The first PxTGSSolverBodyTxInertia. Stores the delta body to world transform and sqrtInvInertia f...
Definition PxSolverDefs.h:472
const PxTGSSolverBodyVel * body0
In: The first body. Stores velocity information. Unused unless contact involves articulations.
Definition PxSolverDefs.h:469
const PxTGSSolverBodyData * bodyData0
In: The first PxTGSSolverBodyData. Stores mass and miscellaneous information for the first body.
Definition PxSolverDefs.h:475
PxTransform bodyFrame0
In: The world-space transform of the first body.
Definition PxSolverDefs.h:478
const PxTGSSolverBodyData * bodyData1
In: The second PxTGSSolverBodyData. Stores mass and miscellaneous information for the second body.
Definition PxSolverDefs.h:476
const PxTGSSolverBodyTxInertia * body1TxI
In: The second PxTGSSolverBodyTxInertia. Stores the delta body to world transform and sqrtInvInertia ...
Definition PxSolverDefs.h:473
PxTransform bodyFrame1
In: The world-space transform of the second body.
Definition PxSolverDefs.h:479
PxSolverContactDesc::BodyState bodyState1
In: Defines what kind of actor the second body is.
Definition PxSolverDefs.h:482
const PxTGSSolverBodyVel * body1
In: The second body. Stores velocity information. Unused unless contact involves articulations.
Definition PxSolverDefs.h:470
PxConstraintInvMassScale invMassScales
In: The local mass scaling for this pair.
Definition PxSolverDefs.h:465
PxSolverConstraintDesc * desc
Output: The PxSolverConstraintDesc filled in by contact prep.
Definition PxSolverDefs.h:467
Definition PxSolverDefs.h:486
PxReal angBreakForce
Break forces.
Definition PxSolverDefs.h:490
bool disableConstraint
Disables constraint.
Definition PxSolverDefs.h:497
PxVec3p cA2w
Location of anchor point A in world space.
Definition PxSolverDefs.h:500
bool extendedLimits
Indicates whether extended limits are used.
Definition PxSolverDefs.h:496
PxReal minResponseThreshold
The minimum response threshold.
Definition PxSolverDefs.h:491
bool disablePreprocessing
Disable joint pre-processing. Pre-processing can improve stability but under certain circumstances,...
Definition PxSolverDefs.h:493
void * writeback
Pointer to constraint writeback structure. Reports back joint breaking. If not required,...
Definition PxSolverDefs.h:492
PxVec3p body0WorldOffset
Body0 world offset.
Definition PxSolverDefs.h:499
PxVec3p cB2w
Location of anchor point B in world space.
Definition PxSolverDefs.h:501
PxU32 numRows
The number of rows.
Definition PxSolverDefs.h:488
bool driveLimitsAreForces
Indicates whether drive limits are forces.
Definition PxSolverDefs.h:495
Px1DConstraint * rows
The start of the constraint rows.
Definition PxSolverDefs.h:487
bool improvedSlerp
Use improved slerp model.
Definition PxSolverDefs.h:494