29#ifndef PX_CONSTRAINT_H
30#define PX_CONSTRAINT_H
36#include "PxPhysXConfig.h"
37#include "PxConstraintDesc.h"
38#include "common/PxBase.h"
47class PxConstraintConnector;
265 virtual ~PxConstraint() {}
Base class for objects that can be members of a PxCollection.
Definition PxBase.h:73
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition PxBase.h:179
This class connects a custom constraint to the SDK.
Definition PxConstraintDesc.h:354
A plugin class for implementing constraints.
Definition PxConstraint.h:100
virtual void getBreakForce(PxReal &linear, PxReal &angular) const =0
Retrieve the constraint break force and torque thresholds.
virtual bool isValid() const =0
whether the constraint is valid.
virtual void setFlag(PxConstraintFlag::Enum flag, bool value)=0
Set a flag for this constraint.
virtual void setFlags(PxConstraintFlags flags)=0
Set the flags for this constraint.
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxConstraint.h:260
virtual PxConstraintFlags getFlags() const =0
Retrieve the flags for this constraint.
virtual void setActors(PxRigidActor *actor0, PxRigidActor *actor1)=0
Sets the actors for this constraint.
virtual const char * getConcreteTypeName() const PX_OVERRIDE
Returns string name of dynamic type.
Definition PxConstraint.h:258
virtual void * getExternalReference(PxU32 &typeID)=0
Fetch external owner of the constraint.
virtual PxScene * getScene() const =0
Retrieves the scene which this constraint belongs to.
virtual void release()=0
Releases a PxConstraint instance.
virtual void setConstraintFunctions(PxConstraintConnector &connector, const PxConstraintShaderTable &shaders)=0
Set the constraint functions for this constraint.
virtual void setBreakForce(PxReal linear, PxReal angular)=0
Set the break force and torque thresholds for this constraint.
virtual void setMinResponseThreshold(PxReal threshold)=0
Set the minimum response threshold for a constraint row.
virtual void getForce(PxVec3 &linear, PxVec3 &angular) const =0
Retrieve the constraint force most recently applied to maintain this constraint.
virtual void markDirty()=0
Notify the scene that the constraint shader data has been updated by the application.
virtual PxReal getMinResponseThreshold() const =0
Retrieve the constraint break force and torque thresholds.
virtual bool isKindOf(const char *name) const PX_OVERRIDE
Returns whether a given type name matches with the type of this instance.
Definition PxConstraint.h:266
virtual void getActors(PxRigidActor *&actor0, PxRigidActor *&actor1) const =0
Retrieves the actors for this constraint.
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
3 Element vector class.
Definition PxVec3.h:50
#define PX_OVERRIDE
Definition PxPreprocessor.h:375
#define PX_INLINE
Definition PxPreprocessor.h:320
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
void(* PxConstraintVisualize)(PxConstraintVisualizer &visualizer, const void *constantBlock, const PxTransform &body0Transform, const PxTransform &body1Transform, PxU32 flags)
Solver constraint visualization function.
Definition PxConstraintDesc.h:323
PX_DEPRECATED void(* PxConstraintProject)(const void *constantBlock, PxTransform &bodyAToWorld, PxTransform &bodyBToWorld, bool projectToA)
Solver constraint projection shader.
Definition PxConstraintDesc.h:247
PxFlags< PxConstraintFlag::Enum, PxU16 > PxConstraintFlags
constraint flags
Definition PxConstraint.h:78
constraint flags
Definition PxConstraint.h:55
Enum
Definition PxConstraint.h:57
@ ePROJECTION
Definition PxConstraint.h:61
@ ePROJECT_TO_ACTOR1
Definition PxConstraint.h:60
@ eIMPROVED_SLERP
perform preprocessing for improved accuracy on D6 Slerp Drive (this flag will be removed in a future ...
Definition PxConstraint.h:65
@ eALWAYS_UPDATE
updates the constraint each frame
Definition PxConstraint.h:69
@ eENABLE_EXTENDED_LIMITS
enables extended limit ranges for angular limits (e.g., limit values > PxPi or < -PxPi)
Definition PxConstraint.h:67
@ eGPU_COMPATIBLE
the constraint type is supported by gpu dynamics
Definition PxConstraint.h:68
@ ePROJECT_TO_ACTOR0
Definition PxConstraint.h:59
@ eDISABLE_PREPROCESSING
suppress constraint preprocessing, intended for use with rowResponseThreshold. May result in worse so...
Definition PxConstraint.h:66
@ eVISUALIZATION
whether this constraint should be visualized, if constraint visualization is turned on
Definition PxConstraint.h:63
@ eBROKEN
whether the constraint is broken
Definition PxConstraint.h:58
@ eDISABLE_CONSTRAINT
disables the constraint. SolverPrep functions won't be called for this constraint.
Definition PxConstraint.h:70
@ eCOLLISION_ENABLED
whether contacts should be generated between the objects this constraint constrains
Definition PxConstraint.h:62
@ eDRIVE_LIMITS_ARE_FORCES
limits for drive strength are forces rather than impulses
Definition PxConstraint.h:64
a table of function pointers for a constraint
Definition PxConstraint.h:87
PxConstraintSolverPrep solverPrep
solver constraint generation function
Definition PxConstraint.h:88
PxConstraintProject project
Definition PxConstraint.h:89
PxConstraintFlag::Enum flag
constraint flags
Definition PxConstraint.h:91
PxConstraintVisualize visualize
constraint visualization function
Definition PxConstraint.h:90