PxRigidBody.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_NX_RIGIDBODY
15 #define PX_PHYSICS_NX_RIGIDBODY
16 
20 #include "PxRigidActor.h"
21 #include "PxForceMode.h"
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
28 
36 {
37  enum Enum
38  {
39 
61  eKINEMATIC = (1<<0),
62 
72  eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES = (1<<1),
73 
84  eENABLE_CCD = (1<<2),
85 
95  eENABLE_CCD_FRICTION = (1<<3)
96  };
97 };
98 
107 
115 
116 
121 
122 
129 class PxRigidBody : public PxRigidActor
130 {
131 public:
132  // Runtime modifications
133 
134 /************************************************************************************************/
152  virtual void setCMassLocalPose(const PxTransform& pose) = 0;
153 
154 
162  virtual PxTransform getCMassLocalPose() const = 0;
163 
164 
184  virtual void setMass(PxReal mass) = 0;
185 
195  virtual PxReal getMass() const = 0;
196 
204  virtual PxReal getInvMass() const = 0;
205 
227  virtual void setMassSpaceInertiaTensor(const PxVec3& m) = 0;
228 
240  virtual PxVec3 getMassSpaceInertiaTensor() const = 0;
241 
253  virtual PxVec3 getMassSpaceInvInertiaTensor() const = 0;
254 
255 
256 /************************************************************************************************/
268  virtual PxVec3 getLinearVelocity() const = 0;
269 
289  virtual void setLinearVelocity(const PxVec3& linVel, bool autowake = true ) = 0;
290 
291 
292 
300  virtual PxVec3 getAngularVelocity() const = 0;
301 
302 
322  virtual void setAngularVelocity(const PxVec3& angVel, bool autowake = true ) = 0;
323 
324 
325 /************************************************************************************************/
359  virtual void addForce(const PxVec3& force, PxForceMode::Enum mode = PxForceMode::eFORCE, bool autowake = true) = 0;
360 
389  virtual void addTorque(const PxVec3& torque, PxForceMode::Enum mode = PxForceMode::eFORCE, bool autowake = true) = 0;
390 
410  virtual void clearForce(PxForceMode::Enum mode = PxForceMode::eFORCE) = 0;
411 
431  virtual void clearTorque(PxForceMode::Enum mode = PxForceMode::eFORCE) = 0;
432 
448  PX_DEPRECATED virtual void setRigidDynamicFlag(PxRigidDynamicFlag::Enum flag, bool value) = 0;
449  PX_DEPRECATED virtual void setRigidDynamicFlags(PxRigidDynamicFlags inFlags) = 0;
450 
466  virtual void setRigidBodyFlag(PxRigidBodyFlag::Enum flag, bool value) = 0;
467  virtual void setRigidBodyFlags(PxRigidBodyFlags inFlags) = 0;
468 
479  PX_DEPRECATED virtual PxRigidDynamicFlags getRigidDynamicFlags() const = 0;
480 
490  virtual PxRigidBodyFlags getRigidBodyFlags() const = 0;
491 
513  virtual void setMinCCDAdvanceCoefficient(PxReal advanceCoefficient) = 0;
514 
524  virtual PxReal getMinCCDAdvanceCoefficient() const = 0;
525 
526 
532  virtual void setMaxDepenetrationVelocity(const PxReal biasClamp) = 0;
533 
539  virtual PxReal getMaxDepenetrationVelocity() const = 0;
540 
541 
542 
543 protected:
544  PX_INLINE PxRigidBody(PxType concreteType, PxBaseFlags baseFlags) : PxRigidActor(concreteType, baseFlags) {}
545  PX_INLINE PxRigidBody(PxBaseFlags baseFlags) : PxRigidActor(baseFlags) {}
546  virtual ~PxRigidBody() {}
547  virtual bool isKindOf(const char* name)const { return !strcmp("PxRigidBody", name) || PxRigidActor::isKindOf(name); }
548 };
549 
550 PX_DEPRECATED PX_INLINE PxRigidBody* PxActor::isRigidBody() { return is<PxRigidBody>(); }
551 PX_DEPRECATED PX_INLINE const PxRigidBody* PxActor::isRigidBody() const { return is<PxRigidBody>(); }
552 
553 
554 #ifndef PX_DOXYGEN
555 } // namespace physx
556 #endif
557 
559 #endif


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