34#include "PxFEMParameter.h"
36#include "PxConeLimitedConstraint.h"
45#pragma warning(disable : 4435)
48 class PxCudaContextManager;
50 class PxTetrahedronMesh;
51 class PxSoftBodyAuxData;
53 class PxParticleBuffer;
58 #define PX_MAX_TETID 0x000fffff
80 typedef PxFlags<PxSoftBodyData::Enum, PxU32> PxSoftBodyDataFlags;
98 typedef PxFlags<PxSoftBodyFlag::Enum, PxU32> PxSoftBodyFlags;
728 PX_INLINE PxSoftBody(PxBaseFlags baseFlags) : PxActor(baseFlags) {}
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxActor.h:368
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Buffer for delayed bulk read and write operations supporting host and GPU device memory spaces.
Definition PxBuffer.h:66
A particle system that uses the position based dynamics(PBD) solver.
Definition PxPBDParticleSystem.h:57
The shared base class for all particle buffers, can be instantiated directly to simulate granular and...
Definition PxParticleBuffer.h:81
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Abstract class for collision shapes.
Definition PxShape.h:146
A data container providing mass, rest pose and other information required for softbody simulation.
Definition PxTetrahedronMesh.h:70
Represents a FEM softbody including everything to calculate its definition like geometry and material...
Definition PxSoftBody.h:104
virtual void addTetRigidFilter(PxRigidActor *actor, PxU32 tetIdx)=0
Creates collision filter between a tetrahedron in a soft body and a rigid body.
virtual bool isSleeping() const =0
Returns true if this soft body is sleeping.
virtual bool attachSimulationMesh(PxTetrahedronMesh &simulationMesh, PxSoftBodyAuxData &softBodyAuxData)=0
Attaches a simulation mesh.
virtual PxReal getWakeCounter() const =0
Returns the wake counter of the soft body.
virtual void removeClothFilter(PxFEMCloth *cloth, PxU32 triIdx, PxU32 tetIdx)=0
Removes collision filter between a tetrahedron in a soft body and a triangle in a cloth.
virtual PxU32 addSoftBodyAttachment(PxSoftBody *softbody0, PxU32 tetIdx0, const PxVec4 &tetBarycentric0, PxU32 tetIdx1, const PxVec4 &tetBarycentric1, PxConeLimitedConstraint *constraint=NULL)=0
Creates an attachment between two soft bodies.
virtual void addRigidFilter(PxRigidActor *actor, PxU32 vertId)=0
Creates a collision filter between a vertex in a soft body and a rigid body.
virtual void removeRigidAttachment(PxRigidActor *actor, PxU32 handle)=0
Releases a rigid attachment between a soft body and a rigid body. Be aware that destroying the rigid ...
virtual PxU32 getGpuSoftBodyIndex()=0
Returns the GPU soft body index.
virtual void writeData(PxSoftBodyData::Enum flags, PxBuffer &buffer, bool flush=false)=0
Issues a write command to the PxSoftBody.
virtual const char * getConcreteTypeName() const PX_OVERRIDE
Returns string name of dynamic type.
Definition PxSoftBody.h:723
virtual void setSoftBodyFlag(PxSoftBodyFlag::Enum flag, bool val)=0
Set a single softbody flag.
virtual void detachSimulationMesh()=0
Detaches the simulation mesh.
virtual PxSoftBodyAuxData * getSoftBodyAuxData()=0
Retrieves the simulation state pointer.
virtual void setWakeCounter(PxReal wakeCounterValue)=0
Sets the wake counter for the soft body.
virtual PxBounds3 getWorldBounds(float inflation=1.01f) const =0
Retrieves the axis aligned bounding box enclosing the soft body.
virtual PxBuffer * getPositionInvMassCPU()=0
Access to the vertices of the collision mesh on the host.
virtual void removeParticleFilter(PxPBDParticleSystem *particlesystem, const PxParticleBuffer *buffer, PxU32 particleId, PxU32 tetId)=0
Removes a collision filter between a particle and a tetrahedron in the soft body's collision mesh.
virtual void readData(PxSoftBodyData::Enum flags, bool flush=false)=0
Issues a read command to the PxSoftBody.
virtual void addParticleFilter(PxPBDParticleSystem *particlesystem, const PxParticleBuffer *buffer, PxU32 particleId, PxU32 tetId)=0
Creates a collision filter between a particle and a tetrahedron in the soft body's collision mesh.
virtual void getSolverIterationCounts(PxU32 &minPositionIters, PxU32 &minVelocityIters) const =0
Retrieves the solver iteration counts.
virtual PxCudaContextManager * getCudaContextManager() const =0
Return the cuda context manager.
virtual PxShape * getShape()=0
Retrieves the shape pointer belonging to the actor.
virtual void detachShape()=0
Detaches the shape.
virtual void readData(PxSoftBodyData::Enum flags, PxBuffer &buffer, bool flush=false)=0
Issues a read command to the PxSoftBody.
virtual PxTetrahedronMesh * getCollisionMesh()=0
Retrieve the collision mesh pointer.
virtual bool attachShape(PxShape &shape)=0
Attaches a shape.
virtual PxBuffer * getKinematicTargetCPU()=0
Access to the vertices of the simulation mesh on the host.
virtual PxU32 addParticleAttachment(PxPBDParticleSystem *particlesystem, const PxParticleBuffer *buffer, PxU32 particleId, PxU32 tetId, const PxVec4 &barycentric)=0
Creates an attachment between a particle and a soft body. Be aware that destroying the particle syste...
virtual void removeParticleAttachment(PxPBDParticleSystem *particlesystem, PxU32 handle)=0
Removes an attachment between a particle and a soft body. Be aware that destroying the particle syste...
virtual void setParameter(const PxFEMParameters parameters)=0
Set parameter for FEM internal solve.
virtual PxU32 addRigidAttachment(PxRigidActor *actor, PxU32 vertId, const PxVec3 &actorSpacePose, PxConeLimitedConstraint *constraint=NULL)=0
Creates a rigid attachment between a soft body and a rigid body. Be aware that destroying the rigid b...
virtual void removeSoftBodyFilter(PxSoftBody *otherSoftBody, PxU32 otherTetIdx, PxU32 tetIdx1)=0
Removes collision filter between a tetrahedron in a soft body and a tetrahedron in other soft body.
virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters=1)=0
Sets the solver iteration counts for the body.
virtual PxU32 addClothAttachment(PxFEMCloth *cloth, PxU32 triIdx, const PxVec4 &triBarycentric, PxU32 tetIdx, const PxVec4 &tetBarycentric, PxConeLimitedConstraint *constraint=NULL)=0
Creates an attachment between a soft body and a cloth. Be aware that destroying the rigid body before...
virtual void release()=0
Releases the softbody.
virtual PxU32 addTetRigidAttachment(PxRigidActor *actor, PxU32 tetIdx, const PxVec4 &barycentric, const PxVec3 &actorSpacePose, PxConeLimitedConstraint *constraint=NULL)=0
Creates a rigid attachment between a soft body and a rigid body. Be aware that destroying the rigid b...
virtual void removeTetRigidFilter(PxRigidActor *actor, PxU32 tetIdx)=0
Removes collision filter between a tetrahedron in a soft body and a rigid body.
virtual void addSoftBodyFilter(PxSoftBody *otherSoftBody, PxU32 otherTetIdx, PxU32 tetIdx1)=0
Creates collision filter between a tetrahedron in a soft body and a tetrahedron in another soft body.
virtual void removeClothAttachment(PxFEMCloth *cloth, PxU32 handle)=0
Releases an attachment between a cloth and a soft body. Be aware that destroying the cloth before des...
virtual bool isKindOf(const char *name) const PX_OVERRIDE
Returns whether a given type name matches with the type of this instance.
Definition PxSoftBody.h:729
virtual PxTetrahedronMesh * getSimulationMesh()=0
Retrieves the simulation mesh pointer.
virtual PxSoftBodyFlags getSoftBodyFlag() const =0
Get the softbody flags.
virtual void writeData(PxSoftBodyData::Enum flags, bool flush=false)=0
Issues a write command to the PxSoftBody.
virtual void setSoftBodyFlags(PxSoftBodyFlags flags)=0
Set the softbody flags.
virtual void addSoftBodyFilters(PxSoftBody *otherSoftBody, PxU32 *otherTetIndices, PxU32 *tetIndices, PxU32 tetIndicesSize)=0
Creates collision filters between a tetrahedron in a soft body with another soft body.
virtual PxFEMParameters getParameter() const =0
Get parameter for FEM internal solve.
virtual void removeSoftBodyFilters(PxSoftBody *otherSoftBody, PxU32 *otherTetIndices, PxU32 *tetIndices, PxU32 tetIndicesSize)=0
Removes collision filters between a tetrahedron in a soft body with another soft body.
virtual void removeRigidFilter(PxRigidActor *actor, PxU32 vertId)=0
Removes a collision filter between a vertex in a soft body and a rigid body.
virtual PxBuffer * getSimVelocityInvMassCPU()=0
Access to the velocities of the simulation mesh on the host.
virtual PxBuffer * getRestPositionInvMassCPU()=0
Access to the rest vertices of the collision mesh on the host.
virtual void removeSoftBodyAttachment(PxSoftBody *softbody0, PxU32 handle)=0
Releases an attachment between a soft body and the other soft body. Be aware that destroying the soft...
virtual PxBuffer * getSimPositionInvMassCPU()=0
Access to the vertices of the simulation mesh on the host.
virtual void addClothFilter(PxFEMCloth *cloth, PxU32 triIdx, PxU32 tetIdx)=0
Creates collision filter between a tetrahedron in a soft body and a triangle in a cloth.
A tetramedron mesh, also called a 'tetrahedron soup'.
Definition PxTetrahedronMesh.h:115
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
A constraint descriptor for limiting movement to a conical region.
Definition PxConeLimitedConstraint.h:48
Set of parameters to control the sleeping and collision behavior of FEM based objects.
Definition PxFEMParameter.h:45
Identifies input and output buffers for PxSoftBody.
Definition PxSoftBody.h:66
Enum
Definition PxSoftBody.h:68
@ eSIM_KINEMATIC_TARGET
Flag to request access to the simulation mesh's kinematic target position.
Definition PxSoftBody.h:74
@ eSIM_POSITION_INVMASS
Flag to request access to the simulation mesh's positions and inverse masses.
Definition PxSoftBody.h:72
@ eSIM_VELOCITY
Flag to request access to the simulation mesh's velocities and inverse masses.
Definition PxSoftBody.h:73
@ ePOSITION_INVMASS
Flag to request access to the collision mesh's positions; read only.
Definition PxSoftBody.h:71
Flags to enable or disable special modes of a SoftBody.
Definition PxSoftBody.h:86
Enum
Definition PxSoftBody.h:88
@ eDISABLE_SELF_COLLISION
Determines if self collision will be detected and resolved.
Definition PxSoftBody.h:89
@ eDISPLAY_SIM_MESH
Enable debug rendering to display the simulation mesh.
Definition PxSoftBody.h:92
@ eENABLE_CCD
Enables support for continuous collision detection.
Definition PxSoftBody.h:91
@ eKINEMATIC
Enables support for kinematic motion of the collision and simulation mesh.
Definition PxSoftBody.h:93
@ eCOMPUTE_STRESS_TENSOR
Enables computation of a Cauchy stress tensor for every tetrahedron in the simulation mesh....
Definition PxSoftBody.h:90
@ ePARTIALLY_KINEMATIC
Enables partially kinematic motion of the collisios and simulation mesh.
Definition PxSoftBody.h:94