Skip to content

quat_from_mat4x4 uses wrong element layout #55

@gentili

Description

@gentili

LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 const M)

assignment is [w,x,y,z] instead of [x,y,z,w] like everywhere else:

if(r < 1e-6) {
		q[0] = 1.f;
		q[1] = q[2] = q[3] = 0.f;
		return;
	}

	q[0] = r/2.f;
	q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r);
	q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r);
	q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions