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

Benchmarks: Fix rotation setup in updateMatrixWorld() test. #25112

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

diarmidmackenzie
Copy link
Contributor

@diarmidmackenzie diarmidmackenzie commented Dec 11, 2022

Related issue: None raised (I can raise if needed, but it didn't seem necessary for such a small fix).

Description

When running the benchmark page at /test/benchmark/benchmarks.html, we see this warning in the browser:

three.min.js:6 THREE.Quaternion: .setFromEuler() encountered an unknown order: undefined

This is because the code sets up a Quaternion, but copies it into the rotation property on the Object3D, which is an Euler, not a Quaternion.

Alternative fix would be to do:

child.rotation.setFromQuaternion(rotation)

Doesn't make a lot of difference, I went for this one as I believe it's marginally more efficient

@diarmidmackenzie diarmidmackenzie marked this pull request as ready for review December 11, 2022 09:20
@Mugen87 Mugen87 added this to the r148 milestone Dec 11, 2022
@Mugen87 Mugen87 merged commit d93d110 into mrdoob:dev Dec 11, 2022
@Mugen87 Mugen87 changed the title set quaternion, not rotation Benchmarks: Fix rotation setup in updateMatrixWorld() test. Dec 11, 2022
@@ -11,7 +11,7 @@
var child = new THREE.Object3D();
child.position.copy( position );
child.scale.copy( scale );
child.rotation.copy( rotation );
child.quaternion.copy( rotation );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not write code that way.

Would you like to file a PR and rename rotation to quaternion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Raised #25122

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

Successfully merging this pull request may close these issues.

3 participants