early-out non-rotations for vec3:rotatei (common for manual euler transforms)

This commit is contained in:
Max Cahill 2024-10-18 15:26:54 +11:00
parent c573c79d32
commit 708e11df0b

View File

@ -328,6 +328,9 @@ end
--rotate around a swizzle --rotate around a swizzle
--todo: angle-axis version --todo: angle-axis version
function vec3:rotatei(swizzle, angle) function vec3:rotatei(swizzle, angle)
if angle == 0 then --early out
return self
end
local v = vec2:pooled() local v = vec2:pooled()
self:extract_vec2(swizzle, v) self:extract_vec2(swizzle, v)
v:rotatei(angle) v:rotatei(angle)