|
|
@@ -44,6 +44,7 @@ void luaRegister_Game()
|
|
|
{"getGamepadCount", lua_Game_getGamepadCount},
|
|
|
{"getHeight", lua_Game_getHeight},
|
|
|
{"getPhysicsController", lua_Game_getPhysicsController},
|
|
|
+ {"getRawSensorValues", lua_Game_getRawSensorValues},
|
|
|
{"getScriptController", lua_Game_getScriptController},
|
|
|
{"getState", lua_Game_getState},
|
|
|
{"getViewport", lua_Game_getViewport},
|
|
|
@@ -1069,6 +1070,62 @@ int lua_Game_getPhysicsController(lua_State* state)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int lua_Game_getRawSensorValues(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 7:
|
|
|
+ {
|
|
|
+ if ((lua_type(state, 1) == LUA_TUSERDATA) &&
|
|
|
+ (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA))
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ gameplay::ScriptUtil::LuaArray<float> param2 = gameplay::ScriptUtil::getFloatPointer(3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ gameplay::ScriptUtil::LuaArray<float> param3 = gameplay::ScriptUtil::getFloatPointer(4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ gameplay::ScriptUtil::LuaArray<float> param4 = gameplay::ScriptUtil::getFloatPointer(5);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ gameplay::ScriptUtil::LuaArray<float> param5 = gameplay::ScriptUtil::getFloatPointer(6);
|
|
|
+
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ gameplay::ScriptUtil::LuaArray<float> param6 = gameplay::ScriptUtil::getFloatPointer(7);
|
|
|
+
|
|
|
+ Game* instance = getInstance(state);
|
|
|
+ instance->getRawSensorValues(param1, param2, param3, param4, param5, param6);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ lua_pushstring(state, "lua_Game_getRawSensorValues - Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 7).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
int lua_Game_getScriptController(lua_State* state)
|
|
|
{
|
|
|
// Get the number of parameters.
|