00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "planecollider.h"
00023
00024 using namespace boost;
00025 using namespace zeitgeist;
00026 using namespace oxygen;
00027 using namespace salt;
00028
00029 FUNCTION(PlaneCollider,setParams)
00030 {
00031 if (in.GetSize() == 4)
00032 {
00033
00034 float inF[4];
00035 int i;
00036 for (i=0;i<4;++i)
00037 {
00038 if (! in.GetValue(in[i],inF[i]))
00039 {
00040 break;
00041 }
00042 }
00043
00044 if (i == 4)
00045 {
00046 obj->SetParams(inF[0],inF[1],inF[2],inF[3]);
00047 return true;
00048 }
00049 }
00050
00051
00052 Vector3f inPos;
00053 Vector3f inNormal;
00054
00055 ParameterList::TVector::const_iterator iter = in.begin();
00056 if (
00057 (! in.AdvanceValue(iter,inPos)) ||
00058 (! in.AdvanceValue(iter,inNormal))
00059 )
00060 {
00061 return false;
00062 }
00063
00064 obj->SetParams(inPos,inNormal);
00065 return true;
00066 }
00067
00068 FUNCTION(PlaneCollider,getPointDepth)
00069 {
00070 Vector3f inPos;
00071
00072 if (
00073 (in.GetSize() == 0) ||
00074 (! in.GetValue(in.begin(), inPos))
00075 )
00076 {
00077 return 0;
00078 }
00079
00080 return obj->GetPointDepth(inPos);
00081 }
00082
00083 void CLASS(PlaneCollider)::DefineClass()
00084 {
00085 DEFINE_BASECLASS(oxygen/Collider);
00086 DEFINE_FUNCTION(setParams);
00087 DEFINE_FUNCTION(getPointDepth);
00088 }