RavEngine
Loading...
Searching...
No Matches
PxControllerManager.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_CONTROLLER_MANAGER_H
30#define PX_CONTROLLER_MANAGER_H
35#include "PxPhysXConfig.h"
36#include "foundation/PxFlags.h"
37#include "foundation/PxErrorCallback.h"
38#include "common/PxRenderBuffer.h"
39
40#if !PX_DOXYGEN
41namespace physx
42{
43#endif
44
45class PxPhysics;
46class PxScene;
47class PxController;
48class PxControllerDesc;
49class PxObstacleContext;
50class PxControllerFilterCallback;
51
56{
57 enum Enum
58 {
59 eTEMPORAL_BV = (1<<0),
60 eCACHED_BV = (1<<1),
61 eOBSTACLES = (1<<2),
62
63 eNONE = 0,
64 eALL = 0xffffffff
65 };
66};
67
74PX_FLAGS_OPERATORS(PxControllerDebugRenderFlag::Enum, PxU32)
75
76
77
83{
84public:
93 virtual void release() = 0;
94
100 virtual PxScene& getScene() const = 0;
101
107 virtual PxU32 getNbControllers() const = 0;
108
115 virtual PxController* getController(PxU32 index) = 0;
116
126
130 virtual void purgeControllers() = 0;
131
140
149
155 virtual PxU32 getNbObstacleContexts() const = 0;
156
163 virtual PxObstacleContext* getObstacleContext(PxU32 index) = 0;
164
173
191 virtual void computeInteractions(PxF32 elapsedTime, PxControllerFilterCallback* cctFilterCb=NULL) = 0;
192
206 virtual void setTessellation(bool flag, float maxEdgeLength) = 0;
207
227 virtual void setOverlapRecoveryModule(bool flag) = 0;
228
238 virtual void setPreciseSweeps(bool flag) = 0;
239
253 virtual void setPreventVerticalSlidingAgainstCeiling(bool flag) = 0;
254
267 virtual void shiftOrigin(const PxVec3& shift) = 0;
268
269protected:
271 virtual ~PxControllerManager() {}
272};
273
274#if !PX_DOXYGEN
275} // namespace physx
276#endif
277
294PX_C_EXPORT physx::PxControllerManager* PX_CALL_CONV PxCreateControllerManager(physx::PxScene& scene, bool lockingEnabled = false);
295
297#endif
298
Descriptor class for a character controller.
Definition PxController.h:300
Dedicated filtering callback for CCT vs CCT.
Definition PxController.h:243
Manages an array of character controllers.
Definition PxControllerManager.h:83
virtual void computeInteractions(PxF32 elapsedTime, PxControllerFilterCallback *cctFilterCb=NULL)=0
Computes character-character interactions.
virtual PxU32 getNbControllers() const =0
Returns the number of controllers that are being managed.
virtual void setPreciseSweeps(bool flag)=0
Enables or disables the precise sweeps.
virtual PxU32 getNbObstacleContexts() const =0
Returns the number of obstacle contexts that are being managed.
virtual void release()=0
Releases the controller manager.
virtual void shiftOrigin(const PxVec3 &shift)=0
Shift the origin of the character controllers and obstacle objects by the specified vector.
virtual void setPreventVerticalSlidingAgainstCeiling(bool flag)=0
Enables or disables vertical sliding against ceilings.
virtual PxObstacleContext * createObstacleContext()=0
Creates an obstacle context.
virtual PxScene & getScene() const =0
Returns the scene the manager is adding the controllers to.
virtual PxController * createController(const PxControllerDesc &desc)=0
Creates a new character controller.
virtual PxRenderBuffer & getRenderBuffer()=0
Retrieves debug data.
virtual PxController * getController(PxU32 index)=0
Retrieve one of the controllers in the manager.
virtual void setTessellation(bool flag, float maxEdgeLength)=0
Enables or disables runtime tessellation.
virtual void setOverlapRecoveryModule(bool flag)=0
Enables or disables the overlap recovery module.
virtual PxObstacleContext * getObstacleContext(PxU32 index)=0
Retrieve one of the obstacle contexts in the manager.
virtual void setDebugRenderingFlags(PxControllerDebugRenderFlags flags)=0
Sets debug rendering flags.
virtual void purgeControllers()=0
Releases all the controllers that are being managed.
Base class for character controllers.
Definition PxController.h:638
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
Context class for obstacles.
Definition PxControllerObstacles.h:114
Interface for points, lines, triangles, and text buffer.
Definition PxRenderBuffer.h:136
A scene is a collection of bodies and constraints which can interact.
Definition PxScene.h:178
3 Element vector class.
Definition PxVec3.h:50
PX_C_EXPORT physx::PxControllerManager *PX_CALL_CONV PxCreateControllerManager(physx::PxScene &scene, bool lockingEnabled=false)
Creates the controller manager.
Definition CctCharacterControllerManager.cpp:682
#define PX_CALL_CONV
Definition PxPreprocessor.h:299
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxFlags< PxControllerDebugRenderFlag::Enum, PxU32 > PxControllerDebugRenderFlags
Bitfield that contains a set of raised flags defined in PxControllerDebugRenderFlag.
Definition PxControllerManager.h:73
specifies debug-rendering flags
Definition PxControllerManager.h:56
Enum
Definition PxControllerManager.h:58
@ eTEMPORAL_BV
Temporal bounding volume around controllers.
Definition PxControllerManager.h:59
@ eCACHED_BV
Cached bounding volume around controllers.
Definition PxControllerManager.h:60
@ eOBSTACLES
User-defined obstacles.
Definition PxControllerManager.h:61