RavEngine
Loading...
Searching...
No Matches
GuMeshData.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 GU_MESH_DATA_H
30#define GU_MESH_DATA_H
31
32#include "foundation/PxSimpleTypes.h"
33#include "foundation/PxVec4.h"
34#include "foundation/PxBounds3.h"
35#include "geometry/PxTriangleMesh.h"
36#include "geometry/PxTetrahedronMesh.h"
37
38#include "foundation/PxUserAllocated.h"
39#include "foundation/PxAllocator.h"
40#include "GuRTree.h"
41#include "GuBV4.h"
42#include "GuBV32.h"
43#include "GuSDF.h"
44
45namespace physx
46{
47namespace Gu {
48
49// 1: support stackless collision trees for non-recursive collision queries
50// 2: height field functionality not supported anymore
51// 3: mass struct removed
52// 4: bounding sphere removed
53// 5: RTree added, opcode tree still in the binary image, physx 3.0
54// 6: opcode tree removed from binary image
55// 7: convex decomposition is out
56// 8: adjacency information added
57// 9: removed leaf triangles and most of opcode data, changed rtree layout
58// 10: float rtrees
59// 11: new build, isLeaf added to page
60// 12: isLeaf is now the lowest bit in ptrs
61// 13: TA30159 removed deprecated convexEdgeThreshold and bumped version
62// 14: added midphase ID
63// 15: GPU data simplification
64// 16: vertex2Face mapping enabled by default if using GPU
65
66#define PX_MESH_VERSION 16
67#define PX_TET_MESH_VERSION 1
68#define PX_SOFTBODY_MESH_VERSION 2
69
70// these flags are used to indicate/validate the contents of a cooked mesh file
84
85#if PX_VC
86#pragma warning(push)
87#pragma warning(disable: 4324) // Padding was added at the end of a structure because of a __declspec(align) value.
88#endif
89
91 {
92 public:
94 PxU8 mFlags;
95 PxU32 mNbVertices;
96 PxVec3* mVertices;
97
98 PxReal mMass; //this is mass assuming a unit density that can be scaled by instances!
99 PxMat33 mInertia; //in local space of mesh!
100 PxVec3 mLocalCenterOfMass; //local space com
101
102 PxBounds3 mAABB;
103 PxReal mGeomEpsilon;
104
105 PxU32* mFaceRemap;
106
107 // GRB data -------------------------
110 PxU32* mGRB_faceRemapInverse; //
111 // End of GRB data ------------------
112
113 // SDF data
114 SDF mSdfData;
115
116 //Cloth data : each vert has a list of associated triangles in the mesh, this is for attachement constraints to enable default filtering
117 PxU32* mAccumulatedTrianglesRef;//runsum
118 PxU32* mTrianglesReferences;
119 PxU32 mNbTrianglesReferences;
120
121 MeshDataBase() :
122 mFlags (0),
123 mNbVertices (0),
124 mVertices (NULL),
125 mMass (0.f),
126 mInertia (PxZero),
127 mLocalCenterOfMass (0.f),
128 mAABB (PxBounds3::empty()),
129 mGeomEpsilon (0.0f),
130 mFaceRemap (NULL),
131 mGRB_primIndices (NULL),
132 mGRB_faceRemap (NULL),
133 mGRB_faceRemapInverse (NULL),
134 mSdfData (PxZero),
135 mAccumulatedTrianglesRef(NULL),
136 mTrianglesReferences (NULL),
137 mNbTrianglesReferences (0)
138 {
139 }
140
141 virtual ~MeshDataBase()
142 {
143 PX_FREE(mVertices);
144 PX_FREE(mFaceRemap);
145 PX_FREE(mGRB_primIndices);
146 PX_FREE(mGRB_faceRemap);
147 PX_FREE(mGRB_faceRemapInverse);
148
149 PX_FREE(mAccumulatedTrianglesRef);
150
151 PX_FREE(mTrianglesReferences);
152 }
153
154 PX_NOINLINE PxVec3* allocateVertices(PxU32 nbVertices)
155 {
156 PX_ASSERT(!mVertices);
157 // PT: we allocate one more vertex to make sure it's safe to V4Load the last one
158 const PxU32 nbAllocatedVerts = nbVertices + 1;
159 mVertices = PX_ALLOCATE(PxVec3, nbAllocatedVerts, "PxVec3");
160 mNbVertices = nbVertices;
161 return mVertices;
162 }
163
164 PX_FORCE_INLINE bool has16BitIndices() const
165 {
166 return (mFlags & PxTriangleMeshFlag::e16_BIT_INDICES) ? true : false;
167 }
168 };
169
171 {
172 public:
173
174 PxU32 mNbTriangles;
175 void* mTriangles;
176
177 PxU32* mAdjacencies;
178 PxU8* mExtraTrigData;
179 PxU16* mMaterialIndices;
180
181 // GRB data -------------------------
183 Gu::BV32Tree* mGRB_BV32Tree;
184 // End of GRB data ------------------
185
187 mNbTriangles (0),
188 mTriangles (NULL),
189 mAdjacencies (NULL),
190 mExtraTrigData (NULL),
191 mMaterialIndices (NULL),
193 mGRB_BV32Tree (NULL)
194 {
195 }
196
197 virtual ~TriangleMeshData()
198 {
199 PX_FREE(mTriangles);
200 PX_FREE(mAdjacencies);
201 PX_FREE(mMaterialIndices);
202 PX_FREE(mExtraTrigData);
203 PX_FREE(mGRB_primAdjacencies);
204 PX_DELETE(mGRB_BV32Tree);
205 }
206
207 PX_NOINLINE PxU32* allocateAdjacencies()
208 {
209 PX_ASSERT(mNbTriangles);
210 PX_ASSERT(!mAdjacencies);
211 mAdjacencies = PX_ALLOCATE(PxU32, mNbTriangles * 3, "mAdjacencies");
213 return mAdjacencies;
214 }
215
216 PX_NOINLINE PxU32* allocateFaceRemap()
217 {
218 PX_ASSERT(mNbTriangles);
219 PX_ASSERT(!mFaceRemap);
220 mFaceRemap = PX_ALLOCATE(PxU32, mNbTriangles, "mFaceRemap");
221 return mFaceRemap;
222 }
223
224 PX_NOINLINE void* allocateTriangles(PxU32 nbTriangles, bool force32Bit, PxU32 allocateGPUData = 0)
225 {
226 PX_ASSERT(mNbVertices);
227 PX_ASSERT(!mTriangles);
228
229 bool index16 = mNbVertices <= 0xffff && !force32Bit;
230 if(index16)
232
233 mTriangles = PX_ALLOC(nbTriangles * (index16 ? sizeof(PxU16) : sizeof(PxU32)) * 3, "mTriangles");
234 if (allocateGPUData)
235 mGRB_primIndices = PX_ALLOC(nbTriangles * (index16 ? sizeof(PxU16) : sizeof(PxU32)) * 3, "mGRB_triIndices");
236 mNbTriangles = nbTriangles;
237 return mTriangles;
238 }
239
240 PX_NOINLINE PxU16* allocateMaterials()
241 {
242 PX_ASSERT(mNbTriangles);
243 PX_ASSERT(!mMaterialIndices);
244 mMaterialIndices = PX_ALLOCATE(PxU16, mNbTriangles, "mMaterialIndices");
245 return mMaterialIndices;
246 }
247
248 PX_NOINLINE PxU8* allocateExtraTrigData()
249 {
250 PX_ASSERT(mNbTriangles);
251 PX_ASSERT(!mExtraTrigData);
252 mExtraTrigData = PX_ALLOCATE(PxU8, mNbTriangles, "mExtraTrigData");
253 return mExtraTrigData;
254 }
255
256 PX_FORCE_INLINE void setTriangleAdjacency(PxU32 triangleIndex, PxU32 adjacency, PxU32 offset)
257 {
258 PX_ASSERT(mAdjacencies);
259 mAdjacencies[triangleIndex*3 + offset] = adjacency;
260 }
261 };
262
264 {
265 public:
267 virtual ~RTreeTriangleData() {}
268
269 Gu::RTree mRTree;
270 };
271
273 {
274 public:
276 virtual ~BV4TriangleData() {}
277
278 Gu::SourceMesh mMeshInterface;
279 Gu::BV4Tree mBV4Tree;
280 };
281
282 // PT: TODO: the following classes should probably be in their own specific files (e.g. GuTetrahedronMeshData.h, GuSoftBodyMeshData.h)
283
285 {
286 public:
287 PxU32 mNbVertices;
288 PxVec3* mVertices;
289 PxU16* mMaterialIndices; //each tetrahedron should have a material index
290
291 PxU32 mNbTetrahedrons;
292 void* mTetrahedrons; //IndTetrahedron32
293
294 PxU8 mFlags;
295
296 PxReal mGeomEpsilon;
297 PxBounds3 mAABB;
298
300 mNbVertices(0),
301 mVertices(NULL),
302 mMaterialIndices(NULL),
303 mNbTetrahedrons(0),
304 mTetrahedrons(NULL),
305 mFlags(0),
306 mGeomEpsilon(0.0f),
307 mAABB(PxBounds3::empty())
308 {}
309
310 TetrahedronMeshData(PxVec3* vertices, PxU32 nbVertices, void* tetrahedrons, PxU32 nbTetrahedrons, PxU8 flags, PxReal geomEpsilon, PxBounds3 aabb) :
311 mNbVertices(nbVertices),
312 mVertices(vertices),
313 mNbTetrahedrons(nbTetrahedrons),
314 mTetrahedrons(tetrahedrons),
315 mFlags(flags),
316 mGeomEpsilon(geomEpsilon),
317 mAABB(aabb)
318 {}
319
320 void allocateTetrahedrons(const PxU32 nbGridTetrahedrons, const PxU32 allocateGPUData = 0)
321 {
322 if (allocateGPUData)
323 {
324 mTetrahedrons = PX_ALLOC(nbGridTetrahedrons * sizeof(PxU32) * 4, "mGridModelTetrahedrons");
325 }
326
327 mNbTetrahedrons = nbGridTetrahedrons;
328 }
329
330 PxVec3* allocateVertices(PxU32 nbVertices, const PxU32 allocateGPUData = 1)
331 {
332 PX_ASSERT(!mVertices);
333 // PT: we allocate one more vertex to make sure it's safe to V4Load the last one
334 if (allocateGPUData)
335 {
336 const PxU32 nbAllocatedVerts = nbVertices + 1;
337 mVertices = PX_ALLOCATE(PxVec3, nbAllocatedVerts, "PxVec3");
338 }
339 mNbVertices = nbVertices;
340 return mVertices;
341 }
342
343 PxU16* allocateMaterials()
344 {
345 PX_ASSERT(mNbTetrahedrons);
346 PX_ASSERT(!mMaterialIndices);
347 mMaterialIndices = PX_ALLOCATE(PxU16, mNbTetrahedrons, "mMaterialIndices");
348 return mMaterialIndices;
349 }
350
351 PX_FORCE_INLINE bool has16BitIndices() const
352 {
353 return (mFlags & PxTriangleMeshFlag::e16_BIT_INDICES) ? true : false;
354 }
355
357 {
358 PX_FREE(mTetrahedrons);
359 PX_FREE(mVertices);
360 PX_FREE(mMaterialIndices)
361 }
362 };
363
365 {
366 public:
367 PxU32* mFaceRemap;
368
369 // GRB data -------------------------
372 PxU32* mGRB_faceRemapInverse;
373 Gu::BV32Tree* mGRB_BV32Tree;
374 PxU8* mGRB_tetraSurfaceHint;
375
376
377 // End of GRB data ------------------
378 Gu::TetrahedronSourceMesh mMeshInterface;
379 Gu::BV4Tree mBV4Tree;
380
381 PxMat33* mTetraRestPoses;
382
383
385 mFaceRemap(NULL),
386 mGRB_primIndices(NULL),
387 mGRB_faceRemap(NULL),
388 mGRB_faceRemapInverse(NULL),
389 mGRB_BV32Tree(NULL),
390 mGRB_tetraSurfaceHint(NULL),
391 mTetraRestPoses(NULL)
392 {}
393
394 virtual ~SoftBodyCollisionData()
395 {
396 PX_FREE(mGRB_tetraSurfaceHint);
397 PX_DELETE(mGRB_BV32Tree);
398 PX_FREE(mFaceRemap);
399 PX_FREE(mGRB_primIndices);
400 PX_FREE(mGRB_faceRemap);
401 PX_FREE(mGRB_faceRemapInverse);
402 PX_FREE(mTetraRestPoses);
403 }
404
405 PxU32* allocateFaceRemap(PxU32 nbTetrahedrons)
406 {
407 PX_ASSERT(nbTetrahedrons);
408 PX_ASSERT(!mFaceRemap);
409 mFaceRemap = PX_ALLOCATE(PxU32, nbTetrahedrons, "mFaceRemap");
410 return mFaceRemap;
411 }
412
413 void allocateCollisionData(PxU32 nbTetrahedrons)
414 {
415 mGRB_primIndices = PX_ALLOC(nbTetrahedrons * 4 * sizeof(PxU32), "mGRB_primIndices");
416 mGRB_tetraSurfaceHint = PX_ALLOCATE(PxU8, nbTetrahedrons, "mGRB_tetraSurfaceHint");
417
418 mTetraRestPoses = PX_ALLOCATE(PxMat33, nbTetrahedrons, "mTetraRestPoses");
419
420
421 }
422 };
423
425 {
426 public:
427 PxReal* mVertsBarycentricInGridModel;
428 PxU32* mVertsRemapInGridModel;
429
430 PxU32* mTetsRemapColToSim;
431 PxU32 mTetsRemapSize;
432 PxU32* mTetsAccumulatedRemapColToSim; //runsum, size of number of tetrahedrons in collision mesh
433
434 //in the collision model, each vert has a list of associated simulation tetrahedrons, this is for attachement constraints to enable default filtering
435 PxU32* mCollisionAccumulatedTetrahedronsRef;//runsum
436 PxU32* mCollisionTetrahedronsReferences;
437 PxU32 mCollisionNbTetrahedronsReferences;
438
439 PxU32* mCollisionSurfaceVertToTetRemap;
440 PxU8* mCollisionSurfaceVertsHint;
441
443 mVertsBarycentricInGridModel(NULL),
444 mVertsRemapInGridModel(NULL),
445 mTetsRemapColToSim(NULL),
446 mTetsRemapSize(0),
447 mTetsAccumulatedRemapColToSim(NULL),
448 mCollisionAccumulatedTetrahedronsRef(NULL),
449 mCollisionTetrahedronsReferences(NULL),
450 mCollisionNbTetrahedronsReferences(0),
451 mCollisionSurfaceVertToTetRemap(NULL),
452 mCollisionSurfaceVertsHint(NULL)
453 {
454
455 }
456
458 {
459 PX_FREE(mVertsBarycentricInGridModel);
460 PX_FREE(mVertsRemapInGridModel);
461 PX_FREE(mTetsRemapColToSim);
462 PX_FREE(mTetsAccumulatedRemapColToSim);
463 PX_FREE(mCollisionAccumulatedTetrahedronsRef);
464 PX_FREE(mCollisionTetrahedronsReferences);
465 PX_FREE(mCollisionSurfaceVertsHint);
466 PX_FREE(mCollisionSurfaceVertToTetRemap);
467 }
468
469 void allocatemappingData(const PxU32 nbVerts, const PxU32 tetRemapSize, const PxU32 nbColTetrahedrons, const PxU32 allocateGPUData = 0)
470 {
471 if (allocateGPUData)
472 {
473 mVertsBarycentricInGridModel = reinterpret_cast<PxReal*>(PX_ALLOC(nbVerts * sizeof(PxReal) * 4, "mVertsBarycentricInGridModel"));
474 mVertsRemapInGridModel = reinterpret_cast<PxU32*>(PX_ALLOC(nbVerts * sizeof(PxU32), "mVertsRemapInGridModel"));
475 mTetsRemapColToSim = reinterpret_cast<PxU32*>(PX_ALLOC(tetRemapSize * sizeof(PxU32), "mTetsRemapInSimModel"));
476 mTetsAccumulatedRemapColToSim = reinterpret_cast<PxU32*>(PX_ALLOC(nbColTetrahedrons * sizeof(PxU32), "mTetsAccumulatedRemapInSimModel"));
477 mCollisionSurfaceVertsHint = reinterpret_cast<PxU8*>(PX_ALLOC(nbVerts * sizeof(PxU8), "mCollisionSurfaceVertsHint"));
478 mCollisionSurfaceVertToTetRemap = reinterpret_cast<PxU32*>(PX_ALLOC(nbVerts * sizeof(PxU32), "mCollisionSurfaceVertToTetRemap"));
479 }
480 mTetsRemapSize = tetRemapSize;
481 }
482
483 void allocateTetRefData(const PxU32 totalTetReference, const PxU32 nbCollisionVerts, const PxU32 allocateGPUData /*= 0*/)
484 {
485 if (allocateGPUData)
486 {
487 mCollisionAccumulatedTetrahedronsRef = reinterpret_cast<PxU32*>(PX_ALLOC(nbCollisionVerts * sizeof(PxU32), "mGMAccumulatedTetrahedronsRef"));
488 mCollisionTetrahedronsReferences = reinterpret_cast<PxU32*>(PX_ALLOC(totalTetReference * sizeof(PxU32), "mGMTetrahedronsReferences"));
489
490 }
491
492 mCollisionNbTetrahedronsReferences = totalTetReference;
493 }
494
495 virtual void release()
496 {
497 PX_DELETE_THIS;
498 }
499 };
500
502 {
503 public:
504 PxReal* mGridModelInvMass;
505
506 PxMat33* mGridModelTetraRestPoses;
507
508 PxU32 mGridModelNbPartitions;
509 PxU32 mGridModelMaxTetsPerPartitions;
510
511 PxU32* mGridModelOrderedTetrahedrons; // the corresponding tetrahedron index for the runsum
512
513 PxU32* mGMRemapOutputCP;
514 PxU32* mGMAccumulatedPartitionsCP; //runsum for the combined partition
515 PxU32* mGMAccumulatedCopiesCP; //runsum for the vert copies in combined partitions
516
517 PxU32 mGMRemapOutputSize;
518
519 PxU32* mGMPullIndices;
520
521 PxU32 mNumTetsPerElement;
522
524 mGridModelInvMass(NULL),
525 mGridModelTetraRestPoses(NULL),
526 mGridModelNbPartitions(0),
527 mGridModelOrderedTetrahedrons(NULL),
528 mGMRemapOutputCP(NULL),
529 mGMAccumulatedPartitionsCP(NULL),
530 mGMAccumulatedCopiesCP(NULL),
531 mGMRemapOutputSize(0),
532 mGMPullIndices(NULL)
533 {}
534
536 {
537 PX_FREE(mGridModelInvMass);
538 PX_FREE(mGridModelTetraRestPoses);
539 PX_FREE(mGridModelOrderedTetrahedrons);
540 PX_FREE(mGMRemapOutputCP);
541 PX_FREE(mGMAccumulatedPartitionsCP);
542 PX_FREE(mGMAccumulatedCopiesCP);
543 PX_FREE(mGMPullIndices);
544 }
545
546 void allocateGridModelData(const PxU32 nbGridTetrahedrons, const PxU32 nbGridVerts,
547 const PxU32 nbVerts, const PxU32 nbPartitions, const PxU32 remapOutputSize, const PxU32 numTetsPerElement, const PxU32 allocateGPUData = 0)
548 {
549 PX_UNUSED(nbVerts);
550
551 if (allocateGPUData)
552 {
553 const PxU32 numElements = nbGridTetrahedrons / numTetsPerElement;
554 const PxU32 numVertsPerElement = numTetsPerElement == 6 ? 8 : 4;
555
556 mGridModelInvMass = reinterpret_cast<float*>(PX_ALLOC(nbGridVerts * sizeof(float), "mGridModelInvMass"));
557 mGridModelTetraRestPoses = reinterpret_cast<PxMat33*>(PX_ALLOC(nbGridTetrahedrons * sizeof(PxMat33), "mGridModelTetraRestPoses"));
558
559 mGridModelOrderedTetrahedrons = reinterpret_cast<PxU32*>(PX_ALLOC(numElements * sizeof(PxU32), "mGridModelOrderedTetrahedrons"));
560 mGMRemapOutputCP = reinterpret_cast<PxU32*>(PX_ALLOC(remapOutputSize * sizeof(PxU32), "mGMRemapOutputCP"));
561 mGMAccumulatedPartitionsCP = reinterpret_cast<PxU32*>(PX_ALLOC(nbPartitions * sizeof(PxU32), "mGMAccumulatedPartitionsCP"));
562 mGMAccumulatedCopiesCP = reinterpret_cast<PxU32*>(PX_ALLOC(nbGridVerts * sizeof(PxU32), "mGMAccumulatedCopiesCP"));
563 mGMPullIndices = reinterpret_cast<PxU32*>(PX_ALLOC(numElements * numVertsPerElement * sizeof(PxU32) , "mGMPullIndices"));
564 }
565
566 mGridModelNbPartitions = nbPartitions;
567 mGMRemapOutputSize = remapOutputSize;
568 }
569 };
570
572 {
573 public:
574 TetrahedronMeshData* mMesh;
575 SoftBodyCollisionData* mCollisionData;
576
577 virtual PxTetrahedronMeshData* getMesh() { return mMesh; }
578 virtual const PxTetrahedronMeshData* getMesh() const { return mMesh; }
579 virtual PxSoftBodyCollisionData* getData() { return mCollisionData; }
580 virtual const PxSoftBodyCollisionData* getData() const { return mCollisionData; }
581
583 {
584 PX_FREE(mMesh);
585 PX_FREE(mCollisionData);
586 }
587
588 virtual void release()
589 {
590 PX_DELETE_THIS;
591 }
592 };
593
595 {
596 public:
597 TetrahedronMeshData* mMesh;
598 SoftBodySimulationData* mSimulationData;
599
600 virtual PxTetrahedronMeshData* getMesh() { return mMesh; }
601 virtual PxSoftBodySimulationData* getData() { return mSimulationData; }
602
604 {
605 PX_FREE(mMesh);
606 PX_FREE(mSimulationData);
607 }
608
609 virtual void release()
610 {
611 PX_DELETE_THIS;
612 }
613 };
614
616 {
617 PX_NOCOPY(SoftBodyMeshData)
618 public:
619 TetrahedronMeshData& mSimulationMesh;
620 SoftBodySimulationData& mSimulationData;
621 TetrahedronMeshData& mCollisionMesh;
622 SoftBodyCollisionData& mCollisionData;
623 CollisionMeshMappingData& mMappingData;
624
625 SoftBodyMeshData(TetrahedronMeshData& simulationMesh, SoftBodySimulationData& simulationData,
626 TetrahedronMeshData& collisionMesh, SoftBodyCollisionData& collisionData, CollisionMeshMappingData& mappingData) :
627 mSimulationMesh(simulationMesh),
628 mSimulationData(simulationData),
629 mCollisionMesh(collisionMesh),
630 mCollisionData(collisionData),
631 mMappingData(mappingData)
632 { }
633 };
634
635#if PX_VC
636#pragma warning(pop)
637#endif
638
639
640} // namespace Gu
641
642}
643
644#endif // #ifdef GU_MESH_DATA_H
Definition GuBV32.h:121
Definition GuBV4.h:341
Definition GuMeshData.h:273
Definition GuMeshData.h:425
Definition GuMeshData.h:572
Definition GuMeshData.h:91
void * mGRB_primIndices
GRB: GPU-friendly primitive indices(either triangle or tetrahedron)
Definition GuMeshData.h:108
PxU32 * mGRB_faceRemap
GRB: this remap the GPU triangle indices to CPU triangle indices.
Definition GuMeshData.h:109
Definition GuMeshData.h:264
Represents a signed distance field.
Definition GuSDF.h:88
Definition GuMeshData.h:595
Definition GuMeshData.h:365
void * mGRB_primIndices
GRB: GPU-friendly primitive indices(either triangle or tetrahedron)
Definition GuMeshData.h:370
PxU32 * mGRB_faceRemap
GRB: this remap the GPU triangle indices to CPU triangle indices.
Definition GuMeshData.h:371
Definition GuMeshData.h:616
Definition GuMeshData.h:502
Definition GuBV4.h:181
Definition GuMeshData.h:285
Definition GuBV4.h:230
Definition GuMeshData.h:171
void * mGRB_primAdjacencies
GRB: adjacency data, with BOUNDARY and NONCONVEX flags (flags replace adj indices where applicable) [...
Definition GuMeshData.h:182
Class representing 3D range or axis aligned bounding box.
Definition PxBounds3.h:58
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 empty()
Return empty bounds.
Definition PxBounds3.h:284
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
3x3 matrix class
Definition PxMat33.h:91
Conbines PxTetrahedronMeshData and PxSoftBodyCollisionData.
Definition PxTetrahedronMesh.h:348
Stores data to accelerate collision detection of a tetrahedral mesh.
Definition PxTetrahedronMesh.h:297
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
Definition PxUserAllocated.h:43
3 Element vector class.
Definition PxVec3.h:50
#define PX_NOINLINE
Definition PxPreprocessor.h:346
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
InternalMeshSerialFlag
Definition GuMeshData.h:72
@ IMSF_VERT_MAPPING
if set, the cooked mesh file contains vertex mapping information
Definition GuMeshData.h:80
@ IMSF_INERTIA
if set, the cooked mesh file contains inertia tensor for the mesh
Definition GuMeshData.h:82
@ IMSF_8BIT_INDICES
if set, the cooked mesh file contains 8bit indices (topology)
Definition GuMeshData.h:75
@ IMSF_FACE_REMAP
if set, the cooked mesh file contains a remap table
Definition GuMeshData.h:74
@ IMSF_SDF
if set, the cooked mesh file contains SDF data structures
Definition GuMeshData.h:79
@ IMSF_ADJACENCIES
if set, the cooked mesh file contains adjacency structures
Definition GuMeshData.h:77
@ IMSF_MATERIALS
if set, the cooked mesh file contains per-triangle material indices
Definition GuMeshData.h:73
@ IMSF_16BIT_INDICES
if set, the cooked mesh file contains 16bit indices (topology)
Definition GuMeshData.h:76
@ IMSF_GRB_DATA
if set, the cooked mesh file contains GRB data structures
Definition GuMeshData.h:78
@ IMSF_GRB_INV_REMAP
if set, the cooked mesh file contains vertex inv mapping information. Required for cloth
Definition GuMeshData.h:81
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Definition GuRTree.h:119
Enum
Definition PxTriangleMesh.h:58
@ eBVH33
Default midphase mesh structure, as used up to PhysX 3.3 (deprecated)
Definition PxTriangleMesh.h:59
@ eBVH34
New midphase mesh structure, introduced in PhysX 3.4.
Definition PxTriangleMesh.h:60
@ eADJACENCY_INFO
The triangle mesh has adjacency information build.
Definition PxTriangleMesh.h:76
@ e16_BIT_INDICES
The triangle mesh has 16bits vertex indices.
Definition PxTriangleMesh.h:75