forked from CesiumGS/cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateFrameState.js
49 lines (42 loc) · 1.41 KB
/
createFrameState.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*global define*/
define([
'Core/Ellipsoid',
'Core/GeographicProjection',
'Core/defaultValue',
'Core/JulianDate',
'Scene/Camera',
'Scene/CreditDisplay',
'Scene/FrameState'
], function(
Ellipsoid,
GeographicProjection,
defaultValue,
JulianDate,
Camera,
CreditDisplay,
FrameState) {
"use strict";
var createFrameState = function(camera, frameNumber, time) {
// Mock frame-state for testing.
var frameState = new FrameState(new CreditDisplay(document.createElement('div')));
frameState.scene2D = {
projection : new GeographicProjection(Ellipsoid.WGS84)
};
frameState.frameNumber = defaultValue(frameNumber, 1.0);
frameState.time = defaultValue(time, JulianDate.fromDate(new Date('January 1, 2011 12:00:00 EST')));
camera = defaultValue(camera, new Camera({
getDrawingBufferWidth : function() {
return 1;
},
getDrawingBufferHeight : function() {
return 1;
}
}));
frameState.camera = camera;
frameState.cullingVolume = camera.frustum.computeCullingVolume(camera.position, camera.direction, camera.up);
frameState.passes.render = true;
frameState.passes.pick = false;
return frameState;
};
return createFrameState;
});