This commit is contained in:
treeform 2023-02-27 11:57:22 -08:00
parent aa18b570fb
commit da54243231
2 changed files with 5 additions and 1 deletions

View file

@ -1345,7 +1345,7 @@ proc lookAt*[T](eye, center, up: GVec3[T]): GMat4[T] =
centerz = center[2]
if eyex == centerx and eyey == centery and eyez == centerz:
return mat4[T]()
return GMat4[T]()
var
# vec3.direction(eye, center, z)

View file

@ -882,6 +882,10 @@ block:
)
doAssert lookAt(vec3(0, 0, 1), vec3(0, 0, 0)).quat ~= quat(0.0, 0.0, 0.0, 1.0)
let
a = lookAt(vec3(1, 2, 3), vec3(0, 0, 0))
b = lookAt(dvec3(1, 2, 3), dvec3(0, 0, 0))
doAssert ortho[float32](-1, 1, 1, -1, -1000, 1000) ~= mat4(
1.0, 0.0, 0.0, 0.0,
0.0, -1.0, 0.0, 0.0,