RavEngine
Loading...
Searching...
No Matches
PxTetrahedronMesh.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef PX_TETRAHEDRON_MESH_H
30#define PX_TETRAHEDRON_MESH_H
34#include "foundation/PxVec3.h"
35#include "foundation/PxBounds3.h"
36#include "foundation/PxUserAllocated.h"
37#include "common/PxPhysXCommonConfig.h"
38#include "common/PxBase.h"
39
40#if !PX_DOXYGEN
41namespace physx
42{
43#endif
44
46 {
47 enum Enum
48 {
49 e16_BIT_INDICES = (1 << 1)
50 };
51 };
52
59 PX_FLAGS_OPERATORS(PxTetrahedronMeshFlag::Enum, PxU8)
60
61
62
70 {
71 public:
77 virtual void release() = 0;
78
79 protected:
80 PX_INLINE PxSoftBodyAuxData(PxType concreteType, PxBaseFlags baseFlags) : PxRefCounted(concreteType, baseFlags) {}
81 PX_INLINE PxSoftBodyAuxData(PxBaseFlags baseFlags) : PxRefCounted(baseFlags) {}
82 virtual ~PxSoftBodyAuxData() {}
83
84 virtual bool isKindOf(const char* name) const { return !::strcmp("PxSoftBodyAuxData", name) || PxRefCounted::isKindOf(name); }
85 };
86
115 {
116 public:
122 virtual PxU32 getNbVertices() const = 0;
123
129 virtual const PxVec3* getVertices() const = 0;
130
131
137 virtual PxU32 getNbTetrahedrons() const = 0;
138
150 virtual const void* getTetrahedrons() const = 0;
151
160
161
174 virtual const PxU32* getTetrahedraRemap() const = 0;
175
181 virtual PxBounds3 getLocalBounds() const = 0;
182
188 virtual void release() = 0;
189
190 protected:
191 PX_INLINE PxTetrahedronMesh(PxType concreteType, PxBaseFlags baseFlags) : PxRefCounted(concreteType, baseFlags) {}
192 PX_INLINE PxTetrahedronMesh(PxBaseFlags baseFlags) : PxRefCounted(baseFlags) {}
193 virtual ~PxTetrahedronMesh() {}
194
195 virtual bool isKindOf(const char* name) const { return !::strcmp("PxTetrahedronMesh", name) || PxRefCounted::isKindOf(name); }
196 };
197
214 {
215 public:
221 virtual const PxTetrahedronMesh* getCollisionMesh() const = 0;
222
229
235 virtual const PxTetrahedronMesh* getSimulationMesh() const = 0;
236
243
244
250 virtual const PxSoftBodyAuxData* getSoftBodyAuxData() const = 0;
251
258
264 virtual void release() = 0;
265
266
267 protected:
268 PX_INLINE PxSoftBodyMesh(PxType concreteType, PxBaseFlags baseFlags) : PxRefCounted(concreteType, baseFlags) {}
269 PX_INLINE PxSoftBodyMesh(PxBaseFlags baseFlags) : PxRefCounted(baseFlags) {}
270 virtual ~PxSoftBodyMesh() {}
271
272 virtual bool isKindOf(const char* name) const { return !::strcmp("PxSoftBodyMesh", name) || PxRefCounted::isKindOf(name); }
273 };
274
275
283 {
284 public:
285 virtual void release() = 0;
286
287 virtual ~PxCollisionMeshMappingData() {}
288 };
289
297 {
298
299 };
300
308 {
309
310 };
311
319 {
320
321 };
322
330 {
331 public:
332 virtual const PxTetrahedronMeshData* getMesh() const = 0;
333 virtual PxTetrahedronMeshData* getMesh() = 0;
334 virtual const PxSoftBodyCollisionData* getData() const = 0;
335 virtual PxSoftBodyCollisionData* getData() = 0;
336 virtual void release() = 0;
337
339 };
340
348 {
349 public:
350 virtual PxTetrahedronMeshData* getMesh() = 0;
351 virtual PxSoftBodySimulationData* getData() = 0;
352 virtual void release() = 0;
353
355 };
356
357#if !PX_DOXYGEN
358} // namespace physx
359#endif
360
362#endif
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
Contains information about how to update the collision mesh's vertices given a deformed simulation te...
Definition PxTetrahedronMesh.h:283
Conbines PxTetrahedronMeshData and PxSoftBodyCollisionData.
Definition PxTetrahedronMesh.h:330
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
Base class for ref-counted objects.
Definition PxBase.h:200
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxBase.h:231
Conbines PxTetrahedronMeshData and PxSoftBodyCollisionData.
Definition PxTetrahedronMesh.h:348
A data container providing mass, rest pose and other information required for softbody simulation.
Definition PxTetrahedronMesh.h:70
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxTetrahedronMesh.h:84
virtual void release()=0
Decrements the reference count of a tetrahedron mesh and releases it if the new reference count is ze...
Stores data to accelerate collision detection of a tetrahedral mesh.
Definition PxTetrahedronMesh.h:297
A softbody mesh, containing structures to store collision shape, simulation shape and deformation sta...
Definition PxTetrahedronMesh.h:214
virtual PxTetrahedronMesh * getSimulationMesh()=0
Accecssor to the softbody's simulation mesh.
virtual const PxSoftBodyAuxData * getSoftBodyAuxData() const =0
Const accessor to the softbodies simulation state.
virtual const PxTetrahedronMesh * getCollisionMesh() const =0
Const accecssor to the softbody's collision mesh.
virtual PxTetrahedronMesh * getCollisionMesh()=0
Accecssor to the softbody's collision mesh.
virtual void release()=0
Decrements the reference count of a tetrahedron mesh and releases it if the new reference count is ze...
virtual PxSoftBodyAuxData * getSoftBodyAuxData()=0
Accessor to the softbody's auxilary data like mass and rest pose information.
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxTetrahedronMesh.h:272
virtual const PxTetrahedronMesh * getSimulationMesh() const =0
Const accessor to the softbody's simulation mesh.
Stores data to compute and store the state of a deformed tetrahedral mesh.
Definition PxTetrahedronMesh.h:319
Contains raw geometry information describing the tetmesh's vertices and its elements (tetrahedra)
Definition PxTetrahedronMesh.h:308
A tetramedron mesh, also called a 'tetrahedron soup'.
Definition PxTetrahedronMesh.h:115
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxTetrahedronMesh.h:195
virtual void release()=0
Decrements the reference count of a tetrahedron mesh and releases it if the new reference count is ze...
virtual const PxU32 * getTetrahedraRemap() const =0
Returns the tetrahedra remapping table.
virtual const PxVec3 * getVertices() const =0
Returns the vertices.
virtual PxU32 getNbTetrahedrons() const =0
Returns the number of tetrahedrons.
virtual PxTetrahedronMeshFlags getTetrahedronMeshFlags() const =0
Reads the PxTetrahedronMesh flags.
virtual PxBounds3 getLocalBounds() const =0
Returns the local-space (vertex space) AABB from the tetrahedron mesh.
virtual PxU32 getNbVertices() const =0
Returns the number of vertices.
virtual const void * getTetrahedrons() const =0
Returns the tetrahedron indices.
Definition PxUserAllocated.h:43
3 Element vector class.
Definition PxVec3.h:50
#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
PxFlags< PxTetrahedronMeshFlag::Enum, PxU8 > PxTetrahedronMeshFlags
collection of set bits defined in PxTetrahedronMeshFlag.
Definition PxTetrahedronMesh.h:58
Definition PxTetrahedronMesh.h:46
Enum
Definition PxTetrahedronMesh.h:48
@ e16_BIT_INDICES
The tetrahedron mesh has 16bits vertex indices.
Definition PxTetrahedronMesh.h:49