|
@@ -1292,13 +1292,23 @@ static void RegisterZone(asIScriptEngine* engine)
|
|
|
engine->RegisterObjectMethod("Zone", "Texture@+ get_zoneTexture() const", asMETHOD(Zone, GetZoneTexture), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("Zone", "Texture@+ get_zoneTexture() const", asMETHOD(Zone, GetZoneTexture), asCALL_THISCALL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static void StaticModelSetModel(Model* model, StaticModel* ptr)
|
|
|
|
|
+{
|
|
|
|
|
+ // Check type here to allow operating on both AnimatedModel and StaticModel without calling the wrong function,
|
|
|
|
|
+ // as AnimatedModel can be cast to StaticModel
|
|
|
|
|
+ if (ptr->GetType() == AnimatedModel::GetTypeStatic())
|
|
|
|
|
+ static_cast<AnimatedModel*>(ptr)->SetModel(model);
|
|
|
|
|
+ else
|
|
|
|
|
+ ptr->SetModel(model);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void RegisterStaticModel(asIScriptEngine* engine)
|
|
static void RegisterStaticModel(asIScriptEngine* engine)
|
|
|
{
|
|
{
|
|
|
RegisterDrawable<StaticModel>(engine, "StaticModel");
|
|
RegisterDrawable<StaticModel>(engine, "StaticModel");
|
|
|
engine->RegisterObjectMethod("StaticModel", "void ApplyMaterialList(const String&in fileName = String())", asMETHOD(StaticModel, ApplyMaterialList), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("StaticModel", "void ApplyMaterialList(const String&in fileName = String())", asMETHOD(StaticModel, ApplyMaterialList), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("StaticModel", "bool IsInside(const Vector3&in) const", asMETHOD(StaticModel, IsInside), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("StaticModel", "bool IsInside(const Vector3&in) const", asMETHOD(StaticModel, IsInside), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("StaticModel", "bool IsInsideLocal(const Vector3&in) const", asMETHOD(StaticModel, IsInsideLocal), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("StaticModel", "bool IsInsideLocal(const Vector3&in) const", asMETHOD(StaticModel, IsInsideLocal), asCALL_THISCALL);
|
|
|
- engine->RegisterObjectMethod("StaticModel", "void set_model(Model@+)", asMETHOD(StaticModel, SetModel), asCALL_THISCALL);
|
|
|
|
|
|
|
+ engine->RegisterObjectMethod("StaticModel", "void set_model(Model@+)", asFUNCTION(StaticModelSetModel), asCALL_CDECL_OBJLAST);
|
|
|
engine->RegisterObjectMethod("StaticModel", "Model@+ get_model() const", asMETHOD(StaticModel, GetModel), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("StaticModel", "Model@+ get_model() const", asMETHOD(StaticModel, GetModel), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("StaticModel", "void set_material(Material@+)", asMETHODPR(StaticModel, SetMaterial, (Material*), void), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("StaticModel", "void set_material(Material@+)", asMETHODPR(StaticModel, SetMaterial, (Material*), void), asCALL_THISCALL);
|
|
|
engine->RegisterObjectMethod("StaticModel", "bool set_materials(uint, Material@+)", asMETHODPR(StaticModel, SetMaterial, (unsigned, Material*), bool), asCALL_THISCALL);
|
|
engine->RegisterObjectMethod("StaticModel", "bool set_materials(uint, Material@+)", asMETHODPR(StaticModel, SetMaterial, (unsigned, Material*), bool), asCALL_THISCALL);
|