PxControllerObstacles.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 #ifndef PX_PHYSICS_CCT_OBSTACLES
14 #define PX_PHYSICS_CCT_OBSTACLES
15 
21 #include "geometry/PxGeometry.h"
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
28  class PxControllerManager;
29 
30  #define INVALID_OBSTACLE_HANDLE 0xffffffff
31 
37  class PxObstacle
38  {
39  protected:
41  mType (PxGeometryType::eINVALID),
42  mUserData (NULL),
43  mPos (0.0, 0.0, 0.0),
44  mRot (PxQuat(PxIdentity))
45  {}
47 
49  public:
50 
51  PX_FORCE_INLINE PxGeometryType::Enum getType() const { return mType; }
52 
53  void* mUserData;
56  };
57 
63  class PxBoxObstacle : public PxObstacle
64  {
65  public:
67  mHalfExtents(0.0f)
68  { mType = PxGeometryType::eBOX; }
70 
72  };
73 
80  {
81  public:
83  mHalfHeight (0.0f),
84  mRadius (0.0f)
85  { mType = PxGeometryType::eCAPSULE; }
87 
90  };
91 
93 
102  {
103  public:
105  virtual ~PxObstacleContext() {}
106 
110  virtual void release() = 0;
111 
117  virtual PxControllerManager& getControllerManager() const = 0;
118 
126  virtual ObstacleHandle addObstacle(const PxObstacle& obstacle) = 0;
127 
135  virtual bool removeObstacle(ObstacleHandle handle) = 0;
136 
145  virtual bool updateObstacle(ObstacleHandle handle, const PxObstacle& obstacle) = 0;
146 
152  virtual PxU32 getNbObstacles() const = 0;
153 
161  virtual const PxObstacle* getObstacle(PxU32 i) const = 0;
162 
170  virtual const PxObstacle* getObstacleByHandle(ObstacleHandle handle) const = 0;
171  };
172 
173 #ifndef PX_DOXYGEN
174 }
175 #endif
176 
178 #endif


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com