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

mat4 rotations #414

Open
z3dev opened this issue Jan 13, 2021 · 0 comments
Open

mat4 rotations #414

z3dev opened this issue Jan 13, 2021 · 0 comments

Comments

@z3dev
Copy link

z3dev commented Jan 13, 2021

The mat4 implementation kind of punts on invalid rotations, i.e. an axis with a length < EPSILON.

if (len < glMatrix.EPSILON) {
    return null;
}

But is returning 'null' the correct thing to do? The calling function now has to trap these strange return values.

In the pure javascript sense, throwing an error makes more sense then returning 'null'.

In the real-world sense, doing something appropriate would make more sense. For rotate(), just return the value of the given matrix. For fromRotation(), just return the identity matrix.

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