00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "camera.h"
00023
00024 using namespace boost;
00025 using namespace oxygen;
00026 using namespace zeitgeist;
00027
00028 FUNCTION(Camera,setViewport)
00029 {
00030 int inX;
00031 int inY;
00032 int inWidth;
00033 int inHeight;
00034
00035 if (
00036 (in.GetSize() != 4) ||
00037 (! in.GetValue(in[0],inX)) ||
00038 (! in.GetValue(in[1],inY)) ||
00039 (! in.GetValue(in[2],inWidth)) ||
00040 (! in.GetValue(in[3],inHeight))
00041 )
00042 {
00043 return false;
00044 }
00045
00046 obj->SetViewport(inX,inY,inWidth,inHeight);
00047 return true;
00048 }
00049
00050 FUNCTION(Camera,getViewportX)
00051 {
00052 return obj->GetViewportX();
00053 }
00054
00055 FUNCTION(Camera,getViewportY)
00056 {
00057 return obj->GetViewportY();
00058 }
00059
00060 FUNCTION(Camera,getViewportWidth)
00061 {
00062 return obj->GetViewportWidth();
00063 }
00064
00065 FUNCTION(Camera,getViewportHeight)
00066 {
00067 return obj->GetViewportHeight();
00068 }
00069
00070 FUNCTION(Camera,setFOV)
00071 {
00072 float inFov;
00073
00074 if (
00075 (in.GetSize() != 1) ||
00076 (! in.GetValue(in.begin(), inFov))
00077 )
00078 {
00079 return false;
00080 }
00081
00082 obj->SetFOV(inFov);
00083 return true;
00084 }
00085
00086 FUNCTION(Camera,getFOV)
00087 {
00088 return obj->GetFOV();
00089 }
00090
00091 FUNCTION(Camera,setZNear)
00092 {
00093 float inZNear;
00094
00095 if (
00096 (in.GetSize() != 1) ||
00097 (! in.GetValue(in.begin(), inZNear))
00098 )
00099 {
00100 return false;
00101 }
00102
00103 obj->SetZNear(inZNear);
00104 return true;
00105 }
00106
00107 FUNCTION(Camera,adjustZNear)
00108 {
00109 float inZNear;
00110
00111 if (
00112 (in.GetSize() != 1) ||
00113 (! in.GetValue(in.begin(), inZNear))
00114 )
00115 {
00116 return false;
00117 }
00118
00119 obj->AdjustZNear(inZNear);
00120 return true;
00121 }
00122
00123 FUNCTION(Camera,getZNear)
00124 {
00125 return obj->GetZNear();
00126 }
00127
00128 FUNCTION(Camera,setZFar)
00129 {
00130 float inZFar;
00131
00132 if (
00133 (in.GetSize() != 1) ||
00134 (! in.GetValue(in.begin(), inZFar))
00135 )
00136 {
00137 return false;
00138 }
00139
00140 obj->SetZFar(inZFar);
00141 return true;
00142 }
00143
00144 FUNCTION(Camera,adjustZFar)
00145 {
00146 float inZFar;
00147
00148 if (
00149 (in.GetSize() != 1) ||
00150 (! in.GetValue(in.begin(), inZFar))
00151 )
00152 {
00153 return false;
00154 }
00155
00156 obj->AdjustZFar(inZFar);
00157 return true;
00158 }
00159
00160 FUNCTION(Camera,getZFar)
00161 {
00162 return obj->GetZFar();
00163 }
00164
00165 void CLASS(Camera)::DefineClass()
00166 {
00167 DEFINE_BASECLASS(oxygen/BaseNode);
00168 DEFINE_FUNCTION(setViewport);
00169 DEFINE_FUNCTION(getViewportX);
00170 DEFINE_FUNCTION(getViewportY);
00171 DEFINE_FUNCTION(getViewportWidth);
00172 DEFINE_FUNCTION(getViewportHeight);
00173 DEFINE_FUNCTION(setFOV);
00174 DEFINE_FUNCTION(getFOV);
00175 DEFINE_FUNCTION(setZNear);
00176 DEFINE_FUNCTION(adjustZNear);
00177 DEFINE_FUNCTION(getZNear);
00178 DEFINE_FUNCTION(setZFar);
00179 DEFINE_FUNCTION(adjustZFar);
00180 DEFINE_FUNCTION(getZFar);
00181 }