-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add setLookAt to Matrix4
- Loading branch information
Wang Ying
committed
Sep 22, 2020
1 parent
56268ab
commit 5891d70
Showing
2 changed files
with
77 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
open Wonder_jest; | ||
open Js.Typed_array; | ||
|
||
let _ = | ||
describe("Matrix4", () => { | ||
open Expect; | ||
open Expect.Operators; | ||
open Sinon; | ||
|
||
let sandbox = getSandboxDefaultVal(); | ||
|
||
beforeEach(() => { | ||
sandbox := createSandbox(); | ||
TestTool.init(~sandbox, ()); | ||
}); | ||
|
||
afterEach(() => restoreSandbox(refJsObjToSandbox(sandbox^))); | ||
|
||
describe("setLookAt", () => { | ||
test("test", () => { | ||
let matrix = Matrix4.setLookAt((0., 0., 20.), (0., 0., 0.), (0., 1., 0.)); | ||
let result = Float32Array.make([| | ||
1.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
1.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
1.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
20.0, | ||
1.0 | ||
|]); | ||
|
||
matrix -> expect == result; | ||
}) | ||
}) | ||
}) |