Merge remote-tracking branch 'origin/master'

This commit is contained in:
Max Cahill 2024-11-01 11:27:35 +11:00
commit 4a5b2aaa90
3 changed files with 10 additions and 14 deletions

View File

@ -48,7 +48,9 @@ return function(time_budget, memory_ceiling, disable_otherwise)
love.timer.getTime() - start_time < time_budget and
steps < max_steps
do
collectgarbage("step", 1)
if collectgarbage("step", 1) then
break
end
steps = steps + 1
end
--safety net

View File

@ -65,7 +65,7 @@ end
function state_machine:_call_and_transition(name, ...)
local r = self:_call(name, ...)
if type(r) == "string" and self:has_state(r) then
self:set_state(r, r == self.current_state_name)
self:set_state(r, true)
return nil
end
return r

View File

@ -328,6 +328,9 @@ end
--rotate around a swizzle
--todo: angle-axis version
function vec3:rotatei(swizzle, angle)
if angle == 0 then --early out
return self
end
local v = vec2:pooled()
self:extract_vec2(swizzle, v)
v:rotatei(angle)
@ -336,19 +339,10 @@ function vec3:rotatei(swizzle, angle)
return self
end
local _euler_macro = {
"yz",
"xz",
"xy",
}
function vec3:rotate_euleri(angle_x_axis, angle_y_axis, angle_z_axis)
for i, swizzle in ipairs(_euler_macro) do
local angle =
i == 1 and angle_x_axis
or i == 2 and angle_y_axis
or i == 3 and angle_z_axis
self:rotatei(swizzle, angle)
end
self:rotatei("yz", angle_x_axis)
self:rotatei("xz", angle_y_axis)
self:rotatei("xy", angle_z_axis)
return self
end