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
|
return self.world_matrix
|
||||||
|
|
||||||
proc get_local_matrix*(self: GameObject): Mat4 =
|
proc get_local_matrix*(self: GameObject): Mat4 =
|
||||||
var (x,y,z,w) = self.rotation.toTuple
|
var q = if self.rotation_order == Quaternion:
|
||||||
# if self.rotation_order != Quaternion:
|
self.rotation
|
||||||
# let q = fromEulerOrder(self.rotation, self.rotation_order)
|
else:
|
||||||
# let (x,y,z,w) = q.toTuple
|
to_quat(self.rotation.xyz, self.rotation_order)
|
||||||
|
q = normalize(q)
|
||||||
|
var (x,y,z,w) = q.toTuple
|
||||||
let scl = self.scale
|
let scl = self.scale
|
||||||
# TODO: test negative scales
|
# TODO: test negative scales
|
||||||
let pos = self.position
|
let pos = self.position
|
||||||
|
|
Loading…
Reference in a new issue