RavEngine
Loading...
Searching...
No Matches
PxQueryFiltering.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_QUERY_FILTERING_H
30#define PX_QUERY_FILTERING_H
35#include "PxPhysXConfig.h"
36#include "PxFiltering.h"
37#include "PxQueryReport.h"
38#include "PxClient.h"
39
40#if !PX_DOXYGEN
41namespace physx
42{
43#endif
44
45class PxShape;
46class PxRigidActor;
47struct PxQueryHit;
48
55{
56 enum Enum
57 {
58 eSTATIC = (1<<0),
59
60 eDYNAMIC = (1<<1),
61
62 ePREFILTER = (1<<2),
63
64 ePOSTFILTER = (1<<3),
65
66 eANY_HIT = (1<<4),
68
69 eNO_BLOCK = (1<<5),
71
75
78
79 eRESERVED = (1<<15)
80 };
81};
85
91PX_FLAGS_OPERATORS(PxQueryFlag::Enum,PxU16)
92
93
114{
115 enum Enum
116 {
117 eNONE = 0,
118 eTOUCH = 1,
119 eBLOCK = 2
120 };
121};
122
151
175{
176public:
177
188 const PxFilterData& filterData, const PxShape* shape, const PxRigidActor* actor, PxHitFlags& queryFlags) = 0;
189
199 {
200 PX_UNUSED(filterData);
201 PX_UNUSED(hit);
203 }
204
214 virtual PxQueryHitType::Enum postFilter(const PxFilterData& filterData, const PxQueryHit& hit, const PxShape* shape, const PxRigidActor* actor)
215 {
216 PX_UNUSED(shape);
217 PX_UNUSED(actor);
218 return postFilter(filterData, hit);
219 }
220
225};
226
227
228#if !PX_DOXYGEN
229} // namespace physx
230#endif
231
233#endif
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
Scene query filtering callbacks.
Definition PxQueryFiltering.h:175
virtual PxQueryHitType::Enum postFilter(const PxFilterData &filterData, const PxQueryHit &hit, const PxShape *shape, const PxRigidActor *actor)
This filter callback is executed if the exact intersection test returned true and PxQueryFlag::ePOSTF...
Definition PxQueryFiltering.h:214
virtual PxQueryHitType::Enum preFilter(const PxFilterData &filterData, const PxShape *shape, const PxRigidActor *actor, PxHitFlags &queryFlags)=0
This filter callback is executed before the exact intersection test if PxQueryFlag::ePREFILTER flag w...
virtual PX_DEPRECATED PxQueryHitType::Enum postFilter(const PxFilterData &filterData, const PxQueryHit &hit)
This filter callback is executed if the exact intersection test returned true and PxQueryFlag::ePOSTF...
Definition PxQueryFiltering.h:198
virtual ~PxQueryFilterCallback()
virtual destructor
Definition PxQueryFiltering.h:224
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Abstract class for collision shapes.
Definition PxShape.h:146
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
#define PX_INLINE
Definition PxPreprocessor.h:320
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxFlags< PxQueryFlag::Enum, PxU16 > PxQueryFlags
Flags typedef for the set of bits defined in PxQueryFlag.
Definition PxQueryFiltering.h:90
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition PxFiltering.h:365
Scene query filtering data.
Definition PxQueryFiltering.h:138
PX_INLINE PxQueryFilterData()
default constructor
Definition PxQueryFiltering.h:140
PxFilterData data
Filter data associated with the scene query.
Definition PxQueryFiltering.h:148
PX_INLINE PxQueryFilterData(const PxFilterData &fd, PxQueryFlags f)
constructor to set both filter data and filter flags
Definition PxQueryFiltering.h:143
PX_INLINE PxQueryFilterData(PxQueryFlags f)
constructor to set filter flags only
Definition PxQueryFiltering.h:146
PxQueryFlags flags
Filter flags (see PxQueryFlags)
Definition PxQueryFiltering.h:149
Filtering flags for scene queries.
Definition PxQueryFiltering.h:55
Enum
Definition PxQueryFiltering.h:57
@ eBATCH_QUERY_LEGACY_BEHAVIOUR
Definition PxQueryFiltering.h:72
@ eNO_BLOCK
Definition PxQueryFiltering.h:69
@ eDISABLE_HARDCODED_FILTER
Definition PxQueryFiltering.h:76
@ eSTATIC
Traverse static shapes.
Definition PxQueryFiltering.h:58
@ ePREFILTER
Run the pre-intersection-test filter (see PxQueryFilterCallback::preFilter())
Definition PxQueryFiltering.h:62
@ eANY_HIT
Definition PxQueryFiltering.h:66
@ eRESERVED
Reserved for internal use.
Definition PxQueryFiltering.h:79
@ ePOSTFILTER
Run the post-intersection-test filter (see PxQueryFilterCallback::postFilter())
Definition PxQueryFiltering.h:64
@ eDYNAMIC
Traverse dynamic shapes.
Definition PxQueryFiltering.h:60
Classification of scene query hits (intersections).
Definition PxQueryFiltering.h:114
Enum
Definition PxQueryFiltering.h:116
@ eBLOCK
a hit on the shape blocks the query (does not block overlap queries)
Definition PxQueryFiltering.h:119
collection of set bits defined in PxHitFlag.
Definition PxGeometryHit.h:95