コード例 #1
0
ファイル: lModel.cpp プロジェクト: wang35666/LightWorld
static int model_getposition(lua_State* L){
    Model* cobj = *reinterpret_cast<Model**>(lua_touserdata(L, 1));
    if (!cobj) {
        luaL_error(L,"invalid 'cobj' in function 'GetPosition'", nullptr);
        return 0;
    }

    int argc = lua_gettop(L)-1;
    if (argc == 0) {
        Vec3 ret = cobj->GetPosition();
        Lua_PushVec3(L, ret.x, ret.y, ret.z);
        return 1;
    }

    return 0;
}