00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asAnimatedMeshComponent.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020
00021 #include "../../ScriptHelper.h"
00022 #include "asSceneComponent.h"
00023
00024 #include "../../../components/scene/AnimatedMeshComponent.h"
00025
00026
00028 AnimatedMeshComponent* createAnimatedMeshComponent(Entity *parent)
00029 {
00030 return new AnimatedMeshComponent(parent);
00031 }
00032
00034 AnimatedMeshComponent* createAnimatedMeshComponent(Entity *parent, const std::string &fileName,
00035 const vector3df &scale)
00036 {
00037 return new AnimatedMeshComponent(parent, fileName, scale);
00038 }
00039
00041 void bindAnimatedMeshComponent(asIScriptEngine *engine)
00042 {
00043
00044 int r;
00045
00046
00047 r = engine->RegisterObjectType("AnimatedMeshComponent", sizeof(AnimatedMeshComponent), asOBJ_REF); assert(r >= 0);
00048
00049
00050 bindSceneComponentBase<AnimatedMeshComponent>(engine, "AnimatedMeshComponent");
00051
00052
00053 r = engine->RegisterObjectBehaviour("AnimatedMeshComponent", asBEHAVE_FACTORY, "AnimatedMeshComponent@ f(Entity @+)",
00054 asFUNCTIONPR(createAnimatedMeshComponent, (Entity*), AnimatedMeshComponent*),
00055 asCALL_CDECL); assert(r >= 0);
00056 r = engine->RegisterObjectBehaviour("AnimatedMeshComponent", asBEHAVE_FACTORY, "AnimatedMeshComponent@ f(Entity @+, " \
00057 "const string &in, const vector3df &in)", asFUNCTIONPR(createAnimatedMeshComponent,
00058 (Entity*, const std::string&, const vector3df&), AnimatedMeshComponent*),
00059 asCALL_CDECL); assert(r >= 0);
00060
00061 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "AnimatedMeshComponent& opAssign(const AnimatedMeshComponent &in)",
00062 asFUNCTION(assignT<AnimatedMeshComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00063
00064
00065 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void animate()",
00066 asMETHOD(AnimatedMeshComponent, animate), asCALL_THISCALL); assert(r >= 0);
00067
00068 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "s32 getEndFrame()",
00069 asMETHOD(AnimatedMeshComponent, getEndFrame), asCALL_THISCALL); assert(r >= 0);
00070 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "f32 getFrame()",
00071 asMETHOD(AnimatedMeshComponent, getFrame), asCALL_THISCALL); assert(r >= 0);
00072 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "s32 getStartFrame()",
00073 asMETHOD(AnimatedMeshComponent, getStartFrame), asCALL_THISCALL); assert(r >= 0);
00074
00075 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setAnimationSpeed(f32)",
00076 asMETHOD(AnimatedMeshComponent, setAnimationSpeed), asCALL_THISCALL); assert(r >= 0);
00077 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setCurrentFrame(f32)",
00078 asMETHOD(AnimatedMeshComponent, setCurrentFrame), asCALL_THISCALL); assert(r >= 0);
00079 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setFrameLoop(s32, s32)",
00080 asMETHOD(AnimatedMeshComponent, setFrameLoop), asCALL_THISCALL); assert(r >= 0);
00081 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setLoopMode(bool)",
00082 asMETHOD(AnimatedMeshComponent, setLoopMode), asCALL_THISCALL); assert(r >= 0);
00083 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setMD2Animation(const string &in)",
00084 asMETHODPR(AnimatedMeshComponent, setMD2Animation, (const std::string&), void),
00085 asCALL_THISCALL); assert(r >= 0);
00086 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setMesh(const string &in)",
00087 asMETHODPR(AnimatedMeshComponent, setMesh, (const std::string&), void),
00088 asCALL_THISCALL); assert(r >= 0);
00089 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setShadowVolumeMesh(const string &in)",
00090 asMETHODPR(AnimatedMeshComponent, setShadowVolumeMesh, (const std::string&), void),
00091 asCALL_THISCALL); assert(r >= 0);
00092 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setShadowVolumeSceneNode(const string &in, " \
00093 "bool, f32)", asMETHODPR(AnimatedMeshComponent, setShadowVolumeSceneNode,
00094 (const std::string&, bool, f32), void), asCALL_THISCALL); assert(r >= 0);
00095 r = engine->RegisterObjectMethod("AnimatedMeshComponent", "void setTransitionTime(f32)",
00096 asMETHOD(AnimatedMeshComponent, setTransitionTime), asCALL_THISCALL); assert(r >= 0);
00097 }
00098
00099 #endif // __COMPILE_WITH_ANGELSCRIPT__
00100
00101