PxDeformableAttachmentData

Defined in include/PxDeformableAttachment.h

struct PxDeformableAttachmentData

Attachment data for a pair of actors where one of the actors must be a deformable.

For attaching rigids to rigids or rigids to the world, use joints instead.

An attachment is created based on a collection of attachment points. The attachment points are specified relatively to each of the two actors. They can be defined on the basis of deformable mesh elements, such as vertices, triangles or tetrahedrons. Depending on the deformable mesh element type, a baricentric coordinate further specifies the location on the element. For rigid or world attachments, the points are specified using cartesion coordinates.

The points are specified by:

  • Two actor instances and their types

  • Two attachment target types

  • Two sets of attachment data related to the target types

Table 1) The type of an actor limits which target types can be used:

PxDeformableSurface:    eVERTEX, eTRIANGLE
PxDeformableVolume:     eVERTEX, eTETRAHEDRON (simulation mesh)
PxRigidActor:           eRIGID
NULL:                   eWORLD
Table 2) On the other hand, the target type dictates which per-actor attachment data is needed:
eVERTEX:        indices
eTRIANGLE:      indices, coords (barycentric: x, y, z)
eTETRAHEDRON:   indices, coords (barycentric: x, y, z, w)
eRIGID:         pose, coords (cartesian, local space: x, y, z)
eWORLD:         pose, coords (cartesion, world space: x, y, z)
Each entry pair in (indices, coords) defines an attachment point. Therefore, the size of indices and coords need to match up, if both are required.

See also

PxDeformableAttachment, PxPhysics::createDeformableAttachment()

Note

The topology of an attachment is fixed once it’s been created. To change the attachment points, the application will need to release the attachment and create a new attachment with the updated attachment points. The pose for attachments to eRIGID or eWORLD, however, can be updated without re-creating the attachment.

Public Functions

inline PxDeformableAttachmentData()

Public Members

PxActor *actor[2]

Actor 0 and Actor 1.

At least one of the actors must be a deformable. For attaching statically to the world, one actor is allowed to be NULL while the other is a deformable.

PxDeformableAttachmentTargetType::Enum type[2]

One target type per actor.

The target type must be supported by the corresponding actor type, see table 1.

PxTypedBoundedData<const PxU32> indices[2]

Indices data per actor.

The content of the two index arrays depends on the corresponding target types ‘type[0]’ and ‘type[1]’ as well as the number of attachments: For PxDeformableAttachmentTargetType::eVERTEX, eTRIANGLE and eTETRAHEDRON, the corresponding array describes vertex, triangle or tetrahedon indices, and the size of the array needs to match the number of attachments. For PxDeformableAttachmentTargetType::eRIGID and eWORLD, the corresponding array needs to be empty. See table 2.

PxTypedBoundedData<const PxVec4> coords[2]

Coordinate data per actor.

The content of the two coords arrays depends on the corresponding target types ‘type[0]’ and ‘type[1]’ as well as the number of attachments: For PxDeformableAttachmentTargetType::eVERTEX, the corresponding array needs to be empty. For PxDeformableAttachmentTargetType::eTRIANGLE and eTETRAHEDRON, the corresponding array descibes barycentric coordinates, and the size of the array needs to match the number of attachments. For PxDeformableAttachmentTargetType::eRIGID and eWORLD, the corresponding array describes cartesian coordinates and the size of the array needs to match the number of attachments. See table 2.

PxTransform pose[2]

Pose per actor.

Global pose for PxDeformableAttachmentTargetType::eWORLD or local pose for PxDeformableAttachmentTargetType::eRIGID, see table 2. The pose represents a coordinate frame for all attachment points specified by the array of euclidean coords in the case of PxDeformableAttachmentTargetType::eRIGID and eWORLD attachments. It can be updated after the attachment has been created.

See also

PxDeformableAttachment::updatePose()