00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __ASSCENECOMPONENT_H__
00017 #define __ASSCENECOMPONENT_H__
00018
00019
00020 #include "../../../dependencies.h"
00021
00022 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00023
00024 #include "../../ScriptHelper.h"
00025 #include "../../core/asEntityComponent.h"
00026
00027 #include "../../../components/scene/SceneComponent.h"
00028
00029
00031 extern void bindSceneComponent(asIScriptEngine *engine);
00032
00035 template<typename T>
00036 void bindSceneComponentBase(asIScriptEngine *engine, const char *type)
00037 {
00038
00039 int r;
00040 std::string sType = type;
00041
00042
00043 bindEntityComponentBase<SceneComponent>(engine, type);
00044
00045
00046 r = engine->RegisterObjectBehaviour("SceneComponent", asBEHAVE_REF_CAST, std::string(sType + "@ f()").c_str(),
00047 asFUNCTION((asRefCast<SceneComponent,T>)), asCALL_CDECL_OBJLAST); assert( r >= 0 );
00048 r = engine->RegisterObjectBehaviour(type, asBEHAVE_IMPLICIT_REF_CAST, std::string("SceneComponent@ f()").c_str(),
00049 asFUNCTION((asRefCast<T,SceneComponent>)), asCALL_CDECL_OBJLAST); assert( r >= 0 );
00050
00051
00052 r = engine->RegisterObjectMethod(type, "void addCollisionResponseAnimator(const vector3df &in, " \
00053 "const vector3df &in, const vector3df &in, f32)",
00054 asMETHOD(T, addCollisionResponseAnimator), asCALL_THISCALL); assert(r >= 0);
00055 r = engine->RegisterObjectMethod(type, "void addFlyCircleAnimator(const vector3df &in, f32, " \
00056 "f32, const vector3df &in)",
00057 asMETHOD(T, addFlyCircleAnimator), asCALL_THISCALL); assert(r >= 0);
00058 r = engine->RegisterObjectMethod(type, "void addFlyStraightAnimator(const vector3df &in, " \
00059 "const vector3df &in, u32, bool)",
00060 asMETHOD(T, addFlyStraightAnimator), asCALL_THISCALL); assert(r >= 0);
00061
00062 r = engine->RegisterObjectMethod(type, "void addToMetaSelector(Entity@)",
00063 asMETHODPR(T, addToMetaSelector, (Entity*), void), asCALL_THISCALL); assert(r >= 0);
00064 r = engine->RegisterObjectMethod(type, "void addToMetaSelector(SceneComponent@)",
00065 asMETHODPR(T, addToMetaSelector, (SceneComponent*), void), asCALL_THISCALL); assert(r >= 0);
00066
00067 r = engine->RegisterObjectMethod(type, "const vector3df& getAbsolutePosition()",
00068 asMETHOD(T, getAbsolutePosition), asCALL_THISCALL); assert(r >= 0);
00069 r = engine->RegisterObjectMethod(type, "E_CULLING_TYPE getAutomaticCulling()",
00070 asMETHOD(T, getAutomaticCulling), asCALL_THISCALL); assert(r >= 0);
00071 r = engine->RegisterObjectMethod(type, "const aabbox3df& getBoundingBox()",
00072 asMETHODPR(T, getBoundingBox, (void) const, const aabbox3df&), asCALL_THISCALL); assert(r >= 0);
00073 r = engine->RegisterObjectMethod(type, "u32 getMaterialCount()",
00074 asMETHOD(T, getMaterialCount), asCALL_THISCALL); assert(r >= 0);
00075 r = engine->RegisterObjectMethod(type, "const matrix4& getRelativeTransformation()",
00076 asMETHOD(T, getRelativeTransformation), asCALL_THISCALL); assert(r >= 0);
00077 r = engine->RegisterObjectMethod(type, "const vector3df& getPosition()",
00078 asMETHOD(T, getPosition), asCALL_THISCALL); assert(r >= 0);
00079 r = engine->RegisterObjectMethod(type, "const vector3df& getRotation()",
00080 asMETHOD(T, getRotation), asCALL_THISCALL); assert(r >= 0);
00081 r = engine->RegisterObjectMethod(type, "const vector3df& getScale()",
00082 asMETHOD(T, getScale), asCALL_THISCALL); assert(r >= 0);
00083
00084 r = engine->RegisterObjectMethod(type, "void removeAnimators()",
00085 asMETHOD(T, removeAnimators), asCALL_THISCALL); assert(r >= 0);
00086
00087 r = engine->RegisterObjectMethod(type, "void setAbsolutePosition(const vector3df &in)",
00088 asMETHOD(T, setAbsolutePosition), asCALL_THISCALL); assert(r >= 0);
00089 r = engine->RegisterObjectMethod(type, "void setAutomaticCulling(E_CULLING_TYPE)",
00090 asMETHOD(T, setAutomaticCulling), asCALL_THISCALL); assert(r >= 0);
00091 r = engine->RegisterObjectMethod(type, "void setCanAffectParent(bool)",
00092 asMETHOD(T, setCanAffectParent), asCALL_THISCALL); assert(r >= 0);
00093 r = engine->RegisterObjectMethod(type, "void setDebugDataVisible(s32)",
00094 asMETHOD(T, setDebugDataVisible), asCALL_THISCALL); assert(r >= 0);
00095 r = engine->RegisterObjectMethod(type, "void setMaterialFlag(E_MATERIAL_FLAG, bool)",
00096 asMETHOD(T, setMaterialFlag), asCALL_THISCALL); assert(r >= 0);
00097 r = engine->RegisterObjectMethod(type, "void setMaterialTexture(u32, const string &in)",
00098 asMETHODPR(T, setMaterialTexture, (u32 layer, const std::string &fileName), void),
00099 asCALL_THISCALL); assert(r >= 0);
00100 r = engine->RegisterObjectMethod(type, "void setMaterialType(E_MATERIAL_TYPE)",
00101 asMETHOD(T, setMaterialType), asCALL_THISCALL); assert(r >= 0);
00102 r = engine->RegisterObjectMethod(type, "void setPosition(const vector3df &in)",
00103 asMETHOD(T, setPosition), asCALL_THISCALL); assert(r >= 0);
00104 r = engine->RegisterObjectMethod(type, "void setRotation(const vector3df &in)",
00105 asMETHOD(T, setRotation), asCALL_THISCALL); assert(r >= 0);
00106 r = engine->RegisterObjectMethod(type, "void setScale(const vector3df &in)",
00107 asMETHOD(T, setScale), asCALL_THISCALL); assert(r >= 0);
00108 r = engine->RegisterObjectMethod(type, "void setVisible(bool)",
00109 asMETHOD(T, setVisible), asCALL_THISCALL); assert(r >= 0);
00110 }
00111
00112 #endif // __COMPILE_WITH_ANGELSCRIPT__
00113
00114 #endif