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

indexing error #29

Open
mike-rfranging opened this issue Aug 15, 2017 · 0 comments
Open

indexing error #29

mike-rfranging opened this issue Aug 15, 2017 · 0 comments

Comments

@mike-rfranging
Copy link

mike-rfranging commented Aug 15, 2017

The indexing for the q variable in quat_from_mat4x4 function is incorrect. I recommend using #defines for the indexes for the whole file, such as:
if(r < 1e-6) {
q[QUAT_S] = 1.f;
q[QUAT_X] = q[QUAT_Y] = q[QUAT_Z] = 0.f;
return;
}

q[QUAT_S] = r/2.f;
q[QUAT_X] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r);
q[QUAT_Y] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r);
q[QUAT_Z] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);

Great library, by the way.

iurii-provizio added a commit to provizio/linmath.h that referenced this issue May 31, 2022
iurii-provizio added a commit to provizio/linmath.h that referenced this issue May 31, 2022
iurii-provizio added a commit to provizio/linmath.h that referenced this issue May 31, 2022
iurii-provizio added a commit to provizio/linmath.h that referenced this issue Sep 8, 2022
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

1 participant