Skip to content

Commit

Permalink
early-out non-rotations for vec3:rotatei (common for manual euler tra…
Browse files Browse the repository at this point in the history
…nsforms)
  • Loading branch information
1bardesign committed Oct 18, 2024
1 parent c573c79 commit 708e11d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vec3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 708e11d

Please sign in to comment.