From 708e11df0b3f2d85b15c00b5333f24afb51472e8 Mon Sep 17 00:00:00 2001 From: Max Cahill Date: Fri, 18 Oct 2024 15:26:54 +1100 Subject: [PATCH] early-out non-rotations for vec3:rotatei (common for manual euler transforms) --- vec3.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vec3.lua b/vec3.lua index ca14260..6c5d8f9 100644 --- a/vec3.lua +++ b/vec3.lua @@ -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)