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