int LuaSyncedMoveCtrl::SetPhysics(lua_State* L)
{
	CScriptMoveType* moveType = ParseMoveType(L, __FUNCTION__, 1);
	if (moveType == NULL) {
		return 0;
	}
	const float3 pos((float)luaL_checknumber(L, 2),
	                 (float)luaL_checknumber(L, 3),
	                 (float)luaL_checknumber(L, 4));
	const float3 vel((float)luaL_checknumber(L, 5),
	                 (float)luaL_checknumber(L, 6),
	                 (float)luaL_checknumber(L, 7));
	const float3 rot((float)luaL_checknumber(L, 8),
	                 (float)luaL_checknumber(L, 9),
	                 (float)luaL_checknumber(L, 10));
	moveType->SetPhysics(pos, vel, rot);
	return 0;
}
Exemplo n.º 2
0
int LuaSyncedMoveCtrl::SetPhysics(lua_State* L)
{
	CScriptMoveType* moveType = ParseMoveType(L, __FUNCTION__, 1);
	if (moveType == NULL) {
		return 0;
	}
	const float3 pos(luaL_checkfloat(L, 2),
	                 luaL_checkfloat(L, 3),
	                 luaL_checkfloat(L, 4));
	const float3 vel(luaL_checkfloat(L, 5),
	                 luaL_checkfloat(L, 6),
	                 luaL_checkfloat(L, 7));
	const float3 rot(luaL_checkfloat(L, 8),
	                 luaL_checkfloat(L, 9),
	                 luaL_checkfloat(L, 10));
	ASSERT_SYNCED(pos);
	ASSERT_SYNCED(vel);
	ASSERT_SYNCED(rot);
	moveType->SetPhysics(pos, vel, rot);
	return 0;
}