- Direct Known Subclasses:
PxVehicleConstraintConnector
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
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxConstraintConnectorarrayGet(long baseAddress, int index) voidconnectToConstraint(PxConstraint constraint) Let the connector know it has been connected to a constraint.voiddestroy()voidObtain the pointer to the constraint's constant datagetPrep()Obtain the shader function pointer used to prep rows for this constraintObtain a reference to a PxBase interface if the constraint has one.voidonComShift(int actor) Center-of-mass shift callbackvoidConstraint release callbackvoidonOriginShift(PxVec3 shift) Origin shift callbackvoidPre-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.voidthis function is called by the SDK to update OmniPVD's view of itstatic PxConstraintConnectorwrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxConstraintConnector
protected PxConstraintConnector() -
PxConstraintConnector
protected PxConstraintConnector(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
prepareData
public void prepareData()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. -
updateOmniPvdProperties
public void updateOmniPvdProperties()this function is called by the SDK to update OmniPVD's view of it -
onConstraintRelease
public void onConstraintRelease()Constraint release callbackWhen 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.
-
onComShift
public void onComShift(int actor) Center-of-mass shift callbackThis 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.
-
onOriginShift
Origin shift callbackThis 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:
shift- Translation vector the origin is shifted by.- See Also:
-
getSerializable
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.
-
getPrep
Obtain the shader function pointer used to prep rows for this constraint -
getConstantBlock
public void getConstantBlock()Obtain the pointer to the constraint's constant data -
connectToConstraint
Let the connector know it has been connected to a constraint.
-