29#ifndef PX_IMMEDIATE_MODE_H
30#define PX_IMMEDIATE_MODE_H
34#include "PxPhysXConfig.h"
35#include "foundation/PxMemory.h"
36#include "solver/PxSolverDefs.h"
37#include "collision/PxCollisionDefs.h"
38#include "PxArticulationReducedCoordinate.h"
45 class PxCudaContextManager;
54 typedef void* PxArticulationHandle;
113 PX_C_EXPORT PX_PHYSX_CORE_API
void PxConstructSolverBodies(
const PxRigidBodyData* inRigidData,
PxSolverBodyData* outSolverBodyData, PxU32 nbBodies,
const PxVec3& gravity, PxReal dt,
bool gyroscopicForces =
false);
139 PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxBatchConstraints(
const PxSolverConstraintDesc* solverConstraintDescs, PxU32 nbConstraints,
PxSolverBody* solverBodies, PxU32 nbBodies,
141 PxArticulationHandle* articulations=NULL, PxU32 nbArticulations=0);
162 PxConstraintAllocator& allocator, PxReal invDt, PxReal bounceThreshold, PxReal frictionOffsetThreshold, PxReal correlationDistance,
163 PxSpatialVector* Z = NULL);
196 const void* constantBlock;
233 const PxSolverBody* solverBodies,
PxVec3* linearMotionVelocity,
PxVec3* angularMotionVelocity, PxU32 nbSolverBodies, PxU32 nbPositionIterations, PxU32 nbVelocityIterations,
234 float dt=0.0f,
float invDt=0.0f, PxU32 nbSolverArticulations=0, PxArticulationHandle* solverArticulations=NULL,
PxSpatialVector* Z = NULL,
PxSpatialVector* deltaV = NULL);
246 PX_C_EXPORT PX_PHYSX_CORE_API
void PxIntegrateSolverBodies(
PxSolverBodyData* solverBodyData,
PxSolverBody* solverBody,
const PxVec3* linearMotionVelocity,
const PxVec3* angularMotionState, PxU32 nbBodiesToIntegrate, PxReal dt);
270 PxReal contactDistance, PxReal meshContactMargin, PxReal toleranceLength,
PxCacheAllocator& allocator);
278 PX_C_EXPORT PX_PHYSX_CORE_API
void PxRegisterImmediateArticulations();
287 PxReal targetPos[PxArticulationAxis::eCOUNT];
288 PxReal targetVel[PxArticulationAxis::eCOUNT];
289 PxReal armature[PxArticulationAxis::eCOUNT];
290 PxReal jointPos[PxArticulationAxis::eCOUNT];
291 PxReal jointVel[PxArticulationAxis::eCOUNT];
292 PxReal frictionCoefficient;
293 PxReal maxJointVelocity;
300 frictionCoefficient = 0.05f;
301 maxJointVelocity = 100.0f;
302 type = PxArticulationJointType::eUNDEFINED;
304 for(PxU32 i=0;i<PxArticulationAxis::eCOUNT;i++)
313 PxMemSet(targetPos, 0xff,
sizeof(PxReal)*PxArticulationAxis::eCOUNT);
314 PxMemSet(targetVel, 0xff,
sizeof(PxReal)*PxArticulationAxis::eCOUNT);
328 float angularDamping;
329 float maxLinearVelocitySq;
330 float maxAngularVelocitySq;
336 inverseInertia =
PxVec3(1.0f);
338 linearDamping = 0.05f;
339 angularDamping = 0.05f;
340 maxLinearVelocitySq = 100.0f * 100.0f;
341 maxAngularVelocitySq = 50.0f * 50.0f;
343 disableGravity =
false;
362 PxArticulationLinkMutableDataRC::initData();
363 inboundJoint.initData();
370 typedef void* PxArticulationCookie;
374 PxArticulationCookie articulation;
391 PxArticulationHandle articulation;
408 PX_C_EXPORT PX_PHYSX_CORE_API PxArticulationCookie PxBeginCreateArticulationRC(
const PxArticulationDataRC& data);
444 PX_C_EXPORT PX_PHYSX_CORE_API PxArticulationHandle PxEndCreateArticulationRC(PxArticulationCookie articulation,
PxArticulationLinkHandle* linkHandles, PxU32 bufferSize);
452 PX_C_EXPORT PX_PHYSX_CORE_API
void PxReleaseArticulation(PxArticulationHandle articulation);
461 PX_C_EXPORT PX_PHYSX_CORE_API
PxArticulationCache* PxCreateArticulationCache(PxArticulationHandle articulation);
561 PX_C_EXPORT PX_PHYSX_CORE_API
void PxComputeUnconstrainedVelocities(PxArticulationHandle articulation,
const PxVec3& gravity,
const PxReal dt,
const PxReal invLengthScale);
568 PX_C_EXPORT PX_PHYSX_CORE_API
void PxUpdateArticulationBodies(PxArticulationHandle articulation,
const PxReal dt);
580 PX_C_EXPORT PX_PHYSX_CORE_API
void PxComputeUnconstrainedVelocitiesTGS( PxArticulationHandle articulation,
const PxVec3& gravity,
const PxReal dt,
581 const PxReal totalDt,
const PxReal invDt,
const PxReal invTotalDt,
const PxReal invLengthScale);
588 PX_C_EXPORT PX_PHYSX_CORE_API
void PxUpdateArticulationBodiesTGS(PxArticulationHandle articulation,
const PxReal dt);
631 PxArticulationHandle* articulations = NULL,
const PxU32 nbArticulations = 0);
652 PxConstraintAllocator& allocator,
const PxReal invDt,
const PxReal invTotalDt,
const PxReal bounceThreshold,
653 const PxReal frictionOffsetThreshold,
const PxReal correlationDistance);
668 PX_C_EXPORT PX_PHYSX_CORE_API
bool PxCreateJointConstraintsTGS(
PxConstraintBatchHeader* batchHeaders,
const PxU32 nbHeaders,
670 const PxReal invTotalDt,
const PxReal lengthScale);
688 const PxReal dt,
const PxReal totalDt,
const PxReal invDt,
const PxReal invTotalDt,
const PxReal lengthScale);
706 PxConstraintAllocator& allocator,
const PxReal dt,
const PxReal totalDt,
const PxReal invDt,
const PxReal invTotalDt,
const PxReal lengthScale);
727 const float dt,
const float invDt,
const PxU32 nbSolverArticulations = 0, PxArticulationHandle* solverArticulations = NULL,
PxSpatialVector* Z = NULL,
PxSpatialVector* deltaV = NULL);
Data structure used to read and write internal articulation data.
Definition PxArticulationReducedCoordinate.h:99
A callback class to allocate memory to cache information used in contact generation.
Definition PxCollisionDefs.h:44
Definition PxSolverDefs.h:227
A plugin class for implementing constraints.
Definition PxConstraint.h:100
A geometry object.
Definition PxGeometry.h:79
3 Element vector class.
Definition PxVec3.h:50
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxU32(* PxConstraintSolverPrep)(Px1DConstraint *constraints, PxVec3p &bodyAWorldOffset, PxU32 maxConstraints, PxConstraintInvMassScale &invMassScale, const void *constantBlock, const PxTransform &bodyAToWorld, const PxTransform &bodyBToWorld, bool useExtendedLimits, PxVec3p &cAtW, PxVec3p &cBtW)
Solver constraint generation shader.
Definition PxConstraintDesc.h:223
PX_FORCE_INLINE void * PxMemSet(void *dest, PxI32 c, PxU32 count)
Sets the bytes of the provided buffer to the specified value.
Definition PxMemory.h:67
Data structure for articulation joint drive configuration.
Definition PxSolverDefs.h:359
Enum
Definition PxSolverDefs.h:281
Data structure to set articulation joint limits.
Definition PxSolverDefs.h:327
Enum
Definition PxSolverDefs.h:268
@ eLOCKED
Locked axis, i.e. degree of freedom (DOF)
Definition PxSolverDefs.h:269
A structure to cache contact information produced by low-level contact generation functions.
Definition PxCollisionDefs.h:68
Struct that the solver uses to store the state and other properties of a body.
Definition PxSolverDefs.h:74
Struct that the solver uses to store velocity updates for a body.
Definition PxSolverDefs.h:55
Constraint descriptor used inside the solver.
Definition PxSolverDefs.h:108
Data structure used for preparing constraints before solving them.
Definition PxSolverDefs.h:178
Definition PxSolverDefs.h:446
Definition PxSolverDefs.h:440
Definition PxSolverDefs.h:419
Definition PxSolverDefs.h:486
Structure to store rigid body properties.
Definition PxImmediateMode.h:71
PxReal maxDepenetrationVelocity
32 Maximum de-penetration velocity
Definition PxImmediateMode.h:75
PX_ALIGN(16, PxVec3 linearVelocity)
12 Linear velocity
PxReal maxLinearVelocitySq
88 Squared maximum linear velocity
Definition PxImmediateMode.h:81
PxReal invMass
16 Inverse mass
Definition PxImmediateMode.h:73
PxVec3 angularVelocity
28 Angular velocity
Definition PxImmediateMode.h:74
PxReal linearDamping
80 Linear damping coefficient
Definition PxImmediateMode.h:79
PxReal maxContactImpulse
48 Maximum permissable contact impulse
Definition PxImmediateMode.h:77
PxReal maxAngularVelocitySq
92 Squared maximum angular velocity
Definition PxImmediateMode.h:82
PxTransform body2World
76 World space transform
Definition PxImmediateMode.h:78
PxReal angularDamping
84 Angular damping coefficient
Definition PxImmediateMode.h:80
PxU32 pad
96 Padding for 16-byte alignment
Definition PxImmediateMode.h:83
PxVec3 invInertia
44 Mass-space inverse interia diagonal vector
Definition PxImmediateMode.h:76