Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
E:/Programming/MyProject/K_Game_hg/GameEngine/include/physics/Joint.h
Go to the documentation of this file.
00001 // Copyright 2006-2011 by Kat'Oun
00002 
00003 #ifndef _JOINT_H_
00004 #define _JOINT_H_
00005 
00006 #include <EngineConfig.h>
00007 #include <core/Types.h>
00008 #include <core/Vector3d.h>
00009 #include <core/Quaternion.h>
00010 #include <physics/JointDefines.h>
00011 #include <engine/Object.h>
00012 
00013 namespace physics
00014 {
00015 
00016 class Body;
00017 
00021 class ENGINE_PUBLIC_EXPORT Joint: public engine::Object
00022 {
00023 public:
00024 
00025         Joint();
00026         Joint(const std::string& name);
00027 
00028         virtual ~Joint();
00029 
00031         const JointType& getJointType() const;
00032 
00033         void setActors(Body* body1, Body* body2);
00034 
00035         virtual void setAnchor(const core::vector3d& anchor);
00036 
00037         virtual void setAxis(const core::vector3d& axis);
00038 
00039 protected:
00040 
00041         // Incremented count for next index
00042         static u32 msNextGeneratedJointIndex;
00043 
00044         void initProperties();
00045 
00046         JointType mJointType;
00047 
00048         Body* mActor1;
00049         Body* mActor2;
00050 
00051         core::vector3d mAnchor;
00052         core::vector3d mAxis;
00053 };
00054 
00056 //Spherical Joint
00057 class ENGINE_PUBLIC_EXPORT SphericalJoint: public Joint
00058 {
00059 public:
00060 
00061         SphericalJoint();
00062         SphericalJoint(const std::string& name);
00063 
00064         virtual ~SphericalJoint();
00065 
00066         virtual void setLimits(f32 coneLimit, f32 twistLimit);
00067 
00068 protected:
00069 
00070         void initProperties();
00071 
00072         f32 mConeLimit; // The maximum limit of rotational movement (radians)
00073         f32 mTwistLimit; // The maximum limit of twisting movement (radians)
00074 };
00075 
00077 //Hinge Joint
00078 class ENGINE_PUBLIC_EXPORT HingeJoint: public Joint
00079 {
00080 public:
00081 
00082         HingeJoint();
00083         HingeJoint(const std::string& name);
00084 
00085         virtual ~HingeJoint();
00086 
00087         virtual void setLimits(f32 lowerLimit, f32 upperLimit);
00088 
00089 protected:
00090 
00091         void initProperties();
00092 
00093         f32 mLowerLimit;
00094         f32 mUpperLimit;
00095 };
00096 
00098 //Slider Joint
00099 class ENGINE_PUBLIC_EXPORT SliderJoint: public Joint
00100 {
00101 public:
00102 
00103         SliderJoint();
00104         SliderJoint(const std::string& name);
00105 
00106         virtual ~SliderJoint();
00107 
00108 protected:
00109 
00110         void initProperties();
00111 };
00112 
00114 //Generic Joint
00115 class ENGINE_PUBLIC_EXPORT GenericJoint: public Joint
00116 {
00117 public:
00118 
00119         GenericJoint();
00120         GenericJoint(const std::string& name);
00121 
00122         virtual ~GenericJoint();
00123 
00124 protected:
00125 
00126         void initProperties();
00127 };
00128 
00130 //Rigid Joint
00131 class ENGINE_PUBLIC_EXPORT RigidJoint: public Joint
00132 {
00133 public:
00134 
00135         RigidJoint();
00136         RigidJoint(const std::string& name);
00137 
00138         virtual ~RigidJoint();
00139 
00140 protected:
00141 
00142         void initProperties();
00143 };
00144 
00145 } // end namespace physics
00146 
00147 #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)