-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
90 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import { expect, test } from "vitest"; | ||
import { Ray } from "./ray"; | ||
import { Vector3 } from "three"; | ||
import { Vector2 } from "three"; | ||
|
||
test("Getting a point from a ray", () => { | ||
const ray1 = new Ray(new Vector3(1, 1), new Vector3(1, 1)); | ||
const vector1 = ray1.getPoint(5); | ||
const vector2 = new Vector3(6, 6); | ||
expect(vector1.equals(vector2)); | ||
const ray1 = new Ray(new Vector2(1, 1), new Vector2(1, 1)); | ||
const vector_1 = ray1.getPoint(5); | ||
const vector_2 = new Vector2(6, 6); | ||
expect(vector_1.equals(vector_2)); | ||
}); | ||
|
||
test("Test get parameter range", () => { | ||
const ray1 = new Ray(new Vector2(1, 1), new Vector2(1, 1)); | ||
const vector_1 = ray1.getPoint(5); | ||
const vector_2 = new Vector2(6, 6); | ||
expect(vector_1.equals(vector_2)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters