32#include "PxSoftBody.h"
33#include "ScSoftBodyCore.h"
34#include "NpActorTemplate.h"
35#include "GuTetrahedronMesh.h"
45 NpSoftBody(PxCudaContextManager& cudaContextManager);
97 static PX_FORCE_INLINE size_t getCoreOffset() {
return PX_OFFSET_OF_RT(NpSoftBody, mCore); }
144 void updateMaterials();
155 PxCudaContextManager* mCudaContextManager;
Definition GuTetrahedronMesh.h:54
Definition GuTetrahedronMesh.h:120
Definition NpActorTemplate.h:54
Definition NpSoftBody.h:43
virtual PxU32 addParticleAttachment(PxPBDParticleSystem *particlesystem, const PxParticleBuffer *buffer, PxU32 particleId, PxU32 tetId, const PxVec4 &barycentric)
Creates an attachment between a particle and a soft body. Be aware that destroying the particle syste...
virtual PxTetrahedronMesh * getCollisionMesh()
Retrieve the collision mesh pointer.
virtual PxBuffer * getSimPositionInvMassCPU()
Access to the vertices of the simulation mesh on the host.
Definition NpSoftBody.h:137
virtual void readData(PxSoftBodyData::Enum flags, bool flush)
Issues a read command to the PxSoftBody.
virtual void detachSimulationMesh()
Detaches the simulation mesh.
virtual void removeParticleAttachment(PxPBDParticleSystem *particlesystem, PxU32 handle)
Removes an attachment between a particle and a soft body. Be aware that destroying the particle syste...
virtual PxU32 addSoftBodyAttachment(PxSoftBody *softbody0, PxU32 tetIdx0, const PxVec4 &tetBarycentric0, PxU32 tetIdx1, const PxVec4 &tetBarycentric1, PxConeLimitedConstraint *constraint)
Creates an attachment between two soft bodies.
virtual void getSolverIterationCounts(PxU32 &minPositionIters, PxU32 &minVelocityIters) const
Retrieves the solver iteration counts.
virtual PxFEMParameters getParameter() const
Get parameter for FEM internal solve.
virtual void removeClothFilter(PxFEMCloth *cloth, PxU32 triIdx, PxU32 tetIdx)
Removes collision filter between a tetrahedron in a soft body and a triangle in a cloth.
virtual void removeRigidAttachment(PxRigidActor *actor, PxU32 handle)
Releases a rigid attachment between a soft body and a rigid body. Be aware that destroying the rigid ...
virtual PxBuffer * getSimVelocityInvMassCPU()
Access to the velocities of the simulation mesh on the host.
Definition NpSoftBody.h:138
virtual void addRigidFilter(PxRigidActor *actor, PxU32 vertId)
Creates a collision filter between a vertex in a soft body and a rigid body.
virtual void addTetRigidFilter(PxRigidActor *actor, PxU32 tetIdx)
Creates collision filter between a tetrahedron in a soft body and a rigid body.
virtual void removeParticleFilter(PxPBDParticleSystem *particlesystem, const PxParticleBuffer *buffer, PxU32 particleId, PxU32 tetId)
Removes a collision filter between a particle and a tetrahedron in the soft body's collision mesh.
const char * getName() const
Retrieves the name string set with setName().
virtual PxBuffer * getKinematicTargetCPU()
Access to the vertices of the simulation mesh on the host.
Definition NpSoftBody.h:139
virtual void setParameter(const PxFEMParameters paramters)
Set parameter for FEM internal solve.
virtual void removeRigidFilter(PxRigidActor *actor, PxU32 vertId)
Removes a collision filter between a vertex in a soft body and a rigid body.
virtual bool isSleeping() const
Returns true if this soft body is sleeping.
virtual PxSoftBodyFlags getSoftBodyFlag() const
Get the softbody flags.
virtual void removeSoftBodyAttachment(PxSoftBody *softbody0, PxU32 handle)
Releases an attachment between a soft body and the other soft body. Be aware that destroying the soft...
virtual PxU32 addTetRigidAttachment(PxRigidActor *actor, PxU32 tetIdx, const PxVec4 &barycentric, const PxVec3 &actorSpacePose, PxConeLimitedConstraint *constraint)
Creates a rigid attachment between a soft body and a rigid body. Be aware that destroying the rigid b...
virtual PxU32 addClothAttachment(PxFEMCloth *cloth, PxU32 triIdx, const PxVec4 &triBarycentric, PxU32 tetIdx, const PxVec4 &tetBarycentric, PxConeLimitedConstraint *constraint)
Creates an attachment between a soft body and a cloth. Be aware that destroying the rigid body before...
virtual void removeClothAttachment(PxFEMCloth *cloth, PxU32 handle)
Releases an attachment between a cloth and a soft body. Be aware that destroying the cloth before des...
virtual void release()
Releases the softbody.
virtual void readData(PxSoftBodyData::Enum flags, PxBuffer &buffer, bool flush)
Issues a read command to the PxSoftBody.
virtual PxShape * getShape()
Retrieves the shape pointer belonging to the actor.
virtual PxReal getWakeCounter() const
Returns the wake counter of the soft body.
virtual void addClothFilter(PxFEMCloth *cloth, PxU32 triIdx, PxU32 tetIdx)
Creates collision filter between a tetrahedron in a soft body and a triangle in a cloth.
virtual PxCudaContextManager * getCudaContextManager() const
Return the cuda context manager.
virtual PxBounds3 getWorldBounds(float inflation=1.01f) const
Retrieves the axis aligned bounding box enclosing the soft body.
virtual void detachShape()
Detaches the shape.
virtual PxSoftBodyAuxData * getSoftBodyAuxData()
Retrieves the simulation state pointer.
virtual void addSoftBodyFilters(PxSoftBody *softbody0, PxU32 *tetIndices0, PxU32 *tetIndices1, PxU32 tetIndicesSize)
Creates collision filters between a tetrahedron in a soft body with another soft body.
virtual void setSoftBodyFlags(PxSoftBodyFlags flags)
Set the softbody flags.
virtual void setWakeCounter(PxReal wakeCounterValue)
Sets the wake counter for the soft body.
void setName(const char *)
Sets a name string for the object that can be retrieved with getName().
virtual PxActorType::Enum getType() const
Retrieves the type of actor.
Definition NpSoftBody.h:53
virtual void writeData(PxSoftBodyData::Enum flags, bool flush)
Issues a write command to the PxSoftBody.
virtual PxU32 getGpuSoftBodyIndex()
Returns the GPU soft body index.
virtual void setSoftBodyFlag(PxSoftBodyFlag::Enum flag, bool val)
Set a single softbody flag.
virtual PxBuffer * getRestPositionInvMassCPU()
Access to the rest vertices of the collision mesh on the host.
Definition NpSoftBody.h:142
virtual PxTetrahedronMesh * getSimulationMesh()
Retrieves the simulation mesh pointer.
virtual void removeSoftBodyFilters(PxSoftBody *softbody0, PxU32 *tetIndices0, PxU32 *tetIndices1, PxU32 tetIndicesSize)
Removes collision filters between a tetrahedron in a soft body with another soft body.
virtual bool attachShape(PxShape &shape)
Attaches a shape.
virtual void addParticleFilter(PxPBDParticleSystem *particlesystem, const PxParticleBuffer *buffer, PxU32 particleId, PxU32 tetId)
Creates a collision filter between a particle and a tetrahedron in the soft body's collision mesh.
virtual void removeSoftBodyFilter(PxSoftBody *softbody0, PxU32 tetIdx0, PxU32 tetIdx1)
Removes collision filter between a tetrahedron in a soft body and a tetrahedron in other soft body.
virtual bool attachSimulationMesh(PxTetrahedronMesh &simulationMesh, PxSoftBodyAuxData &softBodyAuxData)
Attaches a simulation mesh.
virtual void writeData(PxSoftBodyData::Enum flags, PxBuffer &buffer, bool flush)
Issues a write command to the PxSoftBody.
virtual void addSoftBodyFilter(PxSoftBody *softbody0, PxU32 tetIdx0, PxU32 tetIdx1)
Creates collision filter between a tetrahedron in a soft body and a tetrahedron in another soft body.
virtual PxU32 addRigidAttachment(PxRigidActor *actor, PxU32 vertId, const PxVec3 &actorSpacePose, PxConeLimitedConstraint *constraint)
Creates a rigid attachment between a soft body and a rigid body. Be aware that destroying the rigid b...
virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters)
Sets the solver iteration counts for the body.
virtual void removeTetRigidFilter(PxRigidActor *actor, PxU32 tetIdx)
Removes collision filter between a tetrahedron in a soft body and a rigid body.
virtual PxBuffer * getPositionInvMassCPU()
Access to the vertices of the collision mesh on the host.
Definition NpSoftBody.h:141
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
Binary serialization context class.
Definition PxSerialFramework.h:99
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
A tetramedron mesh, also called a 'tetrahedron soup'.
Definition PxTetrahedronMesh.h:115
3 Element vector class.
Definition PxVec3.h:50
Definition ScSoftBodyCore.h:53
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Enum
Definition PxActor.h:121
@ eSOFTBODY
A FEM-based soft body.
Definition PxActor.h:144
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
Enum
Definition PxSoftBody.h:68
Enum
Definition PxSoftBody.h:88