Fix quaternion normalization

master
Lars Mueller 2021-12-26 16:16:18 +01:00
parent fbbcc27fed
commit c2cfd59426
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ function multiply(self, other)
end
function normalize(self)
local len = math.sqrt(self[1] ^ 2 + self[2] ^ 2 + self[3] ^ 2 + (self[4] ^ 4))
local len = math.sqrt(self[1] ^ 2 + self[2] ^ 2 + self[3] ^ 2 + self[4] ^ 2)
local res = {}
for key, value in pairs(self) do
res[key] = value / len