00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asOctTreeComponent.h"
00018
00019
00020 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00021
00022 #include "../../ScriptHelper.h"
00023 #include "asSceneComponent.h"
00024
00025 #include "../../../components/scene/OctTreeComponent.h"
00026
00027
00029 OctTreeComponent* createOctTreeComponent(Entity *parent)
00030 {
00031 return new OctTreeComponent(parent);
00032 }
00033
00035 OctTreeComponent* createOctTreeComponent(Entity *parent, s32 minPolysPerNode)
00036 {
00037 return new OctTreeComponent(parent, minPolysPerNode);
00038 }
00039
00041 OctTreeComponent* createOctTreeComponent(Entity *parent, const std::string &fileName,
00042 s32 minPolysPerNode)
00043 {
00044 return new OctTreeComponent(parent, fileName, minPolysPerNode);
00045 }
00046
00048 void bindOctTreeComponent(asIScriptEngine *engine)
00049 {
00050
00051 int r;
00052
00053
00054 r = engine->RegisterObjectType("OctTreeComponent", sizeof(OctTreeComponent), asOBJ_REF); assert(r >= 0);
00055
00056
00057 bindSceneComponentBase<OctTreeComponent>(engine, "OctTreeComponent");
00058
00059
00060 r = engine->RegisterObjectBehaviour("OctTreeComponent", asBEHAVE_FACTORY, "OctTreeComponent@ f(Entity @+)",
00061 asFUNCTIONPR(createOctTreeComponent, (Entity*), OctTreeComponent*),
00062 asCALL_CDECL); assert(r >= 0);
00063 r = engine->RegisterObjectBehaviour("OctTreeComponent", asBEHAVE_FACTORY, "OctTreeComponent@ f(Entity @+, s32)",
00064 asFUNCTIONPR(createOctTreeComponent, (Entity*, s32), OctTreeComponent*),
00065 asCALL_CDECL); assert(r >= 0);
00066 r = engine->RegisterObjectBehaviour("OctTreeComponent", asBEHAVE_FACTORY, "OctTreeComponent@ f(Entity @+, " \
00067 "const string &in, s32)",
00068 asFUNCTIONPR(createOctTreeComponent, (Entity*, const std::string&,
00069 s32), OctTreeComponent*), asCALL_CDECL); assert(r >= 0);
00070
00071 r = engine->RegisterObjectMethod("OctTreeComponent", "OctTreeComponent& opAssign(const OctTreeComponent &in)",
00072 asFUNCTION(assignT<OctTreeComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00073 }
00074
00075 #endif // __COMPILE_WITH_ANGELSCRIPT__
00076
00077