mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 00:33:44 +01:00
Fix quaternion normalization
This commit is contained in:
parent
fbbcc27fed
commit
c2cfd59426
@ -29,7 +29,7 @@ function multiply(self, other)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function normalize(self)
|
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 = {}
|
local res = {}
|
||||||
for key, value in pairs(self) do
|
for key, value in pairs(self) do
|
||||||
res[key] = value / len
|
res[key] = value / len
|
||||||
|
Loading…
Reference in New Issue
Block a user