RavEngine
Loading...
Searching...
No Matches
physx::PxConstraintConnector Class Referenceabstract

This class connects a custom constraint to the SDK. More...

#include <PxConstraintDesc.h>

Inheritance diagram for physx::PxConstraintConnector:
[legend]

Public Member Functions

virtual void * prepareData ()=0
 Pre-simulation data preparation when the constraint is marked dirty, this function is called at the start of the simulation step for the SDK to copy the constraint data block.
 
virtual bool updatePvdProperties (physx::pvdsdk::PvdDataStream &pvdConnection, const PxConstraint *c, PxPvdUpdateType::Enum updateType) const =0
 this function is called by the SDK to update PVD's view of it
 
virtual void updateOmniPvdProperties () const =0
 this function is called by the SDK to update OmniPVD's view of it
 
virtual void onConstraintRelease ()=0
 Constraint release callback.
 
virtual void onComShift (PxU32 actor)=0
 Center-of-mass shift callback.
 
virtual void onOriginShift (const PxVec3 &shift)=0
 Origin shift callback.
 
virtual void * getExternalReference (PxU32 &typeID)=0
 Fetches external data for a constraint.
 
virtual PxBase * getSerializable ()=0
 Obtain a reference to a PxBase interface if the constraint has one.
 
virtual PxConstraintSolverPrep getPrep () const =0
 Obtain the shader function pointer used to prep rows for this constraint.
 
virtual const void * getConstantBlock () const =0
 Obtain the pointer to the constraint's constant data.
 
virtual void connectToConstraint (PxConstraint *)
 Let the connector know it has been connected to a constraint.
 
virtual ~PxConstraintConnector ()
 virtual destructor
 

Detailed Description

This class connects a custom constraint to the SDK.

This class connects a custom constraint to the SDK, and functions are called by the SDK to query the custom implementation for specific information to pass on to the application or inform the constraint when the application makes calls into the SDK which will update the custom constraint's internal implementation

Member Function Documentation

◆ connectToConstraint()

virtual void physx::PxConstraintConnector::connectToConstraint ( PxConstraint *  )
inlinevirtual

Let the connector know it has been connected to a constraint.

Reimplemented in physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ getConstantBlock()

virtual const void * physx::PxConstraintConnector::getConstantBlock ( ) const
pure virtual

◆ getExternalReference()

virtual void * physx::PxConstraintConnector::getExternalReference ( PxU32 &  typeID)
pure virtual

Fetches external data for a constraint.

This function is used by the SDK to acquire a reference to the owner of a constraint and a unique owner type ID. This information will be passed on when a breakable constraint breaks or when PxConstraint::getExternalReference() is called.

Parameters
[out]typeIDUnique type identifier of the external object. The value 0xffffffff is reserved and should not be used. Furthermore, if the PhysX extensions library is used, some other IDs are reserved already (see PxConstraintExtIDs)
Returns
Reference to the external object which owns the constraint.
See also
PxConstraintInfo PxSimulationEventCallback.onConstraintBreak()

Implemented in PulleyJoint, physx::vehicle2::PxVehicleConstraintConnector, physx::PxVehicleConstraintShader, and physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ getPrep()

◆ getSerializable()

virtual PxBase * physx::PxConstraintConnector::getSerializable ( )
pure virtual

Obtain a reference to a PxBase interface if the constraint has one.

If the constraint does not implement the PxBase interface, it should return NULL.

Implemented in physx::vehicle2::PxVehicleConstraintConnector, PulleyJoint, physx::PxVehicleConstraintShader, and physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ onComShift()

virtual void physx::PxConstraintConnector::onComShift ( PxU32  actor)
pure virtual

Center-of-mass shift callback.

This function is called by the SDK when the CoM of one of the actors is moved. Since the API specifies constraint positions relative to actors, and the constraint shader functions are supplied with coordinates relative to bodies, some synchronization is usually required when the application moves an object's center of mass.

Implemented in PulleyJoint, physx::vehicle2::PxVehicleConstraintConnector, physx::PxVehicleConstraintShader, and physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ onConstraintRelease()

virtual void physx::PxConstraintConnector::onConstraintRelease ( )
pure virtual

Constraint release callback.

When the SDK deletes a PxConstraint object this function is called by the SDK. In general custom constraints should not be deleted directly by applications: rather, the constraint should respond to a release() request by calling PxConstraint::release(), then wait for this call to release its own resources.

This function is also called when a PxConstraint object is deleted on cleanup due to destruction of the PxPhysics object.

Implemented in physx::vehicle2::PxVehicleConstraintConnector, PulleyJoint, physx::PxVehicleConstraintShader, and physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ onOriginShift()

virtual void physx::PxConstraintConnector::onOriginShift ( const PxVec3 &  shift)
pure virtual

Origin shift callback.

This function is called by the SDK when the scene origin gets shifted and allows to adjust custom data which contains world space transforms.

Note
If the adjustments affect constraint shader data, it is necessary to call PxConstraint::markDirty() to make sure that the data gets synced at the beginning of the next simulation step.
Parameters
[in]shiftTranslation vector the origin is shifted by.
See also
PxScene.shiftOrigin()

Implemented in PulleyJoint, physx::vehicle2::PxVehicleConstraintConnector, physx::PxVehicleConstraintShader, and physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ prepareData()

virtual void * physx::PxConstraintConnector::prepareData ( )
pure virtual

Pre-simulation data preparation when the constraint is marked dirty, this function is called at the start of the simulation step for the SDK to copy the constraint data block.

Implemented in physx::vehicle2::PxVehicleConstraintConnector, PulleyJoint, physx::PxVehicleConstraintShader, physx::Ext::D6Joint, physx::Ext::GearJoint, physx::Ext::JointT< Base, DataClass, ValueStruct >, and physx::Ext::RackAndPinionJoint.

◆ updateOmniPvdProperties()

virtual void physx::PxConstraintConnector::updateOmniPvdProperties ( ) const
pure virtual

this function is called by the SDK to update OmniPVD's view of it

Implemented in physx::vehicle2::PxVehicleConstraintConnector, PulleyJoint, physx::PxVehicleConstraintShader, and physx::Ext::JointT< Base, DataClass, ValueStruct >.

◆ updatePvdProperties()

virtual bool physx::PxConstraintConnector::updatePvdProperties ( physx::pvdsdk::PvdDataStream &  pvdConnection,
const PxConstraint *  c,
PxPvdUpdateType::Enum  updateType 
) const
pure virtual

The documentation for this class was generated from the following file: