PxCapsuleController.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 
14 #ifndef PX_PHYSICS_CCT_CAPSULE_CONTROLLER
15 #define PX_PHYSICS_CCT_CAPSULE_CONTROLLER
16 
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
29 {
30  enum Enum
31  {
34 
35  eLAST
36  };
37 };
38 
45 {
46 public:
52 
56  PX_INLINE PxCapsuleControllerDesc(const PxCapsuleControllerDesc&);
57 
61  PX_INLINE PxCapsuleControllerDesc& operator=(const PxCapsuleControllerDesc&);
62 
66  PX_INLINE virtual void setToDefault();
72  PX_INLINE virtual bool isValid() const;
73 
82 
91 
100 
101 protected:
102  PX_INLINE void copy(const PxCapsuleControllerDesc&);
103 };
104 
106 {
107  radius = height = 0.0f;
109 }
110 
112 {
113  copy(other);
114 }
115 
117 {
119  copy(other);
120  return *this;
121 }
122 
124 {
125  radius = other.radius;
126  height = other.height;
127  climbingMode = other.climbingMode;
128 }
129 
131 {
132  *this = PxCapsuleControllerDesc();
133 }
134 
136 {
137  if(!PxControllerDesc::isValid()) return false;
138  if(radius<=0.0f) return false;
139  if(height<=0.0f) return false;
140  if(stepOffset>height+radius*2.0f) return false; // Prevents obvious mistakes
141  return true;
142 }
161 {
162 public:
163 
171  virtual PxF32 getRadius() const = 0;
172 
183  virtual bool setRadius(PxF32 radius) = 0;
184 
192  virtual PxF32 getHeight() const = 0;
193 
204  virtual bool setHeight(PxF32 height) = 0;
205 
213  virtual PxCapsuleClimbingMode::Enum getClimbingMode() const = 0;
214 
222  virtual bool setClimbingMode(PxCapsuleClimbingMode::Enum mode) = 0;
223 
224 protected:
226  virtual ~PxCapsuleController() {}
227 };
228 
229 #ifndef PX_DOXYGEN
230 } // namespace physx
231 #endif
232 
234 #endif


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