|
|
@@ -64,11 +64,9 @@ int lua_BoundingBox__gc(lua_State* state)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox__gc - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_BoundingBox__gc - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -110,116 +108,128 @@ int lua_BoundingBox__init(lua_State* state)
|
|
|
}
|
|
|
case 1:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(1, "BoundingBox", true);
|
|
|
-
|
|
|
- void* returnPtr = (void*)new BoundingBox(*param1);
|
|
|
- if (returnPtr)
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
|
|
|
{
|
|
|
- ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
- object->instance = returnPtr;
|
|
|
- object->owns = true;
|
|
|
- luaL_getmetatable(state, "BoundingBox");
|
|
|
- lua_setmetatable(state, -2);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushnil(state);
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(1, "BoundingBox", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ void* returnPtr = (void*)new BoundingBox(*param1);
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = true;
|
|
|
+ luaL_getmetatable(state, "BoundingBox");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
}
|
|
|
+ } while (0);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
case 2:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true);
|
|
|
-
|
|
|
- // Get parameter 2 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
|
|
|
-
|
|
|
- void* returnPtr = (void*)new BoundingBox(*param1, *param2);
|
|
|
- if (returnPtr)
|
|
|
- {
|
|
|
- ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
- object->instance = returnPtr;
|
|
|
- object->owns = true;
|
|
|
- luaL_getmetatable(state, "BoundingBox");
|
|
|
- lua_setmetatable(state, -2);
|
|
|
- }
|
|
|
- else
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
{
|
|
|
- lua_pushnil(state);
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ bool param2Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, ¶m2Valid);
|
|
|
+ if (!param2Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ void* returnPtr = (void*)new BoundingBox(*param1, *param2);
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = true;
|
|
|
+ luaL_getmetatable(state, "BoundingBox");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
}
|
|
|
+ } while (0);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
case 6:
|
|
|
{
|
|
|
- if (lua_type(state, 1) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 5) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 6) == LUA_TNUMBER)
|
|
|
- {
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- float param1 = (float)luaL_checknumber(state, 1);
|
|
|
-
|
|
|
- // Get parameter 2 off the stack.
|
|
|
- float param2 = (float)luaL_checknumber(state, 2);
|
|
|
-
|
|
|
- // Get parameter 3 off the stack.
|
|
|
- float param3 = (float)luaL_checknumber(state, 3);
|
|
|
-
|
|
|
- // Get parameter 4 off the stack.
|
|
|
- float param4 = (float)luaL_checknumber(state, 4);
|
|
|
-
|
|
|
- // Get parameter 5 off the stack.
|
|
|
- float param5 = (float)luaL_checknumber(state, 5);
|
|
|
-
|
|
|
- // Get parameter 6 off the stack.
|
|
|
- float param6 = (float)luaL_checknumber(state, 6);
|
|
|
-
|
|
|
- void* returnPtr = (void*)new BoundingBox(param1, param2, param3, param4, param5, param6);
|
|
|
- if (returnPtr)
|
|
|
- {
|
|
|
- ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
- object->instance = returnPtr;
|
|
|
- object->owns = true;
|
|
|
- luaL_getmetatable(state, "BoundingBox");
|
|
|
- lua_setmetatable(state, -2);
|
|
|
- }
|
|
|
- else
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 5) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 6) == LUA_TNUMBER)
|
|
|
{
|
|
|
- lua_pushnil(state);
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 1);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float param4 = (float)luaL_checknumber(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ float param5 = (float)luaL_checknumber(state, 5);
|
|
|
+
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ float param6 = (float)luaL_checknumber(state, 6);
|
|
|
+
|
|
|
+ void* returnPtr = (void*)new BoundingBox(param1, param2, param3, param4, param5, param6);
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = true;
|
|
|
+ luaL_getmetatable(state, "BoundingBox");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
}
|
|
|
+ } while (0);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox__init - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -242,50 +252,55 @@ int lua_BoundingBox_getCenter(lua_State* state)
|
|
|
{
|
|
|
case 1:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
+ do
|
|
|
{
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- void* returnPtr = (void*)new Vector3(instance->getCenter());
|
|
|
- if (returnPtr)
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA))
|
|
|
{
|
|
|
- ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
- object->instance = returnPtr;
|
|
|
- object->owns = true;
|
|
|
- luaL_getmetatable(state, "Vector3");
|
|
|
- lua_setmetatable(state, -2);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushnil(state);
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ void* returnPtr = (void*)new Vector3(instance->getCenter());
|
|
|
+ if (returnPtr)
|
|
|
+ {
|
|
|
+ ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
|
|
|
+ object->instance = returnPtr;
|
|
|
+ object->owns = true;
|
|
|
+ luaL_getmetatable(state, "Vector3");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushnil(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 1;
|
|
|
}
|
|
|
+ } while (0);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_getCenter - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_getCenter - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
case 2:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->getCenter(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->getCenter(param1);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_getCenter - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_getCenter - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -312,18 +327,22 @@ int lua_BoundingBox_getCorners(lua_State* state)
|
|
|
(lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
|
|
|
{
|
|
|
// Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false);
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
|
|
|
BoundingBox* instance = getInstance(state);
|
|
|
instance->getCorners(param1);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_getCorners - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_getCorners - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -346,81 +365,113 @@ int lua_BoundingBox_intersects(lua_State* state)
|
|
|
{
|
|
|
case 2:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- bool result = instance->intersects(*param1);
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ bool result = instance->intersects(*param1);
|
|
|
|
|
|
- // Push the return value onto the stack.
|
|
|
- lua_pushboolean(state, result);
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
+
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- bool result = instance->intersects(*param1);
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ bool result = instance->intersects(*param1);
|
|
|
|
|
|
- // Push the return value onto the stack.
|
|
|
- lua_pushboolean(state, result);
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
+
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Frustum> param1 = ScriptUtil::getObjectPointer<Frustum>(2, "Frustum", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Frustum> param1 = ScriptUtil::getObjectPointer<Frustum>(2, "Frustum", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- bool result = instance->intersects(*param1);
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ bool result = instance->intersects(*param1);
|
|
|
|
|
|
- // Push the return value onto the stack.
|
|
|
- lua_pushboolean(state, result);
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
+
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Plane> param1 = ScriptUtil::getObjectPointer<Plane>(2, "Plane", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Plane> param1 = ScriptUtil::getObjectPointer<Plane>(2, "Plane", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- float result = instance->intersects(*param1);
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ float result = instance->intersects(*param1);
|
|
|
|
|
|
- // Push the return value onto the stack.
|
|
|
- lua_pushnumber(state, result);
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
+
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Ray> param1 = ScriptUtil::getObjectPointer<Ray>(2, "Ray", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Ray> param1 = ScriptUtil::getObjectPointer<Ray>(2, "Ray", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- float result = instance->intersects(*param1);
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ float result = instance->intersects(*param1);
|
|
|
|
|
|
- // Push the return value onto the stack.
|
|
|
- lua_pushnumber(state, result);
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
|
|
|
- return 1;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_intersects - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_intersects - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -453,11 +504,9 @@ int lua_BoundingBox_isEmpty(lua_State* state)
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_isEmpty - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_isEmpty - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -483,7 +532,13 @@ int lua_BoundingBox_max(lua_State* state)
|
|
|
if (lua_gettop(state) == 2)
|
|
|
{
|
|
|
// Get parameter 2 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
|
|
|
+ bool param2Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, ¶m2Valid);
|
|
|
+ if (!param2Valid)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to convert parameter 2 to type 'Vector3'.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
|
|
|
instance->max = *param2;
|
|
|
return 0;
|
|
|
@@ -518,33 +573,44 @@ int lua_BoundingBox_merge(lua_State* state)
|
|
|
{
|
|
|
case 2:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->merge(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->merge(*param1);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->merge(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->merge(*param1);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_merge - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_merge - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -570,7 +636,13 @@ int lua_BoundingBox_min(lua_State* state)
|
|
|
if (lua_gettop(state) == 2)
|
|
|
{
|
|
|
// Get parameter 2 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
|
|
|
+ bool param2Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, ¶m2Valid);
|
|
|
+ if (!param2Valid)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to convert parameter 2 to type 'Vector3'.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
|
|
|
instance->min = *param2;
|
|
|
return 0;
|
|
|
@@ -605,97 +677,116 @@ int lua_BoundingBox_set(lua_State* state)
|
|
|
{
|
|
|
case 2:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingBox> param1 = ScriptUtil::getObjectPointer<BoundingBox>(2, "BoundingBox", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->set(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->set(*param1);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<BoundingSphere> param1 = ScriptUtil::getObjectPointer<BoundingSphere>(2, "BoundingSphere", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->set(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->set(*param1);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
case 3:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
|
|
|
- (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
|
|
|
+ do
|
|
|
{
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true);
|
|
|
-
|
|
|
- // Get parameter 2 off the stack.
|
|
|
- ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true);
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
|
|
|
+ (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param1 = ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ bool param2Valid;
|
|
|
+ ScriptUtil::LuaArray<Vector3> param2 = ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true, ¶m2Valid);
|
|
|
+ if (!param2Valid)
|
|
|
+ break;
|
|
|
+
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->set(*param1, *param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->set(*param1, *param2);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
case 7:
|
|
|
{
|
|
|
- if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
- lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 5) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 6) == LUA_TNUMBER &&
|
|
|
- lua_type(state, 7) == LUA_TNUMBER)
|
|
|
- {
|
|
|
- // Get parameter 1 off the stack.
|
|
|
- float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 5) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 6) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 7) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
|
|
|
- // Get parameter 2 off the stack.
|
|
|
- float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
|
|
|
- // Get parameter 3 off the stack.
|
|
|
- float param3 = (float)luaL_checknumber(state, 4);
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 4);
|
|
|
|
|
|
- // Get parameter 4 off the stack.
|
|
|
- float param4 = (float)luaL_checknumber(state, 5);
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float param4 = (float)luaL_checknumber(state, 5);
|
|
|
|
|
|
- // Get parameter 5 off the stack.
|
|
|
- float param5 = (float)luaL_checknumber(state, 6);
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ float param5 = (float)luaL_checknumber(state, 6);
|
|
|
|
|
|
- // Get parameter 6 off the stack.
|
|
|
- float param6 = (float)luaL_checknumber(state, 7);
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ float param6 = (float)luaL_checknumber(state, 7);
|
|
|
|
|
|
- BoundingBox* instance = getInstance(state);
|
|
|
- instance->set(param1, param2, param3, param4, param5, param6);
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+ BoundingBox* instance = getInstance(state);
|
|
|
+ instance->set(param1, param2, param3, param4, param5, param6);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ } while (0);
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_set - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
@@ -759,18 +850,22 @@ int lua_BoundingBox_transform(lua_State* state)
|
|
|
(lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
|
|
|
{
|
|
|
// Get parameter 1 off the stack.
|
|
|
- ScriptUtil::LuaArray<Matrix> param1 = ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true);
|
|
|
+ bool param1Valid;
|
|
|
+ ScriptUtil::LuaArray<Matrix> param1 = ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, ¶m1Valid);
|
|
|
+ if (!param1Valid)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
|
|
|
BoundingBox* instance = getInstance(state);
|
|
|
instance->transform(*param1);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- lua_pushstring(state, "lua_BoundingBox_transform - Failed to match the given parameters to a valid function signature.");
|
|
|
- lua_error(state);
|
|
|
- }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_BoundingBox_transform - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
break;
|
|
|
}
|
|
|
default:
|