PxDefaultSimulationFilterShader.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-2018 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_DEFAULTSIMULATIONFILTERSHADER_H
32 #define PX_PHYSICS_EXTENSIONS_DEFAULTSIMULATIONFILTERSHADER_H
33 
37 #include "PxPhysXConfig.h"
38 
39 #include "PxFiltering.h"
40 
41 #if !PX_DOXYGEN
42 namespace physx
43 {
44 #endif
45 
46 class PxActor;
47 
71 {
72 public:
73  PX_INLINE PxGroupsMask():bits0(0),bits1(0),bits2(0),bits3(0) {}
75 
76  PxU16 bits0, bits1, bits2, bits3;
77 };
78 
84 struct PxFilterOp
85 {
86  enum Enum
87  {
94  PX_FILTEROP_SWAP_AND
95  };
96 };
97 
117  PxFilterObjectAttributes attributes0,
118  PxFilterData filterData0,
119  PxFilterObjectAttributes attributes1,
120  PxFilterData filterData1,
121  PxPairFlags& pairFlags,
122  const void* constantBlock,
123  PxU32 constantBlockSize);
124 
137 bool PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2);
138 
150 void PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable);
151 
163 PxU16 PxGetGroup(const PxActor& actor);
164 
175 void PxSetGroup(PxActor& actor, const PxU16 collisionGroup);
176 
187 
197 void PxSetFilterOps(const PxFilterOp::Enum& op0, const PxFilterOp::Enum& op1, const PxFilterOp::Enum& op2);
198 
206 bool PxGetFilterBool();
207 
215 void PxSetFilterBool(const bool enable);
216 
226 
235 void PxSetFilterConstants(const PxGroupsMask& c0, const PxGroupsMask& c1);
236 
246 PxGroupsMask PxGetGroupsMask(const PxActor& actor);
247 
256 void PxSetGroupsMask(PxActor& actor, const PxGroupsMask& mask);
257 
258 #if !PX_DOXYGEN
259 } // namespace physx
260 #endif
261 
263 #endif
Definition: GuContactBuffer.h:37
void PxGetFilterConstants(PxGroupsMask &c0, PxGroupsMask &c1)
Gets filtering constant K0 and K1. See comments for PxGroupsMask.
void PxSetFilterOps(const PxFilterOp::Enum &op0, const PxFilterOp::Enum &op1, const PxFilterOp::Enum &op2)
Setups filtering operations. See comments for PxGroupsMask.
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition: PxFiltering.h:366
Definition: PxDefaultSimulationFilterShader.h:88
PxActor is the base class for the main simulation objects in the physics SDK.
Definition: PxActor.h:154
void PxGetFilterOps(PxFilterOp::Enum &op0, PxFilterOp::Enum &op1, PxFilterOp::Enum &op2)
Retrieves filtering operation. See comments for PxGroupsMask.
PX_INLINE ~PxGroupsMask()
Definition: PxDefaultSimulationFilterShader.h:74
PX_INLINE PxGroupsMask()
Definition: PxDefaultSimulationFilterShader.h:73
bool PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2)
Determines if collision detection is performed between a pair of groups.
void PxSetFilterConstants(const PxGroupsMask &c0, const PxGroupsMask &c1)
Setups filtering's K0 and K1 value. See comments for PxGroupsMask.
64-bit mask used for collision filtering.
Definition: PxDefaultSimulationFilterShader.h:70
PxGroupsMask PxGetGroupsMask(const PxActor &actor)
Gets 64-bit mask used for collision filtering. See comments for PxGroupsMask.
void PxSetGroup(PxActor &actor, const PxU16 collisionGroup)
Sets which collision group this actor is part of.
PxFilterFlags PxDefaultSimulationFilterShader(PxFilterObjectAttributes attributes0, PxFilterData filterData0, PxFilterObjectAttributes attributes1, PxFilterData filterData1, PxPairFlags &pairFlags, const void *constantBlock, PxU32 constantBlockSize)
Implementation of a simple filter shader that emulates PhysX 2.8.x filtering.
PxU32 PxFilterObjectAttributes
Structure which gets passed into the collision filtering shader and/or callback providing additional ...
Definition: PxFiltering.h:491
void PxSetFilterBool(const bool enable)
Setups filtering's boolean value. See comments for PxGroupsMask.
bool PxGetFilterBool()
Retrieves filtering's boolean value. See comments for PxGroupsMask.
Definition: PxDefaultSimulationFilterShader.h:92
void PxSetGroupsMask(PxActor &actor, const PxGroupsMask &mask)
Sets 64-bit mask used for collision filtering. See comments for PxGroupsMask.
Definition: PxDefaultSimulationFilterShader.h:91
PxU16 PxGetGroup(const PxActor &actor)
Retrieves the value set with PxSetGroup()
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
Collision filtering operations.
Definition: PxDefaultSimulationFilterShader.h:84
Definition: PxDefaultSimulationFilterShader.h:93
uint16_t PxU16
Definition: PxSimpleTypes.h:73
uint32_t PxU32
Definition: Px.h:48
void PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable)
Specifies if collision should be performed by a pair of groups.
Definition: PxDefaultSimulationFilterShader.h:90
Definition: PxDefaultSimulationFilterShader.h:89
#define PX_INLINE
Definition: PxPreprocessor.h:349
Enum
Definition: PxDefaultSimulationFilterShader.h:86
PxU16 bits3
Definition: PxDefaultSimulationFilterShader.h:76