00001 /* 00002 * PhysX rigid body header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_PHYSICS_PHYSX_RIGIDBODY_H__ 00009 #define __SP_PHYSICS_PHYSX_RIGIDBODY_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #ifdef SP_COMPILE_WITH_PHYSX 00015 00016 00017 #include "Base/spDimension.hpp" 00018 #include "Framework/Physics/spPhysicsRigidBody.hpp" 00019 #include "Framework/Physics/spPhysicsJoint.hpp" 00020 #include "Framework/Physics/PhysX/spPhysXBaseObject.hpp" 00021 00022 00023 namespace sp 00024 { 00025 namespace physics 00026 { 00027 00028 00029 class SP_EXPORT PhysXRigidBody : public RigidBody, public PhysXBaseObject 00030 { 00031 00032 public: 00033 00034 PhysXRigidBody( 00035 PxPhysics* PxDevice, PhysXMaterial* Material, const ERigidBodies Type, 00036 scene::SceneNode* RootNode, const SRigidBodyConstruction &Construct 00037 ); 00038 ~PhysXRigidBody(); 00039 00040 /* === Functions === */ 00041 00042 void setMass(f32 Mass); 00043 00044 void setMassCenter(const dim::vector3df &LocalPoint); 00045 dim::vector3df getMassCenter() const; 00046 00047 void addVelocity(const dim::vector3df &Direction); 00048 void setVelocity(const dim::vector3df &Direction); 00049 dim::vector3df getVelocity() const; 00050 00051 void addImpulse(const dim::vector3df &Direction, const dim::vector3df &PivotPoint); 00052 void setForce(const dim::vector3df &Direction); 00053 00054 private: 00055 00056 friend class PhysXSimulator; 00057 friend class PhysXJoint; 00058 00059 /* === Members === */ 00060 00061 PxRigidDynamic* PxActor_; 00062 00063 }; 00064 00065 00066 } // /namespace physics 00067 00068 } // /namespace sp 00069 00070 00071 #endif 00072 00073 #endif 00074 00075 00076 00077 // ================================================================================