Skip to content

Commit

Permalink
split camera test
Browse files Browse the repository at this point in the history
  • Loading branch information
foldfelis committed Nov 22, 2021
1 parent 95c374f commit 79dc759
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ function test_camera(camera::Raylib.RayCamera3D, ans::Vector)
])
end

@testset "set camera properties" begin
@testset "set camera properties 2d" begin
camera = Raylib.RayCamera2D(
Raylib.rayvector(1, 2), # camera offset
Raylib.rayvector(3, 4), # camera target
@@ -41,7 +41,9 @@ end
45,
3
])
end

@testset "set camera properties 3d" begin
camera = Raylib.RayCamera3D(
Raylib.rayvector(0, 10, 10), # camera position
Raylib.rayvector(0, 0, 0), # camera looking at point
@@ -94,4 +96,14 @@ end
60,
Raylib.CAMERA_ORTHOGRAPHIC
])

Raylib.SetCameraMode(camera, Int(Raylib.CAMERA_FIRST_PERSON))
camera = Raylib.UpdateCamera(camera)
@test !test_camera(camera, [
Raylib.rayvector(1, 2, 3),
Raylib.rayvector(3, 2, 1),
Raylib.rayvector(4, 5, 6),
60,
Raylib.CAMERA_FIRST_PERSON
])
end

0 comments on commit 79dc759

Please # to comment.