RavEngine
Loading...
Searching...
No Matches
PxGeometryHit.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_GEOMETRY_HIT_H
30#define PX_GEOMETRY_HIT_H
34#include "foundation/PxVec3.h"
35#include "foundation/PxFlags.h"
36#include "common/PxPhysXCommonConfig.h"
37
38#if !PX_DOXYGEN
39namespace physx
40{
41#endif
42
57{
82};
83
89PX_FLAGS_TYPEDEF(PxHitFlag, PxU16)
90
91
95{
96 PX_INLINE PxQueryHit() : faceIndex(0xFFFFffff) {}
97
107};
108
116{
117 PX_INLINE PxLocationHit() : flags(0), position(PxVec3(0)), normal(PxVec3(0)), distance(PX_MAX_REAL) {}
118
125 PX_INLINE bool hadInitialOverlap() const { return (distance <= 0.0f); }
126
127 // the following fields are set in accordance with the #PxHitFlags
128 PxHitFlags flags;
131
136 PxF32 distance;
137};
138
151{
152 PX_INLINE PxGeomRaycastHit() : u(0.0f), v(0.0f) {}
153
154 // the following fields are set in accordance with the #PxHitFlags
155
156 PxReal u, v;
157};
158
168
178
183{
185 PX_FORCE_INLINE PxGeomIndexPair(PxU32 _id0, PxU32 _id1) : id0(_id0), id1(_id1) {}
186
187 PxU32 id0, id1;
188};
189
190#if !PX_DOXYGEN
191} // namespace physx
192#endif
193
195#endif
3 Element vector class.
Definition PxVec3.h:50
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#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
Pair of indices, typically either object or triangle indices.
Definition PxGeometryHit.h:183
Stores results of overlap queries.
Definition PxGeometryHit.h:165
Stores results of raycast queries.
Definition PxGeometryHit.h:151
PxReal v
barycentric coordinates of hit point, for triangle mesh and height field (flag: PxHitFlag::eUV)
Definition PxGeometryHit.h:156
Stores results of sweep queries.
Definition PxGeometryHit.h:175
Scene query and geometry query behavior flags.
Definition PxGeometryHit.h:57
Enum
Definition PxGeometryHit.h:59
@ eANY_HIT
Definition PxGeometryHit.h:65
@ eMODIFIABLE_FLAGS
Only this subset of flags can be modified by pre-filter. Other modifications will be discarded.
Definition PxGeometryHit.h:80
@ eNORMAL
"normal" member of #PxQueryHit is valid
Definition PxGeometryHit.h:61
@ eFACE_INDEX
"face index" member of #PxQueryHit is valid
Definition PxGeometryHit.h:75
@ eMESH_BOTH_SIDES
Definition PxGeometryHit.h:69
@ eUV
"u" and "v" barycentric coordinates of #PxQueryHit are valid. Not applicable to sweep queries.
Definition PxGeometryHit.h:62
@ eASSUME_NO_INITIAL_OVERLAP
Definition PxGeometryHit.h:63
@ ePRECISE_SWEEP
Definition PxGeometryHit.h:72
@ ePOSITION
"position" member of #PxQueryHit is valid
Definition PxGeometryHit.h:60
@ eMESH_ANY
Definition PxGeometryHit.h:68
@ eMTD
Report the minimum translation depth, normal and contact point.
Definition PxGeometryHit.h:74
@ eMESH_MULTIPLE
Report all hits for meshes rather than just the first. Not applicable to sweep queries.
Definition PxGeometryHit.h:67
Scene query hit information for raycasts and sweeps returning hit position and normal information.
Definition PxGeometryHit.h:116
PxHitFlags flags
Hit flags specifying which members contain valid values.
Definition PxGeometryHit.h:128
PxF32 distance
Distance to hit.
Definition PxGeometryHit.h:136
PX_INLINE bool hadInitialOverlap() const
Definition PxGeometryHit.h:125
PxVec3 position
World-space hit position (flag: PxHitFlag::ePOSITION)
Definition PxGeometryHit.h:129
PxVec3 normal
World-space hit normal (flag: PxHitFlag::eNORMAL)
Definition PxGeometryHit.h:130
collection of set bits defined in PxHitFlag.
Definition PxGeometryHit.h:95
PxU32 faceIndex
Definition PxGeometryHit.h:106