Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/physics/BodyData.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _BODY_DATA_H_
00004 #define _BODY_DATA_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <core/Vector3d.h>
00009 #include <resource/Resource.h>
00010 
00011 #include <string>
00012 #include <list>
00013 
00014 namespace resource
00015 {
00016 class Serializer;
00017 }
00018 
00019 namespace physics
00020 {
00021 
00022 class Material;
00023 class Body;
00024 class Shape;
00025 
00026 enum BodyType
00027 {
00028         BT_DYNAMIC,
00029         BT_STATIC,
00030         BT_KINEMATIC,
00031         BT_COUNT
00032 };
00033 
00037 class ENGINE_PUBLIC_EXPORT BodyData: public resource::Resource
00038 {
00039         friend class Body;
00040 
00041 public:
00042 
00043         BodyData(const std::string& name, resource::Serializer* serializer);
00044         virtual ~BodyData();
00045 
00047         void setBodyType(BodyType type);
00048 
00050         const BodyType& getBodyType() const;
00051 
00053         void setSleeping(bool sleeping);
00054 
00056         bool getSleeping();
00057 
00059         void setSleepiness(f32 sleepiness);
00060 
00062         f32 getSleepiness();
00063 
00065         void setMass(f32 mass);
00066 
00068         f32 getMass();
00069 
00071         void setLinearDamping(f32 linearDamping);
00072 
00074         f32 getLinearDamping();
00075 
00077         void setAngularDamping(f32 angularDamping);
00078 
00080         f32 getAngularDamping();
00081 
00083         void setLinearVelocity(const core::vector3d& velocity);
00084 
00086         const core::vector3d& getLinearVelocity() const;
00087 
00089         void setAngularVelocity(const core::vector3d& velocity);
00090 
00092         const core::vector3d& getAngularVelocity() const;
00093 
00095         void setMaterial(const std::string& filename);
00096 
00097         Material* getMaterial();
00098         
00099         void addShape(Shape* shape);
00100 
00101         std::list<Shape*>& getShapes();
00102 
00104         void removeAllShapes();
00105 
00106 private:
00107 
00108         void initProperties();
00109         void unloadImpl();
00110 
00112         BodyType mBodyType;
00113 
00115         bool mSleeping;
00116 
00118         f32 mSleepiness;
00119 
00121         f32 mMass;
00122 
00124         f32 mLinearDamping;
00125 
00127         f32 mAngularDamping;
00128 
00130         core::vector3d mLinearVelocity;
00131 
00133         core::vector3d mAngularVelocity;
00134 
00136         Material* mMaterial;
00137 
00138         std::list<Shape*> mShapes;
00139 };
00140 
00141 } // end namespace physics
00142 
00143 #endif

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by Doxygen (1.7.4)