GameObject: Fix rotation in get_local_matrix
.
This commit is contained in:
parent
f03d1929cb
commit
f71ae37821
|
@ -241,10 +241,12 @@ proc get_world_matrix*(self: GameObject): Mat4 =
|
|||
return self.world_matrix
|
||||
|
||||
proc get_local_matrix*(self: GameObject): Mat4 =
|
||||
var (x,y,z,w) = self.rotation.toTuple
|
||||
# if self.rotation_order != Quaternion:
|
||||
# let q = fromEulerOrder(self.rotation, self.rotation_order)
|
||||
# let (x,y,z,w) = q.toTuple
|
||||
var q = if self.rotation_order == Quaternion:
|
||||
self.rotation
|
||||
else:
|
||||
to_quat(self.rotation.xyz, self.rotation_order)
|
||||
q = normalize(q)
|
||||
var (x,y,z,w) = q.toTuple
|
||||
let scl = self.scale
|
||||
# TODO: test negative scales
|
||||
let pos = self.position
|
||||
|
|
Loading…
Reference in a new issue