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

test(math.vector): add tests for GetAngleBetweenVectorsOnPlane function #12974

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/dev/core/src/Maths/math.vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1688,12 +1688,13 @@ export class Vector3 {
/**
* Get angle between two vectors projected on a plane
* Example Playground https://playground.babylonjs.com/#R1F8YU#87
* Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)
* @param vector0 angle between vector0 and vector1
* @param vector1 angle between vector0 and vector1
* @param normal Normal of the projection plane
* @returns the angle between vector0 and vector1 projected on the plane with the specified normal
* @returns the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal
*/
public static GetAngleBetweenVectorsOnPlane(vector0: Vector3, vector1: Vector3, normal: Vector3) {
public static GetAngleBetweenVectorsOnPlane(vector0: Vector3, vector1: Vector3, normal: Vector3): number {
MathTmp.Vector3[0].copyFrom(vector0);
const v0 = MathTmp.Vector3[0];
MathTmp.Vector3[1].copyFrom(vector1);
Expand Down
Loading