RavEngine
Loading...
Searching...
No Matches
PxMeshQuery.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_MESH_QUERY_H
30#define PX_MESH_QUERY_H
31
36#include "common/PxPhysXCommonConfig.h"
37#include "geometry/PxGeometryHit.h"
38#include "geometry/PxGeometryQueryFlags.h"
39#include "geometry/PxReportCallback.h"
40
41#if !PX_DOXYGEN
42namespace physx
43{
44#endif
45
46class PxGeometry;
47class PxConvexMeshGeometry;
48class PxTriangleMeshGeometry;
49class PxHeightFieldGeometry;
50
51class PxTriangle;
52
54 {
55 enum Enum
56 {
58 eDISCARD_COPLANAR = (1<<0)
59 };
60 };
61
62 PX_FLAGS_TYPEDEF(PxMeshMeshQueryFlag, PxU32)
63
65{
66public:
67
84 PX_PHYSX_COMMON_API static void getTriangle(const PxTriangleMeshGeometry& triGeom, const PxTransform& transform, PxTriangleID triangleIndex, PxTriangle& triangle, PxU32* vertexIndices=NULL, PxU32* adjacencyIndices=NULL);
85
86
115 PX_PHYSX_COMMON_API static void getTriangle(const PxHeightFieldGeometry& hfGeom, const PxTransform& transform, PxTriangleID triangleIndex, PxTriangle& triangle, PxU32* vertexIndices=NULL, PxU32* adjacencyIndices=NULL);
116
117
138 PX_PHYSX_COMMON_API static PxU32 findOverlapTriangleMesh( const PxGeometry& geom, const PxTransform& geomPose,
139 const PxTriangleMeshGeometry& meshGeom, const PxTransform& meshPose,
140 PxU32* results, PxU32 maxResults, PxU32 startIndex, bool& overflow,
141 PxGeometryQueryFlags queryFlags = PxGeometryQueryFlag::eDEFAULT);
142
165 PX_PHYSX_COMMON_API static bool findOverlapTriangleMesh(PxReportCallback<PxGeomIndexPair>& callback,
166 const PxTriangleMeshGeometry& meshGeom0, const PxTransform& meshPose0,
167 const PxTriangleMeshGeometry& meshGeom1, const PxTransform& meshPose1,
168 PxGeometryQueryFlags queryFlags = PxGeometryQueryFlag::eDEFAULT,
169 PxMeshMeshQueryFlags meshMeshFlags = PxMeshMeshQueryFlag::eDEFAULT);
170
189 PX_PHYSX_COMMON_API static PxU32 findOverlapHeightField(const PxGeometry& geom, const PxTransform& geomPose,
190 const PxHeightFieldGeometry& hfGeom, const PxTransform& hfPose,
191 PxU32* results, PxU32 maxResults, PxU32 startIndex, bool& overflow,
192 PxGeometryQueryFlags queryFlags = PxGeometryQueryFlag::eDEFAULT);
193
194
227 PX_PHYSX_COMMON_API static bool sweep(const PxVec3& unitDir,
228 const PxReal distance,
229 const PxGeometry& geom,
230 const PxTransform& pose,
231 PxU32 triangleCount,
232 const PxTriangle* triangles,
233 PxGeomSweepHit& sweepHit,
234 PxHitFlags hitFlags = PxHitFlag::eDEFAULT,
235 const PxU32* cachedIndex = NULL,
236 const PxReal inflation = 0.0f,
237 bool doubleSided = false,
238 PxGeometryQueryFlags queryFlags = PxGeometryQueryFlag::eDEFAULT);
239};
240
241
242#if !PX_DOXYGEN
243}
244#endif
245
247#endif
A geometry object.
Definition PxGeometry.h:79
Height field geometry class.
Definition PxHeightFieldGeometry.h:55
Definition PxMeshQuery.h:65
Base class for callback reporting an unknown number of items to users.
Definition PxReportCallback.h:60
class representing a rigid euclidean transform as a quaternion and a vector
Definition PxTransform.h:49
Triangle mesh geometry class.
Definition PxTriangleMeshGeometry.h:81
Triangle class.
Definition PxTriangle.h:47
3 Element vector class.
Definition PxVec3.h:50
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Stores results of sweep queries.
Definition PxGeometryHit.h:175
Definition PxMeshQuery.h:54
Enum
Definition PxMeshQuery.h:56
@ eDEFAULT
Report all overlaps.
Definition PxMeshQuery.h:57
@ eDISCARD_COPLANAR
Ignore coplanar triangle-triangle overlaps.
Definition PxMeshQuery.h:58