00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asCameraComponent.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020
00021 #include "../../ScriptHelper.h"
00022 #include "asSceneComponent.h"
00023
00024 #include "../../../components/scene/CameraComponent.h"
00025
00026
00028 CameraComponent* createCameraComponent(Entity *parent)
00029 {
00030 return new CameraComponent(parent);
00031 }
00032
00034 CameraComponent* createCameraComponent(Entity *parent, const vector3df &lookat)
00035 {
00036 return new CameraComponent(parent, lookat);
00037 }
00038
00040 void bindCameraComponent(asIScriptEngine *engine)
00041 {
00042
00043 int r;
00044
00045
00046 r = engine->RegisterObjectType("CameraComponent", sizeof(CameraComponent), asOBJ_REF); assert(r >= 0);
00047
00048
00049 bindSceneComponentBase<CameraComponent>(engine, "CameraComponent");
00050
00051
00052 r = engine->RegisterObjectBehaviour("CameraComponent", asBEHAVE_FACTORY, "CameraComponent@ f(Entity @+)",
00053 asFUNCTIONPR(createCameraComponent, (Entity*), CameraComponent*),
00054 asCALL_CDECL); assert(r >= 0);
00055 r = engine->RegisterObjectBehaviour("CameraComponent", asBEHAVE_FACTORY, "CameraComponent@ f(Entity @+, " \
00056 "const vector3df &in)", asFUNCTIONPR(createCameraComponent,
00057 (Entity*, const vector3df&), CameraComponent*), asCALL_CDECL); assert(r >= 0);
00058
00059 r = engine->RegisterObjectMethod("CameraComponent", "CameraComponent& opAssign(const CameraComponent &in)",
00060 asFUNCTION(assignT<CameraComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00061
00062
00063 r = engine->RegisterObjectMethod("CameraComponent", "void bindTargetAndRotation(bool)",
00064 asMETHOD(CameraComponent, bindTargetAndRotation), asCALL_THISCALL); assert(r >= 0);
00065 r = engine->RegisterObjectMethod("CameraComponent", "bool getTargetAndRotationBinding()",
00066 asMETHOD(CameraComponent, getTargetAndRotationBinding), asCALL_THISCALL); assert(r >= 0);
00067
00068 r = engine->RegisterObjectMethod("CameraComponent", "f32 getAspectRatio()",
00069 asMETHOD(CameraComponent, getAspectRatio), asCALL_THISCALL); assert(r >= 0);
00070 r = engine->RegisterObjectMethod("CameraComponent", "f32 getFarValue()",
00071 asMETHOD(CameraComponent, getFarValue), asCALL_THISCALL); assert(r >= 0);
00072 r = engine->RegisterObjectMethod("CameraComponent", "f32 getFOV()",
00073 asMETHOD(CameraComponent, getFOV), asCALL_THISCALL); assert(r >= 0);
00074 r = engine->RegisterObjectMethod("CameraComponent", "f32 getNearValue()",
00075 asMETHOD(CameraComponent, getNearValue), asCALL_THISCALL); assert(r >= 0);
00076 r = engine->RegisterObjectMethod("CameraComponent", "const matrix4& getProjectionMatrix()",
00077 asMETHOD(CameraComponent, getProjectionMatrix), asCALL_THISCALL); assert(r >= 0);
00078 r = engine->RegisterObjectMethod("CameraComponent", "const vector3df& getTarget()",
00079 asMETHOD(CameraComponent, getTarget), asCALL_THISCALL); assert(r >= 0);
00080 r = engine->RegisterObjectMethod("CameraComponent", "const vector3df& getUpVector()",
00081 asMETHOD(CameraComponent, getUpVector), asCALL_THISCALL); assert(r >= 0);
00082 r = engine->RegisterObjectMethod("CameraComponent", "const matrix4& getViewMatrix()",
00083 asMETHOD(CameraComponent, getViewMatrix), asCALL_THISCALL); assert(r >= 0);
00084 r = engine->RegisterObjectMethod("CameraComponent", "bool getIsOrthogonal()",
00085 asMETHOD(CameraComponent, getIsOrthogonal), asCALL_THISCALL); assert(r >= 0);
00086
00087 r = engine->RegisterObjectMethod("CameraComponent", "void setAsMainCamera()",
00088 asMETHOD(CameraComponent, setAsMainCamera), asCALL_THISCALL); assert(r >= 0);
00089 r = engine->RegisterObjectMethod("CameraComponent", "void setAspectRatio(f32)",
00090 asMETHOD(CameraComponent, setAspectRatio), asCALL_THISCALL); assert(r >= 0);
00091 r = engine->RegisterObjectMethod("CameraComponent", "void setFarValue(f32)",
00092 asMETHOD(CameraComponent, setFarValue), asCALL_THISCALL); assert(r >= 0);
00093 r = engine->RegisterObjectMethod("CameraComponent", "void setFOV(f32)",
00094 asMETHOD(CameraComponent, setFOV), asCALL_THISCALL); assert(r >= 0);
00095 r = engine->RegisterObjectMethod("CameraComponent", "void setNearValue(f32)",
00096 asMETHOD(CameraComponent, setNearValue), asCALL_THISCALL); assert(r >= 0);
00097 r = engine->RegisterObjectMethod("CameraComponent", "void setProjectionMatrix(const matrix4 &in, bool)",
00098 asMETHOD(CameraComponent, setProjectionMatrix), asCALL_THISCALL); assert(r >= 0);
00099 r = engine->RegisterObjectMethod("CameraComponent", "void setRotation(const vector3df &in)",
00100 asMETHOD(CameraComponent, setRotation), asCALL_THISCALL); assert(r >= 0);
00101 r = engine->RegisterObjectMethod("CameraComponent", "void setTarget(const vector3df &in)",
00102 asMETHOD(CameraComponent, setTarget), asCALL_THISCALL); assert(r >= 0);
00103 r = engine->RegisterObjectMethod("CameraComponent", "void setUpVector(const vector3df &in)",
00104 asMETHOD(CameraComponent, setUpVector), asCALL_THISCALL); assert(r >= 0);
00105
00106 r = engine->RegisterObjectMethod("CameraComponent", "void setNormalMode()",
00107 asMETHOD(CameraComponent, setNormalMode), asCALL_THISCALL); assert(r >= 0);
00108 r = engine->RegisterObjectMethod("CameraComponent", "void setFPSMode(f32, f32, bool, f32)",
00109 asMETHOD(CameraComponent, setFPSMode), asCALL_THISCALL); assert(r >= 0);
00110 r = engine->RegisterObjectMethod("CameraComponent", "void setMayaMode(f32, f32, f32)",
00111 asMETHOD(CameraComponent, setMayaMode), asCALL_THISCALL); assert(r >= 0);
00112 }
00113
00114 #endif // __COMPILE_WITH_ANGELSCRIPT__
00115
00116