00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asLightComponent.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020
00021 #include "../../ScriptHelper.h"
00022 #include "asSceneComponent.h"
00023
00024 #include "../../../components/scene/LightComponent.h"
00025
00026
00028 LightComponent* createLightComponent(Entity *parent)
00029 {
00030 return new LightComponent(parent);
00031 }
00032
00034 LightComponent* createLightComponent(Entity *parent, const SColor &color, f32 radius)
00035 {
00036 return new LightComponent(parent, color, radius);
00037 }
00038
00040 void bindLightComponent(asIScriptEngine *engine)
00041 {
00042
00043 int r;
00044
00045
00046 r = engine->RegisterObjectType("LightComponent", sizeof(LightComponent), asOBJ_REF); assert(r >= 0);
00047
00048
00049 bindSceneComponentBase<LightComponent>(engine, "LightComponent");
00050
00051
00052 r = engine->RegisterObjectBehaviour("LightComponent", asBEHAVE_FACTORY, "LightComponent@ f(Entity @+)",
00053 asFUNCTIONPR(createLightComponent, (Entity*), LightComponent*),
00054 asCALL_CDECL); assert(r >= 0);
00055 r = engine->RegisterObjectBehaviour("LightComponent", asBEHAVE_FACTORY, "LightComponent@ f(Entity @+, " \
00056 "const SColor&in, f32)",asFUNCTIONPR(createLightComponent,
00057 (Entity*, const SColor &color, f32), LightComponent*), asCALL_CDECL);
00058 assert(r >= 0);
00059
00060 r = engine->RegisterObjectMethod("LightComponent", "LightComponent& opAssign(const LightComponent &in)",
00061 asFUNCTION(assignT<LightComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00062
00063
00064 r = engine->RegisterObjectMethod("LightComponent", "bool getCastShadow()",
00065 asMETHOD(LightComponent, getCastShadow), asCALL_THISCALL); assert(r >= 0);
00066 r = engine->RegisterObjectMethod("LightComponent", "E_LIGHT_TYPE getLightType()",
00067 asMETHOD(LightComponent, getLightType), asCALL_THISCALL); assert(r >= 0);
00068 r = engine->RegisterObjectMethod("LightComponent", "f32 getRadius()",
00069 asMETHOD(LightComponent, getRadius), asCALL_THISCALL); assert(r >= 0);
00070
00071 r = engine->RegisterObjectMethod("LightComponent", "void setCastShadow(bool)",
00072 asMETHOD(LightComponent, setCastShadow), asCALL_THISCALL); assert(r >= 0);
00073 r = engine->RegisterObjectMethod("LightComponent", "void setLightType(E_LIGHT_TYPE)",
00074 asMETHOD(LightComponent, setLightType), asCALL_THISCALL); assert(r >= 0);
00075 r = engine->RegisterObjectMethod("LightComponent", "void setRadius(f32)",
00076 asMETHOD(LightComponent, setRadius), asCALL_THISCALL); assert(r >= 0);
00077 }
00078
00079 #endif // __COMPILE_WITH_ANGELSCRIPT__
00080
00081