RavEngine
Loading...
Searching...
No Matches
GuCookingTetrahedronMesh.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
27
#ifndef GU_COOKING_TETRAHEDRON_MESH_H
28
#define GU_COOKING_TETRAHEDRON_MESH_H
29
30
#include "cooking/PxCooking.h"
31
#include "GuMeshData.h"
32
33
namespace
physx
34
{
35
class
TetrahedronMeshBuilder
36
{
37
PX_NOCOPY(
TetrahedronMeshBuilder
)
38
public
:
39
40
static
bool
loadFromDesc(
const
PxTetrahedronMeshDesc
& simulationMeshDesc,
const
PxTetrahedronMeshDesc
& collisionMeshDesc,
41
PxSoftBodySimulationDataDesc
softbodyDataDesc,
Gu::TetrahedronMeshData
& simulationMesh,
Gu::SoftBodySimulationData
& simulationData,
42
Gu::TetrahedronMeshData
& collisionMesh,
Gu::SoftBodyCollisionData
& collisionData,
Gu::CollisionMeshMappingData
& mappingData,
const
PxCookingParams
& params,
bool
validateMesh =
false
);
43
static
bool
saveTetrahedronMeshData(
PxOutputStream
& stream,
bool
platformMismatch,
const
PxCookingParams
& params,
44
const
Gu::TetrahedronMeshData
& mesh);
45
static
bool
saveSoftBodyMeshData(
PxOutputStream
& stream,
bool
platformMismatch,
const
PxCookingParams
& params,
46
const
Gu::TetrahedronMeshData
& simulationMesh,
const
Gu::SoftBodySimulationData
& simulationData,
const
Gu::TetrahedronMeshData
& collisionMesh,
47
const
Gu::SoftBodyCollisionData
& collisionData,
const
Gu::CollisionMeshMappingData
& mappingData);
48
49
//PxMeshMidPhase::Enum getMidphaseID() const { return PxMeshMidPhase::eBVH34; }
50
static
void
createMidPhaseStructure(
Gu::TetrahedronMeshData
& collisionMesh,
Gu::SoftBodyCollisionData
& collisionData,
const
PxCookingParams
& params);
51
static
void
saveMidPhaseStructure(
PxOutputStream
& stream,
bool
mismatch,
const
Gu::SoftBodyCollisionData
& collisionData);
52
53
static
void
computeTetData(
const
PxTetrahedronMeshDesc
& desc,
Gu::TetrahedronMeshData
& mesh);
54
55
static
void
createGRBMidPhaseAndData(
const
PxU32 originalTriangleCount,
Gu::TetrahedronMeshData
& collisionMesh,
Gu::SoftBodyCollisionData
& collisionData,
const
PxCookingParams
& params);
56
static
void
computeSimData(
const
PxTetrahedronMeshDesc
& desc,
Gu::TetrahedronMeshData
& simulationMesh,
Gu::SoftBodySimulationData
& simulationData,
const
PxCookingParams
& params);
57
static
void
computeModelsMapping(
Gu::TetrahedronMeshData
& simulationMesh,
const
Gu::TetrahedronMeshData
& collisionMesh,
const
Gu::SoftBodyCollisionData
& collisionData,
58
Gu::CollisionMeshMappingData
& mappingData,
bool
buildGPUData,
const
PxBoundedData
* vertexToTet);
59
static
void
createCollisionModelMapping(
const
Gu::TetrahedronMeshData
& collisionMesh,
const
Gu::SoftBodyCollisionData
& collisionData,
Gu::CollisionMeshMappingData
& mappingData);
60
61
static
void
recordTetrahedronIndices(
const
Gu::TetrahedronMeshData
& collisionMesh,
Gu::SoftBodyCollisionData
& collisionData,
bool
buildGPUData);
62
static
bool
importMesh(
const
PxTetrahedronMeshDesc
& collisionMeshDesc,
const
PxCookingParams
& params,
63
Gu::TetrahedronMeshData
& collisionMesh,
Gu::SoftBodyCollisionData
& collisionData,
bool
validate =
false
);
64
65
static
bool
computeCollisionData(
const
PxTetrahedronMeshDesc
& collisionMeshDesc,
Gu::TetrahedronMeshData
& collisionMesh,
Gu::SoftBodyCollisionData
& collisionData,
66
const
PxCookingParams
& params,
bool
validateMesh =
false
);
67
};
68
69
class
BV32TetrahedronMeshBuilder
70
{
71
public
:
72
static
void
createMidPhaseStructure(
const
PxCookingParams
& params,
Gu::TetrahedronMeshData
& meshData,
Gu::BV32Tree
& bv32Tree,
Gu::SoftBodyCollisionData
& collisionData);
73
static
void
saveMidPhaseStructure(
Gu::BV32Tree
* tree,
PxOutputStream
& stream,
bool
mismatch);
74
};
75
}
76
77
#endif
physx::BV32TetrahedronMeshBuilder
Definition
GuCookingTetrahedronMesh.h:70
physx::Gu::BV32Tree
Definition
GuBV32.h:121
physx::Gu::CollisionMeshMappingData
Definition
GuMeshData.h:425
physx::Gu::SoftBodyCollisionData
Definition
GuMeshData.h:365
physx::Gu::SoftBodySimulationData
Definition
GuMeshData.h:502
physx::Gu::TetrahedronMeshData
Definition
GuMeshData.h:285
physx::PxOutputStream
Output stream class for I/O.
Definition
PxIO.h:114
physx::PxSoftBodySimulationDataDesc
**
Definition
PxTetrahedronMeshDesc.h:194
physx::PxTetrahedronMeshDesc
Descriptor class for #PxTetrahedronMesh (contains only pure geometric data).
Definition
PxTetrahedronMeshDesc.h:52
physx::TetrahedronMeshBuilder
Definition
GuCookingTetrahedronMesh.h:36
physx
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition
PxBoxController.h:39
physx::PxBoundedData
Definition
PxCoreUtilityTypes.h:96
physx::PxCookingParams
Structure describing parameters affecting mesh cooking.
Definition
PxCooking.h:185
RavEngine
deps
physx
physx
source
geomutils
src
cooking
GuCookingTetrahedronMesh.h
Generated by
1.9.8