-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add function to get angles between two vectors (Vector3.GetAnglesBetweenVectorsForDirectionChange) #13012
Conversation
Added prettier settings to workspace settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/13012/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/13012/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/13012/merge#BCU1XR#0 |
https://playground.babylonjs.com/#QYA3JC#24 It does not seem to work. |
Let s figure it out and only keep one implementation. We need to be careful and prevent duplicated features. |
Agreed, could we maybe move it to this PR? I'd like to know what @BabylonJSGuide thinks of this PR since we worked on it in #12942. |
Not sure it should be moved in this PR, lets compare the functionalities and keep the one closest from the goal. You can check with @BabylonJSGuide. |
@dr-vortex now understand the difference - yours deals with positions mine with directions. Suggestions
to something like
Need to wait to see if @RaananW and @sebavan think there is sufficient differences between both and/or between existing methods for none, one or both to be approved. |
Yes, I've been thinking about it with positions. For your 4th point, I had originally included an offset in #12942 but removed it. I agree we should wait to see if they should be implemented separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok both PR fills different needs and are valid. Let s just rename and document more in this one what the fonction is for and good to go.
Would be great to attach unit tests as well if you can to ensure we do not regress later on ?
Let s validate the naming and doc comment with @BabylonJSGuide and ready to ship :-) |
Sounds good! |
Visualization tests for webgl1 have failed. If some tests failed because the snapshots do not match, the report can be found at If tests were successful afterwards, this report might not be available anymore. |
After a succesful build and before approval at least the following snapshot PG should be tested https://playground.babylonjs.com/?snapshot=refs/pull/13012/merge#S7HDGQ#5 |
@dr-vortex I ll merge as soon as @BabylonJSGuide comments have been addressed. Thanks a lot you both !!! |
Add function to get angles between two vectors (Vector3.GetAnglesBetweenVectorsForDirectionChange) Former-commit-id: e954562b579ddbb1c7a6c75589d09621c9a49551
Also add prettier settings to workspace settings.
See this PR for more details.
Demo PGs:
https://playground.babylonjs.com/#QYA3JC#25
https://playground.babylonjs.com/#QYA3JC#26
(Press space to start)
@BabylonJSGuide
I have the opportunity to talk with a physicist almost every day of the week, so I asked him about the problem and worked out the same equations used. After researching how
Math.atan2
works though, and found an issue with the equations: for the phi calculation, thediff.y
should have been the second parameter ofMath.atan2
, not the first.