Skip to content

Commit

Permalink
test(math.vector): add tests for GetAngleBetweenVectorsOnPlane functi…
Browse files Browse the repository at this point in the history
…on (#12974)

Former-commit-id: ba093fcbe5c697137fd55d4ef50f7eabc43cd255
  • Loading branch information
Dok11 authored Sep 12, 2022
1 parent eeb9755 commit c371988
Show file tree
Hide file tree
Showing 3 changed files with 6,083 additions and 49 deletions.
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

0 comments on commit c371988

Please sign in to comment.