PxImmediateMode.h
Go to the documentation of this file.
1 //
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions
4 // are met:
5 // * Redistributions of source code must retain the above copyright
6 // notice, this list of conditions and the following disclaimer.
7 // * Redistributions in binary form must reproduce the above copyright
8 // notice, this list of conditions and the following disclaimer in the
9 // documentation and/or other materials provided with the distribution.
10 // * Neither the name of NVIDIA CORPORATION nor the names of its
11 // contributors may be used to endorse or promote products derived
12 // from this software without specific prior written permission.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
15 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Copyright (c) 2008-2019 NVIDIA Corporation. All rights reserved.
27 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
28 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
29 
30 #ifndef PX_PHYSICS_IMMEDIATE_MODE
31 #define PX_PHYSICS_IMMEDIATE_MODE
32 
35 #include "PxPhysXConfig.h"
36 #include "solver/PxSolverDefs.h"
38 
39 #if !PX_DOXYGEN
40 namespace physx
41 {
42 #endif
43 
44 #if !PX_DOXYGEN
45 namespace immediate
46 {
47 #endif
48 
53  {
54  PX_ALIGN(16, PxVec3 linearVelocity);
66  };
67 
72  {
73  public:
81  virtual bool recordContacts(const Gu::ContactPoint* contactPoints, const PxU32 nbContacts, const PxU32 index) = 0;
82 
83  virtual ~PxContactRecorder(){}
84  };
85 
94  PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructSolverBodies(const PxRigidBodyData* inRigidData, PxSolverBodyData* outSolverBodyData, const PxU32 nbBodies, const PxVec3& gravity, const PxReal dt);
95 
102 
120  PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxBatchConstraints( const PxSolverConstraintDesc* solverConstraintDescs, const PxU32 nbConstraints, PxSolverBody* solverBodies, const PxU32 nbBodies,
121  PxConstraintBatchHeader* outBatchHeaders, PxSolverConstraintDesc* outOrderedConstraintDescs,
122  Dy::ArticulationV** articulations=NULL, const PxU32 nbArticulations=0);
123 
142  PxConstraintAllocator& allocator, const PxReal invDt, const PxReal bounceThreshold, const PxReal frictionOffsetThreshold, const PxReal correlationDistance);
143 
154  PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraints(PxConstraintBatchHeader* batchHeaders, const PxU32 nbHeaders, PxSolverConstraintPrepDesc* jointDescs, PxConstraintAllocator& allocator, const PxReal dt, const PxReal invDt);
155 
168  PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithShaders(PxConstraintBatchHeader* batchHeaders, const PxU32 nbBatchHeaders, PxConstraint** constraints, PxSolverConstraintPrepDesc* jointDescs, PxConstraintAllocator& allocator, const PxReal dt, const PxReal invDt);
169 
171  {
173  const void* constantBlock;
174  };
187  PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithImmediateShaders(PxConstraintBatchHeader* batchHeaders, const PxU32 nbBatchHeaders, PxImmediateConstraint* constraints, PxSolverConstraintPrepDesc* jointDescs, PxConstraintAllocator& allocator, const PxReal dt, const PxReal invDt);
188 
205  PX_C_EXPORT PX_PHYSX_CORE_API void PxSolveConstraints(const PxConstraintBatchHeader* batchHeaders, const PxU32 nbBatchHeaders, const PxSolverConstraintDesc* solverConstraintDescs,
206  const PxSolverBody* solverBodies, PxVec3* linearMotionVelocity, PxVec3* angularMotionVelocity, const PxU32 nbSolverBodies, const PxU32 nbPositionIterations, const PxU32 nbVelocityIterations,
207  const float dt=0.0f, const float invDt=0.0f, const PxU32 nbSolverArticulations=0, Dy::ArticulationV** solverArticulations=NULL);
208 
219  PX_C_EXPORT PX_PHYSX_CORE_API void PxIntegrateSolverBodies(PxSolverBodyData* solverBodyData, PxSolverBody* solverBody, const PxVec3* linearMotionVelocity, const PxVec3* angularMotionState, const PxU32 nbBodiesToIntegrate, const PxReal dt);
220 
241  PX_C_EXPORT PX_PHYSX_CORE_API bool PxGenerateContacts(const PxGeometry* const * geom0, const PxGeometry* const * geom1, const PxTransform* pose0, const PxTransform* pose1, PxCache* contactCache, const PxU32 nbPairs, PxContactRecorder& contactRecorder,
242  const PxReal contactDistance, const PxReal meshContactMargin, const PxReal toleranceLength, PxCacheAllocator& allocator);
243 
251 
253  {
256  };
257 
259  {
268  };
269 
271  {
273  };
274 
276  {
278  float inverseMass;
284  };
285 
286  struct PxLinkData
287  {
291  };
292 
294  {
296 
297  void initData()
298  {
299  inboundJoint.type = PxArticulationJointType::eUNDEFINED; // For root
300  inboundJoint.parentPose = PxTransform(PxIdentity);
301  inboundJoint.childPose = PxTransform(PxIdentity);
302  inboundJoint.frictionCoefficient = 0.05f;
303  inboundJoint.maxJointVelocity = 100.0f;
304 
305  pose = PxTransform(PxIdentity);
306  parent = 0;
307  inverseInertia = PxVec3(1.0f);
308  inverseMass = 1.0f;
309  linearDamping = 0.05f;
310  angularDamping = 0.05f;
311  maxLinearVelocitySq = 100.0f * 100.0f;
312  maxAngularVelocitySq = 50.0f * 50.0f;
313  disableGravity = false;
314 
315  for(PxU32 i=0;i<PxArticulationAxis::eCOUNT;i++)
316  {
317  inboundJoint.motion[i] = PxArticulationMotion::eLOCKED;
318  inboundJoint.limits[i].low = inboundJoint.limits[i].high = 0.0f;
319  inboundJoint.drives[i].stiffness = 0.0f;
320  inboundJoint.drives[i].damping = 0.0f;
321  inboundJoint.drives[i].maxForce = 0.0f;
322  inboundJoint.drives[i].driveType = PxArticulationDriveType::eFORCE;
323  }
324  memset(inboundJoint.targetPos, 0xff, sizeof(PxReal)*PxArticulationAxis::eCOUNT);
325  memset(inboundJoint.targetVel, 0xff, sizeof(PxReal)*PxArticulationAxis::eCOUNT);
326  }
327 
329 
330  // Non-mutable link data
333  };
334 
342  // PT: Design note: I use Dy::ArticulationV* to be consistent with PxSolverDefs.h
344 
351  PX_C_EXPORT PX_PHYSX_CORE_API void PxReleaseArticulation(Dy::ArticulationV* articulation);
352 
361  PX_C_EXPORT PX_PHYSX_CORE_API Dy::ArticulationLinkHandle PxAddArticulationLink(Dy::ArticulationV* articulation, const PxFeatherstoneArticulationLinkData& data, bool isLastLink=false);
362 
369 
376 
387 
397  PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxGetAllLinkData(const Dy::ArticulationV* articulation, PxLinkData* data);
398 
408 
418 
428 
438 
445  PX_C_EXPORT PX_PHYSX_CORE_API void PxComputeUnconstrainedVelocities(Dy::ArticulationV* articulation, const PxVec3& gravity, const PxReal dt);
446 
452  PX_C_EXPORT PX_PHYSX_CORE_API void PxUpdateArticulationBodies(Dy::ArticulationV* articulation, const PxReal dt);
453 
463  PX_C_EXPORT PX_PHYSX_CORE_API void PxComputeUnconstrainedVelocitiesTGS(Dy::ArticulationV* articulation, const PxVec3& gravity, const PxReal dt, const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt);
464 
470  PX_C_EXPORT PX_PHYSX_CORE_API void PxUpdateArticulationBodiesTGS(Dy::ArticulationV* articulation, const PxReal dt);
471 
472 
483  PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructSolverBodiesTGS(const PxRigidBodyData* inRigidData, PxTGSSolverBodyVel* outSolverBodyVel, PxTGSSolverBodyTxInertia* outSolverBodyTxInertia, PxTGSSolverBodyData* outSolverBodyData, const PxU32 nbBodies, const PxVec3& gravity, const PxReal dt);
484 
492  PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructStaticSolverBodyTGS(const PxTransform& globalPose, PxTGSSolverBodyVel& solverBodyVel, PxTGSSolverBodyTxInertia& solverBodyTxInertia, PxTGSSolverBodyData& solverBodyData);
493 
511  PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxBatchConstraintsTGS(const PxSolverConstraintDesc* solverConstraintDescs, const PxU32 nbConstraints, PxTGSSolverBodyVel* solverBodies, const PxU32 nbBodies,
512  PxConstraintBatchHeader* outBatchHeaders, PxSolverConstraintDesc* outOrderedConstraintDescs,
513  Dy::ArticulationV** articulations = NULL, const PxU32 nbArticulations = 0);
514 
515 
535  PxConstraintAllocator& allocator, const PxReal invDt, const PxReal invTotalDt, const PxReal bounceThreshold, const PxReal frictionOffsetThreshold, const PxReal correlationDistance);
536 
551  PxTGSSolverConstraintPrepDesc* jointDescs, PxConstraintAllocator& allocator, const PxReal dt, const PxReal totalDt, const PxReal invDt,
552  const PxReal invTotalDt, const PxReal lengthScale);
553 
569  PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithShadersTGS(PxConstraintBatchHeader* batchHeaders, const PxU32 nbBatchHeaders, PxConstraint** constraints, PxTGSSolverConstraintPrepDesc* jointDescs, PxConstraintAllocator& allocator, const PxReal dt,
570  const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt, const PxReal lengthScale);
571 
589  PxConstraintAllocator& allocator, const PxReal dt, const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt, const PxReal lengthScale);
590 
591 
607  PX_C_EXPORT PX_PHYSX_CORE_API void PxSolveConstraintsTGS(const PxConstraintBatchHeader* batchHeaders, const PxU32 nbBatchHeaders, const PxSolverConstraintDesc* solverConstraintDescs,
608  PxTGSSolverBodyVel* solverBodies, PxTGSSolverBodyTxInertia* txInertias, const PxU32 nbSolverBodies, const PxU32 nbPositionIterations, const PxU32 nbVelocityIterations,
609  const float dt, const float invDt, const PxU32 nbSolverArticulations, Dy::ArticulationV** solverArticulations);
610 
620  PX_C_EXPORT PX_PHYSX_CORE_API void PxIntegrateSolverBodiesTGS(PxTGSSolverBodyVel* solverBody, PxTGSSolverBodyTxInertia* txInertia, PxTransform* poses, const PxU32 nbBodiesToIntegrate, const PxReal dt);
621 
622 
623 #if !PX_DOXYGEN
624 }
625 #endif
626 
627 #if !PX_DOXYGEN
628 }
629 #endif
630 
632 #endif
633 
Definition: GuContactBuffer.h:37
const void * constantBlock
Definition: PxImmediateMode.h:173
Definition: PxSolverDefs.h:298
Definition: PxImmediateMode.h:252
size_t ArticulationLinkHandle
Definition: PxSolverDefs.h:54
PxArticulationFlags flags
Definition: PxImmediateMode.h:272
Definition: PxSolverDefs.h:398
Definition: Px.h:84
PX_C_EXPORT PX_PHYSX_CORE_API void PxUpdateArticulationBodies(Dy::ArticulationV *articulation, const PxReal dt)
Updates bodies for a given articulation.
PX_C_EXPORT PX_PHYSX_CORE_API void PxComputeUnconstrainedVelocitiesTGS(Dy::ArticulationV *articulation, const PxVec3 &gravity, const PxReal dt, const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt)
Computes unconstrained velocities for a given articulation.
Callback class to record contact points produced by immediate::PxGenerateContacts.
Definition: PxImmediateMode.h:71
Definition: PxSolverDefs.h:172
PxU32 pad
96 Padding for 16-byte alignment
Definition: PxImmediateMode.h:65
PX_C_EXPORT PX_PHYSX_CORE_API Dy::ArticulationV * PxCreateFeatherstoneArticulation(const PxFeatherstoneArticulationData &data)
Creates an immediate-mode reduced-coordinate articulation.
Definition: PxSolverDefs.h:80
virtual ~PxContactRecorder()
Definition: PxImmediateMode.h:83
Definition: PxSolverDefs.h:303
PxTransform body2World
76 World space transform
Definition: PxImmediateMode.h:60
PxConstraintSolverPrep prep
Definition: PxImmediateMode.h:172
PxVec3 invInertia
44 Mass-space inverse interia diagonal vector
Definition: PxImmediateMode.h:58
PxU8 nbContacts
Definition: PxContact.h:462
PX_C_EXPORT PX_PHYSX_CORE_API bool PxGetMutableLinkData(const Dy::ArticulationLinkHandle link, PxMutableLinkData &data)
Retrieves mutable link data from a link handle.
PxVec3 angularVelocity
Definition: PxImmediateMode.h:290
float PxReal
Definition: PxSimpleTypes.h:78
Definition: PxSolverDefs.h:338
PxVec3 linearVelocity
Definition: PxImmediateMode.h:289
PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructStaticSolverBody(const PxTransform &globalPose, PxSolverBodyData &solverBodyData)
Constructs a PxSolverBodyData structure for a static body at a given pose.
Definition: PxSolverDefs.h:332
#define PX_C_EXPORT
Definition: Pxc.h:54
float maxAngularVelocitySq
Definition: PxImmediateMode.h:282
PX_C_EXPORT PX_PHYSX_CORE_API Dy::ArticulationLinkHandle PxAddArticulationLink(Dy::ArticulationV *articulation, const PxFeatherstoneArticulationLinkData &data, bool isLastLink=false)
Adds a link to an immediate-mode reduced-coordinate articulation. The articulation becomes the link&#39;s...
Definition: PxImmediateMode.h:275
PxReal maxAngularVelocitySq
92 Squared maximum angular velocity
Definition: PxImmediateMode.h:64
Enum
Definition: PxSolverDefs.h:255
PxReal angularDamping
84 Angular damping coefficient
Definition: PxImmediateMode.h:62
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsTGS(PxConstraintBatchHeader *batchHeaders, const PxU32 nbHeaders, PxTGSSolverConstraintPrepDesc *jointDescs, PxConstraintAllocator &allocator, const PxReal dt, const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt, const PxReal lengthScale)
Creates a set of joint constraint blocks. Note that, depending the results of PxBatchConstraints, the batchHeader may refer to up to 4 solverConstraintDescs.
Definition: PxSolverDefs.h:216
PxU32(* PxConstraintSolverPrep)(Px1DConstraint *constraints, PxVec3 &bodyAWorldOffset, PxU32 maxConstraints, PxConstraintInvMassScale &invMassScale, const void *constantBlock, const PxTransform &bodyAToWorld, const PxTransform &bodyBToWorld, bool useExtendedLimits, PxVec3 &cAtW, PxVec3 &cBtW)
Definition: PxConstraintDesc.h:228
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithImmediateShaders(PxConstraintBatchHeader *batchHeaders, const PxU32 nbBatchHeaders, PxImmediateConstraint *constraints, PxSolverConstraintPrepDesc *jointDescs, PxConstraintAllocator &allocator, const PxReal dt, const PxReal invDt)
Creates a set of joint constraint blocks. This function runs joint shaders defined inside PxImmediate...
#define PX_PHYSX_CORE_API
Definition: PxPhysXCommonConfig.h:59
PxReal maxLinearVelocitySq
88 Squared maximum linear velocity
Definition: PxImmediateMode.h:63
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateContactConstraintsTGS(PxConstraintBatchHeader *batchHeaders, const PxU32 nbHeaders, PxTGSSolverContactDesc *contactDescs, PxConstraintAllocator &allocator, const PxReal invDt, const PxReal invTotalDt, const PxReal bounceThreshold, const PxReal frictionOffsetThreshold, const PxReal correlationDistance)
Creates a set of contact constraint blocks. Note that, depending the results of PxBatchConstraints, each batchHeader may refer to up to 4 solverConstraintDescs. This function will allocate both constraint and friction patch data via the PxConstraintAllocator provided. Constraint data is only valid until PxSolveConstraints has completed. Friction data is to be retained and provided by the application for friction correlation.
bool disableGravity
Definition: PxImmediateMode.h:283
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateContactConstraints(PxConstraintBatchHeader *batchHeaders, const PxU32 nbHeaders, PxSolverContactDesc *contactDescs, PxConstraintAllocator &allocator, const PxReal invDt, const PxReal bounceThreshold, const PxReal frictionOffsetThreshold, const PxReal correlationDistance)
Creates a set of contact constraint blocks. Note that, depending the results of PxBatchConstraints, each batchHeader may refer to up to 4 solverConstraintDescs. This function will allocate both constraint and friction patch data via the PxConstraintAllocator provided. Constraint data is only valid until PxSolveConstraints has completed. Friction data is to be retained and provided by the application for friction correlation.
A geometry object.
Definition: PxGeometry.h:75
PX_C_EXPORT PX_PHYSX_CORE_API void PxReleaseArticulation(Dy::ArticulationV *articulation)
Releases an immediate-mode reduced-coordinate articulation.
PxTransform childPose
Definition: PxImmediateMode.h:255
PX_C_EXPORT PX_PHYSX_CORE_API void PxSolveConstraints(const PxConstraintBatchHeader *batchHeaders, const PxU32 nbBatchHeaders, const PxSolverConstraintDesc *solverConstraintDescs, const PxSolverBody *solverBodies, PxVec3 *linearMotionVelocity, PxVec3 *angularMotionVelocity, const PxU32 nbSolverBodies, const PxU32 nbPositionIterations, const PxU32 nbVelocityIterations, const float dt=0.0f, const float invDt=0.0f, const PxU32 nbSolverArticulations=0, Dy::ArticulationV **solverArticulations=NULL)
Iteratively solves the set of constraints defined by the provided PxConstraintBatchHeader and PxSolve...
PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructSolverBodies(const PxRigidBodyData *inRigidData, PxSolverBodyData *outSolverBodyData, const PxU32 nbBodies, const PxVec3 &gravity, const PxReal dt)
Constructs a PxSolverBodyData structure based on rigid body properties. Applies gravity, damping and clamps maximum velocity.
Definition: PxCollisionDefs.h:65
Dy::ArticulationLinkHandle parent
Definition: PxImmediateMode.h:332
float linearDamping
Definition: PxImmediateMode.h:279
float angularDamping
Definition: PxImmediateMode.h:280
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithShaders(PxConstraintBatchHeader *batchHeaders, const PxU32 nbBatchHeaders, PxConstraint **constraints, PxSolverConstraintPrepDesc *jointDescs, PxConstraintAllocator &allocator, const PxReal dt, const PxReal invDt)
Creates a set of joint constraint blocks. This function runs joint shaders defined inside PxConstrain...
Definition: PxSolverDefs.h:310
Definition: PxImmediateMode.h:258
PX_C_EXPORT PX_PHYSX_CORE_API void PxUpdateArticulationBodiesTGS(Dy::ArticulationV *articulation, const PxReal dt)
Updates bodies for a given articulation.
PxArticulationJointType::Enum type
Definition: PxImmediateMode.h:260
PX_C_EXPORT PX_PHYSX_CORE_API bool PxGetLinkData(const Dy::ArticulationLinkHandle link, PxLinkData &data)
Retrieves non-mutable link data from a link handle. The data here is computed by the articulation cod...
PxTransform pose
Definition: PxImmediateMode.h:288
void initData()
Definition: PxImmediateMode.h:297
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraints(PxConstraintBatchHeader *batchHeaders, const PxU32 nbHeaders, PxSolverConstraintPrepDesc *jointDescs, PxConstraintAllocator &allocator, const PxReal dt, const PxReal invDt)
Creates a set of joint constraint blocks. Note that, depending the results of PxBatchConstraints, the batchHeader may refer to up to 4 solverConstraintDescs.
PxReal maxJointVelocity
Definition: PxImmediateMode.h:267
PxReal invMass
16 Inverse mass
Definition: PxImmediateMode.h:55
PX_C_EXPORT PX_PHYSX_CORE_API bool PxSetMutableLinkData(Dy::ArticulationLinkHandle link, const PxMutableLinkData &data)
Sets mutable link data for given link.
class representing a rigid euclidean transform as a quaternion and a vector
Definition: PxTransform.h:48
A plugin class for implementing constraints.
Definition: PxConstraint.h:108
Definition: PxSolverDefs.h:188
PxVec3 angularVelocity
28 Angular velocity
Definition: PxImmediateMode.h:56
PxReal linearDamping
80 Linear damping coefficient
Definition: PxImmediateMode.h:61
PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructStaticSolverBodyTGS(const PxTransform &globalPose, PxTGSSolverBodyVel &solverBodyVel, PxTGSSolverBodyTxInertia &solverBodyTxInertia, PxTGSSolverBodyData &solverBodyData)
Constructs a PxSolverBodyData structure for a static body at a given pose.
PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxGetLinkIndex(const Dy::ArticulationLinkHandle link)
Retrieves link index from a link handle.
Definition: PxImmediateMode.h:170
PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxBatchConstraints(const PxSolverConstraintDesc *solverConstraintDescs, const PxU32 nbConstraints, PxSolverBody *solverBodies, const PxU32 nbBodies, PxConstraintBatchHeader *outBatchHeaders, PxSolverConstraintDesc *outOrderedConstraintDescs, Dy::ArticulationV **articulations=NULL, const PxU32 nbArticulations=0)
Groups together sets of independent PxSolverConstraintDesc objects to be solved using SIMD SOA approa...
PxReal frictionCoefficient
Definition: PxImmediateMode.h:266
Definition: PxSolverDefs.h:63
PxTransform pose
Definition: PxImmediateMode.h:331
PX_C_EXPORT PX_PHYSX_CORE_API bool PxGetJointData(const Dy::ArticulationLinkHandle link, PxFeatherstoneArticulationJointData &data)
Retrieves joint data from a link handle.
Definition: PxImmediateMode.h:293
A structure to cache contact information produced by LL contact gen functions.
Definition: PxCollisionDefs.h:49
float maxLinearVelocitySq
Definition: PxImmediateMode.h:281
PX_C_EXPORT PX_PHYSX_CORE_API void PxIntegrateSolverBodies(PxSolverBodyData *solverBodyData, PxSolverBody *solverBody, const PxVec3 *linearMotionVelocity, const PxVec3 *angularMotionState, const PxU32 nbBodiesToIntegrate, const PxReal dt)
Integrates a rigid body, returning the new velocities and transforms. After this function has been ca...
Structure to store rigid body properties.
Definition: PxImmediateMode.h:52
float inverseMass
Definition: PxImmediateMode.h:278
PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxGetAllLinkData(const Dy::ArticulationV *articulation, PxLinkData *data)
Retrieves non-mutable link data from an articulation handle (all links). The data here is computed by...
Definition: PxSolverDefs.h:257
PX_C_EXPORT PX_PHYSX_CORE_API Dy::ArticulationV * PxGetLinkArticulation(const Dy::ArticulationLinkHandle link)
Retrieves owner/parent articulation handle from a link handle.
#define PX_ALIGN(alignment, decl)
Definition: PxPreprocessor.h:403
Definition: PxSolverDefs.h:247
Enum
Definition: PxSolverDefs.h:268
PX_C_EXPORT PX_PHYSX_CORE_API PxU32 PxBatchConstraintsTGS(const PxSolverConstraintDesc *solverConstraintDescs, const PxU32 nbConstraints, PxTGSSolverBodyVel *solverBodies, const PxU32 nbBodies, PxConstraintBatchHeader *outBatchHeaders, PxSolverConstraintDesc *outOrderedConstraintDescs, Dy::ArticulationV **articulations=NULL, const PxU32 nbArticulations=0)
Groups together sets of independent PxSolverConstraintDesc objects to be solved using SIMD SOA approa...
PX_C_EXPORT PX_PHYSX_CORE_API bool PxGenerateContacts(const PxGeometry *const *geom0, const PxGeometry *const *geom1, const PxTransform *pose0, const PxTransform *pose1, PxCache *contactCache, const PxU32 nbPairs, PxContactRecorder &contactRecorder, const PxReal contactDistance, const PxReal meshContactMargin, const PxReal toleranceLength, PxCacheAllocator &allocator)
Performs contact generation for a given pair of geometries at the specified poses. Produced contacts are stored in the provided Gu::ContactBuffer. Information is cached in PxCache structure to accelerate future contact generation between pairs. This cache data is valid only as long as the memory provided by PxCacheAllocator has not been released/re-used. Recommendation is to retain that data for a single simulation frame, discarding cached data after 2 frames. If the cached memory has been released/re-used prior to the corresponding pair having contact generation performed again, it is the application&#39;s responsibility to reset the PxCache.
Definition: PxImmediateMode.h:286
PX_C_EXPORT PX_PHYSX_CORE_API bool PxSetJointData(Dy::ArticulationLinkHandle link, const PxFeatherstoneArticulationJointData &data)
Sets joint data for given link.
Definition: PxSolverDefs.h:111
PX_C_EXPORT PX_PHYSX_CORE_API void PxIntegrateSolverBodiesTGS(PxTGSSolverBodyVel *solverBody, PxTGSSolverBodyTxInertia *txInertia, PxTransform *poses, const PxU32 nbBodiesToIntegrate, const PxReal dt)
Integrates a rigid body, returning the new velocities and transforms. After this function has been ca...
PxFeatherstoneArticulationLinkData()
Definition: PxImmediateMode.h:295
PX_C_EXPORT PX_PHYSX_CORE_API void PxComputeUnconstrainedVelocities(Dy::ArticulationV *articulation, const PxVec3 &gravity, const PxReal dt)
Computes unconstrained velocities for a given articulation.
PxReal maxDepenetrationVelocity
32 Maximum de-penetration velocity
Definition: PxImmediateMode.h:57
uint32_t PxU32
Definition: Px.h:48
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithImmediateShadersTGS(PxConstraintBatchHeader *batchHeaders, const PxU32 nbBatchHeaders, PxImmediateConstraint *constraints, PxTGSSolverConstraintPrepDesc *jointDescs, PxConstraintAllocator &allocator, const PxReal dt, const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt, const PxReal lengthScale)
Creates a set of joint constraint blocks. This function runs joint shaders defined inside PxImmediate...
Definition: PxSolverDefs.h:379
PX_C_EXPORT PX_PHYSX_CORE_API void PxRegisterImmediateArticulations()
Register articulation-related solver functions. This is equivalent to PxRegisterArticulationsReducedC...
PxTransform parentPose
Definition: PxImmediateMode.h:254
Definition: PxSolverDefs.h:274
Definition: PxSolverDefs.h:293
PX_C_EXPORT PX_PHYSX_CORE_API void PxSolveConstraintsTGS(const PxConstraintBatchHeader *batchHeaders, const PxU32 nbBatchHeaders, const PxSolverConstraintDesc *solverConstraintDescs, PxTGSSolverBodyVel *solverBodies, PxTGSSolverBodyTxInertia *txInertias, const PxU32 nbSolverBodies, const PxU32 nbPositionIterations, const PxU32 nbVelocityIterations, const float dt, const float invDt, const PxU32 nbSolverArticulations, Dy::ArticulationV **solverArticulations)
Iteratively solves the set of constraints defined by the provided PxConstraintBatchHeader and PxSolve...
PxFeatherstoneArticulationJointData inboundJoint
Definition: PxImmediateMode.h:328
PX_C_EXPORT PX_PHYSX_CORE_API void PxConstructSolverBodiesTGS(const PxRigidBodyData *inRigidData, PxTGSSolverBodyVel *outSolverBodyVel, PxTGSSolverBodyTxInertia *outSolverBodyTxInertia, PxTGSSolverBodyData *outSolverBodyData, const PxU32 nbBodies, const PxVec3 &gravity, const PxReal dt)
Constructs a PxSolverBodyData structure based on rigid body properties. Applies gravity, damping and clamps maximum velocity.
PxVec3 inverseInertia
Definition: PxImmediateMode.h:277
PX_C_EXPORT PX_PHYSX_CORE_API bool PxCreateJointConstraintsWithShadersTGS(PxConstraintBatchHeader *batchHeaders, const PxU32 nbBatchHeaders, PxConstraint **constraints, PxTGSSolverConstraintPrepDesc *jointDescs, PxConstraintAllocator &allocator, const PxReal dt, const PxReal totalDt, const PxReal invDt, const PxReal invTotalDt, const PxReal lengthScale)
Creates a set of joint constraint blocks. This function runs joint shaders defined inside PxConstrain...
3 Element vector class.
Definition: PxVec3.h:49
Definition: PxImmediateMode.h:270
Definition: PxSolverDefs.h:104
PxReal maxContactImpulse
48 Maximum permissable contact impulse
Definition: PxImmediateMode.h:59