-
Notifications
You must be signed in to change notification settings - Fork 303
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
1 changed file
with
19 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
import assert from 'assert'; | ||
import Camera from '../../src/Renderer/Camera'; | ||
import Camera from 'Renderer/Camera'; | ||
import Coordinates from 'Core/Geographic/Coordinates'; | ||
|
||
describe('preSSE checks', function () { | ||
it('should increase when fov decrease', function () { | ||
|
||
describe('camera', function () { | ||
it('should set good aspect in camera3D', function () { | ||
const camera = new Camera('', 100, 50); | ||
assert.ok(camera.camera3D.aspect == 2.0); | ||
}); | ||
it('should increase preSSE when fov decrease', function () { | ||
const camera = new Camera('', 100, 50); | ||
|
||
camera.update(100, 50); | ||
camera.resize(100, 50); | ||
const initial = camera._preSSE; | ||
|
||
camera.camera3D.fov *= 0.5; | ||
camera.update(100, 50); | ||
|
||
assert.ok(camera._preSSE > initial); | ||
}); | ||
it('should be consistent between setPosition and position', function () { | ||
const camera = new Camera('EPSG:4978', 100, 50); | ||
const coordinates = new Coordinates('EPSG:4326', 40, 52, 2002); | ||
camera.setPosition(coordinates); | ||
const resultCoordinates = camera.position('EPSG:4326'); | ||
assert.ok(resultCoordinates.longitude() == coordinates.longitude()); | ||
assert.ok(resultCoordinates.latitude().toFixed(8) == coordinates.latitude()); | ||
assert.ok(resultCoordinates.altitude().toFixed(8) == coordinates.altitude()); | ||
}); | ||
}); |