00001 /* 00002 * PhysX base object 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_BASEOBJECT_H__ 00009 #define __SP_PHYSICS_PHYSX_BASEOBJECT_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 00014 #ifdef SP_COMPILE_WITH_PHYSX 00015 00016 00017 #include "Base/spDimension.hpp" 00018 #include "SceneGraph/spSceneMesh.hpp" 00019 #include "Framework/Physics/spPhysicsRigidBodyConstruct.hpp" 00020 #include "Framework/Physics/spPhysicsBaseObject.hpp" 00021 #include "Framework/Physics/PhysX/spPhysXCoreHeader.hpp" 00022 #include "Framework/Physics/PhysX/spPhysXMaterial.hpp" 00023 00024 00025 namespace sp 00026 { 00027 namespace physics 00028 { 00029 00030 00031 class SP_EXPORT PhysXBaseObject : virtual public PhysicsBaseObject 00032 { 00033 00034 public: 00035 00036 virtual ~PhysXBaseObject(); 00037 00038 /* === Functions === */ 00039 00040 virtual void setTransformation(const dim::matrix4f &Transformation); 00041 virtual dim::matrix4f getTransformation() const; 00042 00043 protected: 00044 00045 friend class PhysXJoint; 00046 00047 PhysXBaseObject(PhysXMaterial* Material); 00048 00049 /* === Functions === */ 00050 00051 void addShape(const PxGeometry &Geometry); 00052 00053 void createBox (const SRigidBodyConstruction &Construct); 00054 void createSphere (const SRigidBodyConstruction &Construct); 00055 void createCapsule (const SRigidBodyConstruction &Construct); 00056 00057 void createMesh(PxPhysics* PxDevice, PxCooking* PxCookDevice, scene::Mesh* Mesh); 00058 00059 /* === Members === */ 00060 00061 PxRigidActor* PxBaseActor_; 00062 PxMaterial* PxMaterial_; 00063 std::list<PxShape*> Shapes_; 00064 00065 }; 00066 00067 00068 } // /namespace physics 00069 00070 } // /namespace sp 00071 00072 00073 #endif 00074 00075 #endif 00076 00077 00078 00079 // ================================================================================