00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "hingejoint.h"
00023
00024 using namespace boost;
00025 using namespace oxygen;
00026 using namespace salt;
00027
00028
00029 FUNCTION(HingeJoint,setAnchor)
00030 {
00031 Vector3f inAnchor;
00032
00033 if (
00034 (in.GetSize() == 0) ||
00035 (! in.GetValue(in.begin(), inAnchor))
00036 )
00037 {
00038 return false;
00039 }
00040
00041 obj->SetAnchor(inAnchor);
00042 return true;
00043 }
00044
00045 FUNCTION(HingeJoint,getAngle)
00046 {
00047 return obj->GetAngle();
00048 }
00049
00050 FUNCTION(HingeJoint,getAngleRate)
00051 {
00052 return obj->GetAngleRate();
00053 }
00054
00055 FUNCTION(HingeJoint,setAxis)
00056 {
00057
00058 int inAxis;
00059
00060
00061 if (
00062 (in.GetSize() == 0) ||
00063 (! in.GetValue(in.begin(), inAxis))
00064 )
00065 {
00066 return false;
00067 }
00068
00069 obj->SetAxis(static_cast<Joint::EAxisIndex>(inAxis));
00070 return true;
00071 }
00072
00073 void CLASS(HingeJoint)::DefineClass()
00074 {
00075 DEFINE_BASECLASS(oxygen/Joint);
00076 DEFINE_FUNCTION(setAnchor);
00077 DEFINE_FUNCTION(getAngle);
00078 DEFINE_FUNCTION(getAngleRate);
00079 DEFINE_FUNCTION(setAxis);
00080 }