mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 14:14:36 +00:00
early-out non-rotations for vec3:rotatei (common for manual euler transforms)
This commit is contained in:
parent
c573c79d32
commit
708e11df0b
3
vec3.lua
3
vec3.lua
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user