PxSceneQueryExt.h
Go to the documentation of this file.
1 //
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions
4 // are met:
5 // * Redistributions of source code must retain the above copyright
6 // notice, this list of conditions and the following disclaimer.
7 // * Redistributions in binary form must reproduce the above copyright
8 // notice, this list of conditions and the following disclaimer in the
9 // documentation and/or other materials provided with the distribution.
10 // * Neither the name of NVIDIA CORPORATION nor the names of its
11 // contributors may be used to endorse or promote products derived
12 // from this software without specific prior written permission.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
15 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved.
27 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
28 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
29 
30 
31 #ifndef PX_PHYSICS_EXTENSIONS_SCENE_QUERY_H
32 #define PX_PHYSICS_EXTENSIONS_SCENE_QUERY_H
33 
37 #include "PxPhysXConfig.h"
38 
39 #include "PxScene.h"
40 
41 #if !PX_DOXYGEN
42 namespace physx
43 {
44 #endif
45 
46 // These types have been deprecated (removed) in PhysX 3.4. We typedef them to the new types here for easy migration from 3.3 to 3.4.
52 typedef PxHitFlags PxSceneQueryFlags;
53 
63 {
64 public:
65 
87  static bool raycastAny( const PxScene& scene,
88  const PxVec3& origin, const PxVec3& unitDir, const PxReal distance,
90  PxSceneQueryFilterCallback* filterCall = NULL, const PxSceneQueryCache* cache = NULL);
91 
114  static bool raycastSingle( const PxScene& scene,
115  const PxVec3& origin, const PxVec3& unitDir, const PxReal distance,
116  PxSceneQueryFlags outputFlags, PxRaycastHit& hit,
117  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
118  PxSceneQueryFilterCallback* filterCall = NULL, const PxSceneQueryCache* cache = NULL);
119 
147  static PxI32 raycastMultiple( const PxScene& scene,
148  const PxVec3& origin, const PxVec3& unitDir, const PxReal distance,
149  PxSceneQueryFlags outputFlags,
150  PxRaycastHit* hitBuffer, PxU32 hitBufferSize, bool& blockingHit,
151  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
152  PxSceneQueryFilterCallback* filterCall = NULL, const PxSceneQueryCache* cache = NULL);
153 
178  static bool sweepAny( const PxScene& scene,
179  const PxGeometry& geometry, const PxTransform& pose, const PxVec3& unitDir, const PxReal distance,
180  PxSceneQueryFlags queryFlags,
181  PxSceneQueryHit& hit,
182  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
183  PxSceneQueryFilterCallback* filterCall = NULL,
184  const PxSceneQueryCache* cache = NULL,
185  PxReal inflation = 0.0f);
186 
211  static bool sweepSingle(const PxScene& scene,
212  const PxGeometry& geometry, const PxTransform& pose, const PxVec3& unitDir, const PxReal distance,
213  PxSceneQueryFlags outputFlags,
214  PxSweepHit& hit,
215  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
216  PxSceneQueryFilterCallback* filterCall = NULL,
217  const PxSceneQueryCache* cache = NULL,
218  PxReal inflation=0.0f);
219 
249  static PxI32 sweepMultiple( const PxScene& scene,
250  const PxGeometry& geometry, const PxTransform& pose, const PxVec3& unitDir, const PxReal distance,
251  PxSceneQueryFlags outputFlags, PxSweepHit* hitBuffer, PxU32 hitBufferSize, bool& blockingHit,
252  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
253  PxSceneQueryFilterCallback* filterCall = NULL, const PxSceneQueryCache* cache = NULL,
254  PxReal inflation = 0.0f);
255 
274  static PxI32 overlapMultiple( const PxScene& scene,
275  const PxGeometry& geometry, const PxTransform& pose,
276  PxOverlapHit* hitBuffer, PxU32 hitBufferSize,
277  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
278  PxSceneQueryFilterCallback* filterCall = NULL);
279 
297  static bool overlapAny( const PxScene& scene,
298  const PxGeometry& geometry, const PxTransform& pose,
299  PxOverlapHit& hit,
300  const PxSceneQueryFilterData& filterData = PxSceneQueryFilterData(),
301  PxSceneQueryFilterCallback* filterCall = NULL);
302 };
303 
304 #if !PX_DOXYGEN
305 } // namespace physx
306 #endif
307 
309 #endif
Definition: GuContactBuffer.h:37
A scene is a collection of bodies and constraints which can interact.
Definition: PxScene.h:169
Scene query filtering callbacks.
Definition: PxQueryFiltering.h:169
PxQueryCache PxSceneQueryCache
Definition: PxSceneQueryExt.h:50
float PxReal
Definition: PxSimpleTypes.h:78
utility functions for use with PxScene, related to scene queries.
Definition: PxSceneQueryExt.h:62
Scene query and geometry query behavior flags.
Definition: PxQueryReport.h:62
Scene query filtering data.
Definition: PxQueryFiltering.h:132
A geometry object.
Definition: PxGeometry.h:75
PxHitFlags PxSceneQueryFlags
Definition: PxSceneQueryExt.h:52
single hit cache for scene queries.
Definition: PxScene.h:143
PxHitFlag PxSceneQueryFlag
Definition: PxSceneQueryExt.h:51
PxU8 geometry[sizeof(PxGeometry)]
Definition: PxGeometryHelpers.h:215
PxQueryHit PxSceneQueryHit
Definition: PxSceneQueryExt.h:47
class representing a rigid euclidean transform as a quaternion and a vector
Definition: PxTransform.h:48
Scene query hit information.
Definition: PxQueryReport.h:117
PxQueryFilterCallback PxSceneQueryFilterCallback
Definition: PxSceneQueryExt.h:49
int32_t PxI32
Definition: PxSimpleTypes.h:70
Stores results of overlap queries.
Definition: PxQueryReport.h:192
Stores results of sweep queries.
Definition: PxQueryReport.h:200
Stores results of raycast queries.
Definition: PxQueryReport.h:174
uint32_t PxU32
Definition: Px.h:48
PxQueryFilterData PxSceneQueryFilterData
Definition: PxSceneQueryExt.h:48
3 Element vector class.
Definition: PxVec3.h:49