PxConstraintSolverPrep

Defined in include/PxConstraintDesc.h

typedef 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.

This function is called by the constraint solver framework. The function must be reentrant, since it may be called simultaneously from multiple threads, and should access only the arguments passed into it.

Developers writing custom constraints are encouraged to read the documentation in the user guide and the implementation code in PhysXExtensions.

Param constraints

[out] An array of solver constraint rows to be filled in

Param bodyAWorldOffset

[out] The origin point (offset from the position vector of bodyA’s center of mass) at which the constraint is resolved. This value does not affect how constraints are solved, only the constraint force reported.

Param maxConstraints

[in] The size of the constraint buffer. At most this many constraints rows may be written

Param invMassScale

[out] The inverse mass and inertia scales for the constraint

Param constantBlock

[in] The constant data block

Param bodyAToWorld

[in] The center of mass frame of the first constrained body (the identity transform if the first actor is static, or if a NULL actor pointer was provided for it)

Param bodyBToWorld

[in] The center of mass frame of the second constrained body (the identity transform if the second actor is static, or if a NULL actor pointer was provided for it)

Param useExtendedLimits

[in] Enables limit ranges outside of (-PI, PI)

Param cAtW

[out] The world space location of body A’s joint frame (position only)

Param cBtW

[out] The world space location of body B’s joint frame (position only)

Return

the number of constraint rows written.