-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more tests and fixed IBL lighting
- Loading branch information
Showing
9 changed files
with
161 additions
and
10 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
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,49 @@ | ||
import { Cartesian3, Color, DirectionalLight } from '../../Source/Cesium.js'; | ||
|
||
describe('Scene/DirectionalLight', function() { | ||
|
||
it('constructs with default options', function() { | ||
var light = new DirectionalLight({ | ||
direction : Cartesian3.UNIT_X | ||
}); | ||
|
||
expect(light.direction).toEqual(Cartesian3.UNIT_X); | ||
expect(light.direction).not.toBe(Cartesian3.UNIT_X); | ||
expect(light.color).toEqual(Color.WHITE); | ||
expect(light.intensity).toBe(1.0); | ||
}); | ||
|
||
it('constructs with all options', function() { | ||
var light = new DirectionalLight({ | ||
direction : Cartesian3.UNIT_X, | ||
color : Color.RED, | ||
intensity : 2.0 | ||
}); | ||
expect(light.direction).toEqual(Cartesian3.UNIT_X); | ||
expect(light.color).toEqual(Color.RED); | ||
expect(light.color).not.toBe(Color.RED); | ||
expect(light.intensity).toBe(2.0); | ||
}); | ||
|
||
it('throws if options is undefined', function() { | ||
expect(function() { | ||
return new DirectionalLight(); | ||
}).toThrowDeveloperError(); | ||
}); | ||
|
||
it('throws if options.direction is undefined', function() { | ||
expect(function() { | ||
return new DirectionalLight({ | ||
color : Color.RED | ||
}); | ||
}).toThrowDeveloperError(); | ||
}); | ||
|
||
it('throws if options.direction is zero-length', function() { | ||
expect(function() { | ||
return new DirectionalLight({ | ||
direction : Cartesian3.ZERO | ||
}); | ||
}).toThrowDeveloperError(); | ||
}); | ||
}); |
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,14 @@ | ||
import { Light } from '../../Source/Cesium.js'; | ||
|
||
describe('Scene/Light', function() { | ||
|
||
it('throws', function() { | ||
var light = new Light(); | ||
expect(function() { | ||
return light.color; | ||
}).toThrowDeveloperError(); | ||
expect(function() { | ||
return light.intensity; | ||
}).toThrowDeveloperError(); | ||
}); | ||
}); |
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,21 @@ | ||
import { Color, SunLight } from '../../Source/Cesium.js'; | ||
|
||
describe('Scene/SunLight', function() { | ||
|
||
it('constructs with default options', function() { | ||
var light = new SunLight(); | ||
|
||
expect(light.color).toEqual(Color.WHITE); | ||
expect(light.intensity).toBe(2.0); | ||
}); | ||
|
||
it('constructs with all options', function() { | ||
var light = new SunLight({ | ||
color : Color.RED, | ||
intensity : 2.0 | ||
}); | ||
expect(light.color).toEqual(Color.RED); | ||
expect(light.color).not.toBe(Color.RED); | ||
expect(light.intensity).toBe(2.0); | ||
}); | ||
}); |