diff --git a/src/vmath.nim b/src/vmath.nim index 8e5808f..070e79e 100644 --- a/src/vmath.nim +++ b/src/vmath.nim @@ -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) diff --git a/tests/test.nim b/tests/test.nim index 88b315e..e7de428 100644 --- a/tests/test.nim +++ b/tests/test.nim @@ -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,