00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "transform.h"
00024
00025 using namespace boost;
00026 using namespace oxygen;
00027 using namespace zeitgeist;
00028 using namespace salt;
00029
00030 FUNCTION(Transform,setLocalPos)
00031 {
00032 Vector3f inPos;
00033
00034 if (
00035 (in.GetSize() == 0) ||
00036 (! in.GetValue(in.begin(), inPos))
00037 )
00038 {
00039 return false;
00040 }
00041
00042 obj->SetLocalPos(inPos);
00043 return true;
00044 }
00045
00046 FUNCTION(Transform,setLocalRotation)
00047 {
00048 Vector3f inRot;
00049
00050 if (
00051 (in.GetSize() == 0) ||
00052 (! in.GetValue(in.begin(), inRot))
00053 )
00054 {
00055 return false;
00056 }
00057
00058 obj->SetLocalRotation(inRot);
00059 return true;
00060 }
00061
00062 FUNCTION(Transform,setLocalTransform)
00063 {
00064
00065
00066
00067
00068
00069 if (in.GetSize() != 16)
00070 {
00071 return false;
00072 }
00073
00074 float m[16];
00075
00076 ParameterList::TVector::const_iterator iter = in.begin();
00077 for (int i=0;i<16;++i)
00078 {
00079 if (! in.GetValue(iter,m[i]))
00080 {
00081 return false;
00082 }
00083 ++iter;
00084 }
00085
00086 obj->SetLocalTransform(Matrix(m));
00087 return true;
00088 }
00089
00090 void CLASS(Transform)::DefineClass()
00091 {
00092 DEFINE_BASECLASS(oxygen/BaseNode);
00093 DEFINE_FUNCTION(setLocalPos);
00094 DEFINE_FUNCTION(setLocalRotation);
00095 DEFINE_FUNCTION(setLocalTransform);
00096 }