PxControllerManager.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_CCT_MANAGER
32 #define PX_PHYSICS_CCT_MANAGER
33 
37 #include "PxPhysXConfig.h"
38 #include "foundation/PxFlags.h"
40 #include "common/PxRenderBuffer.h"
41 
42 #if !PX_DOXYGEN
43 namespace physx
44 {
45 #endif
46 
47 class PxPhysics;
48 class PxScene;
49 class PxController;
50 class PxControllerDesc;
51 class PxObstacleContext;
53 
58 {
59  enum Enum
60  {
61  eTEMPORAL_BV = (1<<0),
62  eCACHED_BV = (1<<1),
63  eOBSTACLES = (1<<2),
64 
65  eNONE = 0,
66  eALL = 0xffffffff
67  };
68 };
69 
76 PX_FLAGS_OPERATORS(PxControllerDebugRenderFlag::Enum, PxU32)
77 
78 
79 
85 {
86 public:
95  virtual void release() = 0;
96 
102  virtual PxScene& getScene() const = 0;
103 
109  virtual PxU32 getNbControllers() const = 0;
110 
117  virtual PxController* getController(PxU32 index) = 0;
118 
127  virtual PxController* createController(const PxControllerDesc& desc) = 0;
128 
132  virtual void purgeControllers() = 0;
133 
141  virtual PxRenderBuffer& getRenderBuffer() = 0;
142 
150  virtual void setDebugRenderingFlags(PxControllerDebugRenderFlags flags) = 0;
151 
157  virtual PxU32 getNbObstacleContexts() const = 0;
158 
165  virtual PxObstacleContext* getObstacleContext(PxU32 index) = 0;
166 
174  virtual PxObstacleContext* createObstacleContext() = 0;
175 
193  virtual void computeInteractions(PxF32 elapsedTime, PxControllerFilterCallback* cctFilterCb=NULL) = 0;
194 
208  virtual void setTessellation(bool flag, float maxEdgeLength) = 0;
209 
229  virtual void setOverlapRecoveryModule(bool flag) = 0;
230 
240  virtual void setPreciseSweeps(bool flag) = 0;
241 
255  virtual void setPreventVerticalSlidingAgainstCeiling(bool flag) = 0;
256 
269  virtual void shiftOrigin(const PxVec3& shift) = 0;
270 
271 protected:
273  virtual ~PxControllerManager() {}
274 };
275 
276 #if !PX_DOXYGEN
277 } // namespace physx
278 #endif
279 
296 PX_C_EXPORT physx::PxControllerManager* PX_CALL_CONV PxCreateControllerManager(physx::PxScene& scene, bool lockingEnabled = false);
297 
299 #endif //PX_PHYSICS_CCT_MANAGER
Definition: GuContactBuffer.h:37
A scene is a collection of bodies and constraints which can interact.
Definition: PxScene.h:169
virtual ~PxControllerManager()
Definition: PxControllerManager.h:273
float PxF32
Definition: PxSimpleTypes.h:76
#define PX_C_EXPORT
Definition: Pxc.h:54
#define PX_CALL_CONV
Definition: PxPreprocessor.h:315
specifies debug-rendering flags
Definition: PxControllerManager.h:57
Enum
Definition: PxControllerManager.h:59
Dedicated filtering callback for CCT vs CCT.
Definition: PxController.h:243
Context class for obstacles.
Definition: PxControllerObstacles.h:114
Base class for character controllers.
Definition: PxController.h:628
Manages an array of character controllers.
Definition: PxControllerManager.h:84
PxU16 flags
a set of Px1DConstraintFlags
Definition: PxConstraintDesc.h:110
PxFlags< PxControllerDebugRenderFlag::Enum, PxU32 > PxControllerDebugRenderFlags
Bitfield that contains a set of raised flags defined in PxControllerDebugRenderFlag.
Definition: PxControllerManager.h:75
PX_C_EXPORT physx::PxControllerManager *PX_CALL_CONV PxCreateControllerManager(physx::PxScene &scene, bool lockingEnabled=false)
Creates the controller manager.
Interface for points, lines, triangles, and text buffer.
Definition: PxRenderBuffer.h:131
PxControllerManager()
Definition: PxControllerManager.h:272
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition: PxPhysics.h:71
uint32_t PxU32
Definition: Px.h:48
Descriptor class for a character controller.
Definition: PxController.h:300
3 Element vector class.
Definition: PxVec3.h:49