RavEngine
Loading...
Searching...
No Matches
PxDefaultSimulationFilterShader.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_DEFAULT_SIMULATION_FILTER_SHADER_H
30#define PX_DEFAULT_SIMULATION_FILTER_SHADER_H
35#include "PxPhysXConfig.h"
36
37#include "PxFiltering.h"
38
39#if !PX_DOXYGEN
40namespace physx
41{
42#endif
43
44class PxActor;
45
69{
70public:
71 PX_INLINE PxGroupsMask():bits0(0),bits1(0),bits2(0),bits3(0) {}
73
74 PxU16 bits0, bits1, bits2, bits3;
75};
76
83{
84 enum Enum
85 {
86 PX_FILTEROP_AND,
87 PX_FILTEROP_OR,
88 PX_FILTEROP_XOR,
89 PX_FILTEROP_NAND,
90 PX_FILTEROP_NOR,
91 PX_FILTEROP_NXOR,
92 PX_FILTEROP_SWAP_AND
93 };
94};
95
115 PxFilterObjectAttributes attributes0,
116 PxFilterData filterData0,
117 PxFilterObjectAttributes attributes1,
118 PxFilterData filterData1,
119 PxPairFlags& pairFlags,
120 const void* constantBlock,
121 PxU32 constantBlockSize);
122
135bool PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2);
136
148void PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable);
149
161PxU16 PxGetGroup(const PxActor& actor);
162
173void PxSetGroup(PxActor& actor, const PxU16 collisionGroup);
174
184void PxGetFilterOps(PxFilterOp::Enum& op0, PxFilterOp::Enum& op1, PxFilterOp::Enum& op2);
185
195void PxSetFilterOps(const PxFilterOp::Enum& op0, const PxFilterOp::Enum& op1, const PxFilterOp::Enum& op2);
196
204bool PxGetFilterBool();
205
213void PxSetFilterBool(const bool enable);
214
224
233void PxSetFilterConstants(const PxGroupsMask& c0, const PxGroupsMask& c1);
234
245
254void PxSetGroupsMask(PxActor& actor, const PxGroupsMask& mask);
255
256#if !PX_DOXYGEN
257} // namespace physx
258#endif
259
261#endif
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
64-bit mask used for collision filtering.
Definition PxDefaultSimulationFilterShader.h:69
#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
PxU32 PxFilterObjectAttributes
Structure which gets passed into the collision filtering shader and/or callback providing additional ...
Definition PxFiltering.h:515
PxU16 PxGetGroup(const PxActor &actor)
Retrieves the value set with PxSetGroup()
Definition ExtDefaultSimulationFilterShader.cpp:268
void PxSetGroupsMask(PxActor &actor, const PxGroupsMask &mask)
Sets 64-bit mask used for collision filtering. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:327
void PxSetFilterConstants(const PxGroupsMask &c0, const PxGroupsMask &c1)
Setups filtering's K0 and K1 value. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:312
bool PxGetFilterBool()
Retrieves filtering's boolean value. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:296
void PxSetFilterOps(const PxFilterOp::Enum &op0, const PxFilterOp::Enum &op1, const PxFilterOp::Enum &op2)
Setups filtering operations. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:289
void PxGetFilterOps(PxFilterOp::Enum &op0, PxFilterOp::Enum &op1, PxFilterOp::Enum &op2)
Retrieves filtering operation. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:282
bool PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2)
Determines if collision detection is performed between a pair of groups.
Definition ExtDefaultSimulationFilterShader.cpp:253
void PxSetFilterBool(const bool enable)
Setups filtering's boolean value. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:301
void PxGetFilterConstants(PxGroupsMask &c0, PxGroupsMask &c1)
Gets filtering constant K0 and K1. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:306
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.
Definition ExtDefaultSimulationFilterShader.cpp:209
void PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable)
Specifies if collision should be performed by a pair of groups.
Definition ExtDefaultSimulationFilterShader.cpp:260
void PxSetGroup(PxActor &actor, const PxU16 collisionGroup)
Sets which collision group this actor is part of.
Definition ExtDefaultSimulationFilterShader.cpp:275
PxGroupsMask PxGetGroupsMask(const PxActor &actor)
Gets 64-bit mask used for collision filtering. See comments for PxGroupsMask.
Definition ExtDefaultSimulationFilterShader.cpp:318
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition PxFiltering.h:365
Collision filtering operations.
Definition PxDefaultSimulationFilterShader.h:83