Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lookAt broken on any generic type that's not made of float32 #63

Closed
heysokam opened this issue Feb 12, 2023 · 2 comments
Closed

lookAt broken on any generic type that's not made of float32 #63

heysokam opened this issue Feb 12, 2023 · 2 comments

Comments

@heysokam
Copy link

There is a typo in this line:

return mat4[T]()

It should be GMat4[T]() or gmat4[T](), but not mat4[T]()
There is no proc mat4[T]() :GMat4[T]= .... at all, so this is trying resolve as a float32 with mat4() instead, and therefore breaks for every other type that's not based on f32

Minimal reproduction example:

import vmath

when on:
  let pos :GVec3[float]= gvec3[float](0'f, 0, 0)
  let dir :GVec3[float]= gvec3[float](1'f, 1, 1)
  let up  :GVec3[float]= gvec3[float](0'f, 1, 0)
else:
  let pos :GVec3[float32]= gvec3[float32](0'f, 0, 0)
  let dir :GVec3[float32]= gvec3[float32](1'f, 1, 1)
  let up  :GVec3[float32]= gvec3[float32](0'f, 1, 0)

let rot = pos.lookAt(dir, up)
echo rot
@treeform
Copy link
Owner

You are right, i'll fix it.

treeform added a commit that referenced this issue Feb 27, 2023
treeform added a commit that referenced this issue Mar 1, 2023
@treeform
Copy link
Owner

treeform commented Mar 3, 2023

I think this has been merged and fixed. Feel free to reopen if you still have issues.

@treeform treeform closed this as completed Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants