29#ifndef GU_TETRAHEDRONMESH_H
30#define GU_TETRAHEDRONMESH_H
32#include "foundation/PxIO.h"
33#include "geometry/PxTetrahedronMeshGeometry.h"
34#include "geometry/PxTetrahedronMesh.h"
35#include "geometry/PxTetrahedron.h"
36#include "geometry/PxSimpleTriangleMesh.h"
37#include "CmRefCountable.h"
38#include "common/PxRenderOutput.h"
39#include "GuMeshData.h"
40#include "GuCenterExtents.h"
41#include "GuMeshFactory.h"
50#pragma warning(disable: 4324)
64 virtual void release() { Cm::RefCountable_decRefCount(*
this); }
65 virtual void onRefCountZero() { PX_DELETE_THIS; }
67 PX_FORCE_INLINE PxU32 getNbTetRemapSizeFast()
const {
return mTetsRemapSize; }
68 PX_FORCE_INLINE PxReal* getGridModelInvMassFast() {
return mGridModelInvMass; }
69 PX_FORCE_INLINE PxU32 getNbGMPartitionFast()
const {
return mGMNbPartitions; }
71 PX_FORCE_INLINE PxU32 getGMRemapOutputSizeFast()
const {
return mGMRemapOutputSize; }
72 PX_FORCE_INLINE PxU32 getGMMaxTetsPerPartitionsFast()
const {
return mGMMaxMaxTetsPerPartitions; }
75 PX_FORCE_INLINE PxU32* getCollisionAccumulatedTetrahedronRefs()
const {
return mCollisionAccumulatedTetrahedronsRef; }
76 PX_FORCE_INLINE PxU32* getCollisionTetrahedronRefs()
const {
return mCollisionTetrahedronsReferences; }
77 PX_FORCE_INLINE PxU32 getCollisionNbTetrahedronRefs()
const {
return mCollisionNbTetrahedronsReferences; }
79 PX_FORCE_INLINE PxU32* getCollisionSurfaceVertToTetRemap()
const {
return mCollisionSurfaceVertToTetRemap; }
80 PX_FORCE_INLINE PxMat33* getGridModelRestPosesFast() {
return mGridModelTetraRestPoses; }
83 float* mGridModelInvMass;
85 PxMat33* mGridModelTetraRestPoses;
86 PxU32* mGridModelOrderedTetrahedrons;
89 PxU32 mGMNbPartitions;
90 PxU32 mGMMaxMaxTetsPerPartitions;
91 PxU32 mGMRemapOutputSize;
92 PxU32* mGMRemapOutputCP;
94 PxU32* mGMAccumulatedPartitionsCP;
95 PxU32* mGMAccumulatedCopiesCP;
97 PxU32* mCollisionAccumulatedTetrahedronsRef;
98 PxU32* mCollisionTetrahedronsReferences;
99 PxU32 mCollisionNbTetrahedronsReferences;
101 PxU8* mCollisionSurfaceVertsHint;
102 PxU32* mCollisionSurfaceVertToTetRemap;
104 PxReal* mVertsBarycentricInGridModel;
105 PxU32* mVertsRemapInGridModel;
108 PxU32* mTetsRemapColToSim;
109 PxU32 mTetsRemapSize;
110 PxU32* mTetsAccumulatedRemapColToSim;
112 PxU32* mGMPullIndices;
114 PxMat33* mTetraRestPoses;
116 PxU32 mNumTetsPerElement;
131 virtual void release() { Cm::RefCountable_decRefCount(*
this); }
132 virtual void onRefCountZero();
141 PX_FORCE_INLINE PxU32 getNbVerticesFast()
const {
return mNbVertices; }
143 PX_FORCE_INLINE PxU32 getNbTetrahedronsFast()
const {
return mNbTetrahedrons; }
144 PX_FORCE_INLINE const void* getTetrahedronsFast()
const {
return mTetrahedrons; }
149 PX_FORCE_INLINE const CenterExtents& getLocalBoundsFast()
const {
return mAABB; }
154 return static_cast<const CenterExtentsPadded&
>(mAABB);
159 PX_ASSERT(mAABB.isValid());
165 PxU32 mNbTetrahedrons;
192 PX_FREE(mGRB_tetraSurfaceHint);
193 PX_FREE(mGRB_faceRemap);
194 PX_FREE(mGRB_faceRemapInverse);
205 PX_FORCE_INLINE void* getGRBTetraFaceRemap() {
return mGRB_faceRemap; }
207 PX_FORCE_INLINE void* getGRBTetraFaceRemapInverse() {
return mGRB_faceRemapInverse; }
220 PxU8* mGRB_tetraSurfaceHint;
221 PxU32* mGRB_faceRemap;
222 PxU32* mGRB_faceRemapInverse;
256 virtual void onRefCountZero();
264 void setMeshFactory(
MeshFactory* factory) { mMeshFactory = factory; }
285 TetrahedronMesh* mSimulationMesh;
286 BVTetrahedronMesh* mCollisionMesh;
287 SoftBodyAuxData* mSoftBodyAuxData;
289 MeshFactory* mMeshFactory;
Definition GuTetrahedronMesh.h:185
PxU32 * mFaceRemap
new faces to old faces mapping (after cleaning, etc). Usage: old = faceRemap[new]
Definition GuTetrahedronMesh.h:216
virtual const PxU32 * getTetrahedraRemap() const
Returns the tetrahedra remapping table.
Definition GuTetrahedronMesh.h:209
Gu::BV32Tree * mGRB_BV32Tree
GRB: BV32 tree.
Definition GuTetrahedronMesh.h:223
void * mGRB_tetraIndices
GRB: GPU-friendly tri indices [uint4].
Definition GuTetrahedronMesh.h:219
Definition GuCenterExtents.h:44
Definition GuMeshData.h:425
Definition GuMeshFactory.h:83
Definition GuTetrahedronMesh.h:54
virtual void release()
Decrements the reference count of a tetrahedron mesh and releases it if the new reference count is ze...
Definition GuTetrahedronMesh.h:64
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition GuTetrahedronMesh.h:60
virtual void acquireReference()
Acquires a counted reference to this object.
Definition GuTetrahedronMesh.h:62
virtual PxU32 getReferenceCount() const
Returns the reference count of the object.
Definition GuTetrahedronMesh.h:63
Definition GuMeshData.h:365
Definition GuMeshData.h:616
Definition GuTetrahedronMesh.h:233
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition GuTetrahedronMesh.h:242
virtual const PxTetrahedronMesh * getCollisionMesh() const
Const accecssor to the softbody's collision mesh.
Definition GuTetrahedronMesh.h:266
virtual void acquireReference()
Acquires a counted reference to this object.
Definition GuTetrahedronMesh.h:254
virtual PxTetrahedronMesh * getSimulationMesh()
Accecssor to the softbody's simulation mesh.
Definition GuTetrahedronMesh.h:273
virtual PxTetrahedronMesh * getCollisionMesh()
Accecssor to the softbody's collision mesh.
Definition GuTetrahedronMesh.h:267
virtual const PxTetrahedronMesh * getSimulationMesh() const
Const accessor to the softbody's simulation mesh.
Definition GuTetrahedronMesh.h:272
virtual PxSoftBodyAuxData * getSoftBodyAuxData()
Accessor to the softbody's auxilary data like mass and rest pose information.
Definition GuTetrahedronMesh.h:279
virtual PxU32 getReferenceCount() const
Returns the reference count of the object.
Definition GuTetrahedronMesh.h:255
virtual const PxSoftBodyAuxData * getSoftBodyAuxData() const
Const accessor to the softbodies simulation state.
Definition GuTetrahedronMesh.h:278
virtual void release()
Decrements the reference count of a tetrahedron mesh and releases it if the new reference count is ze...
Definition GuTetrahedronMesh.cpp:307
Definition GuMeshData.h:502
Definition GuMeshData.h:285
Definition GuTetrahedronMesh.h:120
virtual PxBounds3 getLocalBounds() const
Returns the local-space (vertex space) AABB from the tetrahedron mesh.
Definition GuTetrahedronMesh.h:157
PxU16 * mMaterialIndices
the size of the array is mNbTetrahedrons.
Definition GuTetrahedronMesh.h:170
PxU8 mFlags
Flag whether indices are 16 or 32 bits wide.
Definition GuTetrahedronMesh.h:168
virtual PxTetrahedronMeshFlags getTetrahedronMeshFlags() const
Reads the PxTetrahedronMesh flags.
Definition GuTetrahedronMesh.h:138
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition GuTetrahedronMesh.h:127
virtual const PxVec3 * getVertices() const
Returns the vertices.
Definition GuTetrahedronMesh.h:135
virtual const void * getTetrahedrons() const
Returns the tetrahedron indices.
Definition GuTetrahedronMesh.h:137
virtual void release()
Decrements the reference count of a tetrahedron mesh and releases it if the new reference count is ze...
Definition GuTetrahedronMesh.h:131
virtual PxU32 getNbVertices() const
Returns the number of vertices.
Definition GuTetrahedronMesh.h:134
virtual const PxU32 * getTetrahedraRemap() const
Returns the tetrahedra remapping table.
Definition GuTetrahedronMesh.h:139
virtual void acquireReference()
Acquires a counted reference to this object.
Definition GuTetrahedronMesh.h:129
virtual PxU32 getNbTetrahedrons() const
Returns the number of tetrahedrons.
Definition GuTetrahedronMesh.h:136
virtual PxU32 getReferenceCount() const
Returns the reference count of the object.
Definition GuTetrahedronMesh.h:130
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 centerExtents(const PxVec3 ¢er, const PxVec3 &extent)
returns the AABB from center and extents vectors.
Definition PxBounds3.h:299
Binary deserialization context class.
Definition PxSerialFramework.h:174
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
Callback class used to process PxBase objects.
Definition PxSerialFramework.h:81
Binary serialization context class.
Definition PxSerialFramework.h:99
A data container providing mass, rest pose and other information required for softbody simulation.
Definition PxTetrahedronMesh.h:70
A softbody mesh, containing structures to store collision shape, simulation shape and deformation sta...
Definition PxTetrahedronMesh.h:214
Tetrahedron mesh geometry class.
Definition PxTetrahedronMeshGeometry.h:50
PxTetrahedronMesh * tetrahedronMesh
A reference to the mesh object.
Definition PxTetrahedronMeshGeometry.h:92
A tetramedron mesh, also called a 'tetrahedron soup'.
Definition PxTetrahedronMesh.h:115
Definition PxUserAllocated.h:43
3 Element vector class.
Definition PxVec3.h:50
#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
PxFlags< PxTetrahedronMeshFlag::Enum, PxU8 > PxTetrahedronMeshFlags
collection of set bits defined in PxTetrahedronMeshFlag.
Definition PxTetrahedronMesh.h:58
@ e16_BIT_INDICES
Denotes the use of 16-bit vertex indices.
Definition PxSimpleTriangleMesh.h:66