00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asMeshComponent.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020
00021 #include "../../ScriptHelper.h"
00022
00023
00025 MeshComponent* createMeshComponent(Entity *parent)
00026 {
00027 return new MeshComponent(parent);
00028 }
00029
00031 MeshComponent* createMeshComponent(Entity *parent, const std::string &fileName,
00032 const vector3df &scale)
00033 {
00034 return new MeshComponent(parent, fileName, scale);
00035 }
00036
00038 void bindMeshComponent(asIScriptEngine *engine)
00039 {
00040
00041 int r;
00042
00043
00044 r = engine->RegisterObjectType("MeshComponent", sizeof(MeshComponent), asOBJ_REF); assert(r >= 0);
00045
00046
00047 bindMeshComponentBase<MeshComponent>(engine, "MeshComponent");
00048
00049
00050 r = engine->RegisterObjectBehaviour("MeshComponent", asBEHAVE_FACTORY, "MeshComponent@ f(Entity @+)",
00051 asFUNCTIONPR(createMeshComponent, (Entity*), MeshComponent*), asCALL_CDECL); assert(r >= 0);
00052 r = engine->RegisterObjectBehaviour("MeshComponent", asBEHAVE_FACTORY, "MeshComponent@ f(Entity @+, const string &in, " \
00053 "const vector3df &in)", asFUNCTIONPR(createMeshComponent, (Entity*, const std::string&,
00054 const vector3df&), MeshComponent*), asCALL_CDECL); assert(r >= 0);
00055
00056 r = engine->RegisterObjectMethod("MeshComponent", "MeshComponent& opAssign(const MeshComponent &in)",
00057 asFUNCTION(assignT<MeshComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00058 }
00059
00060 #endif // __COMPILE_WITH_ANGELSCRIPT__
00061
00062