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-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_CCT_MANAGER
32 #define PX_PHYSICS_CCT_MANAGER
33 
38 
39 #include "PxPhysXConfig.h"
40 #include "foundation/PxFlags.h"
42 #include "common/PxRenderBuffer.h"
43 
44 #if !PX_DOXYGEN
45 namespace physx
46 {
47 #endif
48 
49 class PxPhysics;
50 class PxScene;
51 class PxController;
52 class PxControllerDesc;
53 class PxObstacleContext;
55 
60 {
61  enum Enum
62  {
63  eTEMPORAL_BV = (1<<0),
64  eCACHED_BV = (1<<1),
65  eOBSTACLES = (1<<2),
66 
67  eNONE = 0,
68  eALL = 0xffffffff
69  };
70 };
71 
78 PX_FLAGS_OPERATORS(PxControllerDebugRenderFlag::Enum, PxU32)
79 
80 
81 
87 {
88 public:
97  virtual void release() = 0;
98 
104  virtual PxScene& getScene() const = 0;
105 
111  virtual PxU32 getNbControllers() const = 0;
112 
119  virtual PxController* getController(PxU32 index) = 0;
120 
129  virtual PxController* createController(const PxControllerDesc& desc) = 0;
130 
134  virtual void purgeControllers() = 0;
135 
143  virtual PxRenderBuffer& getRenderBuffer() = 0;
144 
152  virtual void setDebugRenderingFlags(PxControllerDebugRenderFlags flags) = 0;
153 
159  virtual PxU32 getNbObstacleContexts() const = 0;
160 
167  virtual PxObstacleContext* getObstacleContext(PxU32 index) = 0;
168 
176  virtual PxObstacleContext* createObstacleContext() = 0;
177 
195  virtual void computeInteractions(PxF32 elapsedTime, PxControllerFilterCallback* cctFilterCb=NULL) = 0;
196 
210  virtual void setTessellation(bool flag, float maxEdgeLength) = 0;
211 
231  virtual void setOverlapRecoveryModule(bool flag) = 0;
232 
242  virtual void setPreciseSweeps(bool flag) = 0;
243 
257  virtual void setPreventVerticalSlidingAgainstCeiling(bool flag) = 0;
258 
271  virtual void shiftOrigin(const PxVec3& shift) = 0;
272 
273 protected:
275  virtual ~PxControllerManager() {}
276 };
277 
278 #if !PX_DOXYGEN
279 } // namespace physx
280 #endif
281 
298 PX_C_EXPORT PX_PHYSX_CHARACTER_API physx::PxControllerManager* PX_CALL_CONV PxCreateControllerManager(physx::PxScene& scene, bool lockingEnabled = false);
299 
301 #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
#define PX_PHYSX_CHARACTER_API
Definition: PxCharacter.h:52
virtual ~PxControllerManager()
Definition: PxControllerManager.h:275
float PxF32
Definition: PxSimpleTypes.h:76
#define PX_C_EXPORT
Definition: Pxc.h:54
#define PX_CALL_CONV
Definition: PxPreprocessor.h:328
specifies debug-rendering flags
Definition: PxControllerManager.h:59
PX_C_EXPORT PX_PHYSX_CHARACTER_API physx::PxControllerManager *PX_CALL_CONV PxCreateControllerManager(physx::PxScene &scene, bool lockingEnabled=false)
Creates the controller manager.
Enum
Definition: PxControllerManager.h:61
Dedicated filtering callback for CCT vs CCT.
Definition: PxController.h:247
Context class for obstacles.
Definition: PxControllerObstacles.h:115
Base class for character controllers.
Definition: PxController.h:623
Manages an array of character controllers.
Definition: PxControllerManager.h:86
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:77
Interface for points, lines, triangles, and text buffer.
Definition: PxRenderBuffer.h:131
PxControllerManager()
Definition: PxControllerManager.h:274
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:304
3 Element vector class.
Definition: PxVec3.h:49