@cesium/engine 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +95 -76
  2. package/README.md +9 -9
  3. package/Source/Core/Ion.js +1 -1
  4. package/Source/Renderer/Context.js +213 -178
  5. package/Source/Scene/I3SDataProvider.js +2 -1
  6. package/Source/Scene/I3SFeature.js +1 -1
  7. package/Source/Scene/I3SLayer.js +64 -2
  8. package/Source/Scene/I3SNode.js +50 -6
  9. package/Source/Scene/Model/Model.js +36 -3
  10. package/Source/Scene/Scene.js +3 -50
  11. package/Source/Shaders/Builtin/CzmBuiltins.js +15 -15
  12. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +100 -101
  13. package/Source/ThirdParty/Workers/pako_deflate.min.js +2 -2
  14. package/Source/ThirdParty/Workers/pako_inflate.min.js +2 -2
  15. package/Source/ThirdParty/Workers/z-worker-pako.js +0 -0
  16. package/Source/ThirdParty/draco_decoder.wasm +0 -0
  17. package/Source/Widget/CesiumWidget.js +1 -1
  18. package/index.d.ts +2402 -2334
  19. package/index.js +1085 -1085
  20. package/package.json +4 -1
  21. package/Build/ThirdParty/Workers/basis_transcoder.js +0 -2233
  22. package/Build/ThirdParty/Workers/draco_decoder_nodejs.js +0 -1872
  23. package/Build/ThirdParty/Workers/package.json +0 -1
  24. package/Build/ThirdParty/Workers/pako_deflate.min.js +0 -589
  25. package/Build/ThirdParty/Workers/pako_inflate.min.js +0 -798
  26. package/Build/ThirdParty/Workers/z-worker-pako.js +0 -503
  27. package/Build/ThirdParty/basis_transcoder.wasm +0 -0
  28. package/Build/ThirdParty/draco_decoder.wasm +0 -0
  29. package/Build/ThirdParty/google-earth-dbroot-parser.js +0 -8019
  30. package/Build/Widget/CesiumWidget.css +0 -120
  31. package/Build/Widget/lighter.css +0 -13
@@ -81,50 +81,13 @@ const requestRenderAfterFrame = function (scene) {
81
81
  /**
82
82
  * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
83
83
  * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
84
- * <p>
85
- * <em><code>contextOptions</code> parameter details:</em>
86
- * </p>
87
- * <p>
88
- * The default values are:
89
- * <code>
90
- * {
91
- * webgl : {
92
- * alpha : false,
93
- * depth : true,
94
- * stencil : false,
95
- * antialias : true,
96
- * powerPreference: 'high-performance',
97
- * premultipliedAlpha : true,
98
- * preserveDrawingBuffer : false,
99
- * failIfMajorPerformanceCaveat : false
100
- * },
101
- * allowTextureFilterAnisotropic : true
102
- * }
103
- * </code>
104
- * </p>
105
- * <p>
106
- * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
107
- * object used to create the WebGL context.
108
- * </p>
109
- * <p>
110
- * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
111
- * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
112
- * <code>webgl.alpha</code> to true.
113
- * </p>
114
- * <p>
115
- * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
116
- * </p>
117
- * <p>
118
- * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
119
- * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
120
- * </p>
121
84
  *
122
85
  * @alias Scene
123
86
  * @constructor
124
87
  *
125
88
  * @param {Object} options Object with the following properties:
126
89
  * @param {HTMLCanvasElement} options.canvas The HTML canvas element to create the scene for.
127
- * @param {Object} [options.contextOptions] Context and WebGL creation properties. See details above.
90
+ * @param {ContextOptions} [options.contextOptions] Context and WebGL creation properties.
128
91
  * @param {Element} [options.creditContainer] The HTML element in which the credits will be displayed.
129
92
  * @param {Element} [options.creditViewport] The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas.
130
93
  * @param {MapProjection} [options.mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.
@@ -134,7 +97,7 @@ const requestRenderAfterFrame = function (scene) {
134
97
  * @param {MapMode2D} [options.mapMode2D=MapMode2D.INFINITE_SCROLL] Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
135
98
  * @param {Boolean} [options.requestRenderMode=false] If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
136
99
  * @param {Number} [options.maximumRenderTimeChange=0.0] If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
137
- * @param {Number} [depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
100
+ * @param {Number} [options.depthPlaneEllipsoidOffset=0.0] Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
138
101
  * @param {Number} [options.msaaSamples=1] If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
139
102
  *
140
103
  * @see CesiumWidget
@@ -157,17 +120,7 @@ function Scene(options) {
157
120
  let creditContainer = options.creditContainer;
158
121
  let creditViewport = options.creditViewport;
159
122
 
160
- let contextOptions = clone(options.contextOptions);
161
- if (!defined(contextOptions)) {
162
- contextOptions = {};
163
- }
164
- if (!defined(contextOptions.webgl)) {
165
- contextOptions.webgl = {};
166
- }
167
- contextOptions.webgl.powerPreference = defaultValue(
168
- contextOptions.webgl.powerPreference,
169
- "high-performance"
170
- );
123
+ const contextOptions = clone(options.contextOptions);
171
124
 
172
125
  //>>includeStart('debug', pragmas.debug);
173
126
  if (!defined(canvas)) {
@@ -45,12 +45,6 @@ import czm_pbrParameters from './Structs/pbrParameters.js'
45
45
  import czm_ray from './Structs/ray.js'
46
46
  import czm_raySegment from './Structs/raySegment.js'
47
47
  import czm_shadowParameters from './Structs/shadowParameters.js'
48
- import czm_HSBToRGB from './Functions/HSBToRGB.js'
49
- import czm_HSLToRGB from './Functions/HSLToRGB.js'
50
- import czm_RGBToHSB from './Functions/RGBToHSB.js'
51
- import czm_RGBToHSL from './Functions/RGBToHSL.js'
52
- import czm_RGBToXYZ from './Functions/RGBToXYZ.js'
53
- import czm_XYZToRGB from './Functions/XYZToRGB.js'
54
48
  import czm_acesTonemapping from './Functions/acesTonemapping.js'
55
49
  import czm_alphaWeight from './Functions/alphaWeight.js'
56
50
  import czm_antialias from './Functions/antialias.js'
@@ -81,13 +75,15 @@ import czm_getDefaultMaterial from './Functions/getDefaultMaterial.js'
81
75
  import czm_getLambertDiffuse from './Functions/getLambertDiffuse.js'
82
76
  import czm_getSpecular from './Functions/getSpecular.js'
83
77
  import czm_getWaterNoise from './Functions/getWaterNoise.js'
78
+ import czm_HSBToRGB from './Functions/HSBToRGB.js'
79
+ import czm_HSLToRGB from './Functions/HSLToRGB.js'
84
80
  import czm_hue from './Functions/hue.js'
85
81
  import czm_inverseGamma from './Functions/inverseGamma.js'
86
82
  import czm_isEmpty from './Functions/isEmpty.js'
87
83
  import czm_isFull from './Functions/isFull.js'
88
84
  import czm_latitudeToWebMercatorFraction from './Functions/latitudeToWebMercatorFraction.js'
89
- import czm_lineDistance from './Functions/lineDistance.js'
90
85
  import czm_linearToSrgb from './Functions/linearToSrgb.js'
86
+ import czm_lineDistance from './Functions/lineDistance.js'
91
87
  import czm_luminance from './Functions/luminance.js'
92
88
  import czm_metersPerPixel from './Functions/metersPerPixel.js'
93
89
  import czm_modelToWindowCoordinates from './Functions/modelToWindowCoordinates.js'
@@ -106,6 +102,9 @@ import czm_raySphereIntersectionInterval from './Functions/raySphereIntersection
106
102
  import czm_readDepth from './Functions/readDepth.js'
107
103
  import czm_readNonPerspective from './Functions/readNonPerspective.js'
108
104
  import czm_reverseLogDepth from './Functions/reverseLogDepth.js'
105
+ import czm_RGBToHSB from './Functions/RGBToHSB.js'
106
+ import czm_RGBToHSL from './Functions/RGBToHSL.js'
107
+ import czm_RGBToXYZ from './Functions/RGBToXYZ.js'
109
108
  import czm_round from './Functions/round.js'
110
109
  import czm_sampleOctahedralProjection from './Functions/sampleOctahedralProjection.js'
111
110
  import czm_saturation from './Functions/saturation.js'
@@ -128,6 +127,7 @@ import czm_windowToEyeCoordinates from './Functions/windowToEyeCoordinates.js'
128
127
  import czm_writeDepthClamp from './Functions/writeDepthClamp.js'
129
128
  import czm_writeLogDepth from './Functions/writeLogDepth.js'
130
129
  import czm_writeNonPerspective from './Functions/writeNonPerspective.js'
130
+ import czm_XYZToRGB from './Functions/XYZToRGB.js'
131
131
 
132
132
  export default {
133
133
  czm_degreesPerRadian : czm_degreesPerRadian,
@@ -176,12 +176,6 @@ export default {
176
176
  czm_ray : czm_ray,
177
177
  czm_raySegment : czm_raySegment,
178
178
  czm_shadowParameters : czm_shadowParameters,
179
- czm_HSBToRGB : czm_HSBToRGB,
180
- czm_HSLToRGB : czm_HSLToRGB,
181
- czm_RGBToHSB : czm_RGBToHSB,
182
- czm_RGBToHSL : czm_RGBToHSL,
183
- czm_RGBToXYZ : czm_RGBToXYZ,
184
- czm_XYZToRGB : czm_XYZToRGB,
185
179
  czm_acesTonemapping : czm_acesTonemapping,
186
180
  czm_alphaWeight : czm_alphaWeight,
187
181
  czm_antialias : czm_antialias,
@@ -212,13 +206,15 @@ export default {
212
206
  czm_getLambertDiffuse : czm_getLambertDiffuse,
213
207
  czm_getSpecular : czm_getSpecular,
214
208
  czm_getWaterNoise : czm_getWaterNoise,
209
+ czm_HSBToRGB : czm_HSBToRGB,
210
+ czm_HSLToRGB : czm_HSLToRGB,
215
211
  czm_hue : czm_hue,
216
212
  czm_inverseGamma : czm_inverseGamma,
217
213
  czm_isEmpty : czm_isEmpty,
218
214
  czm_isFull : czm_isFull,
219
215
  czm_latitudeToWebMercatorFraction : czm_latitudeToWebMercatorFraction,
220
- czm_lineDistance : czm_lineDistance,
221
216
  czm_linearToSrgb : czm_linearToSrgb,
217
+ czm_lineDistance : czm_lineDistance,
222
218
  czm_luminance : czm_luminance,
223
219
  czm_metersPerPixel : czm_metersPerPixel,
224
220
  czm_modelToWindowCoordinates : czm_modelToWindowCoordinates,
@@ -237,6 +233,9 @@ export default {
237
233
  czm_readDepth : czm_readDepth,
238
234
  czm_readNonPerspective : czm_readNonPerspective,
239
235
  czm_reverseLogDepth : czm_reverseLogDepth,
236
+ czm_RGBToHSB : czm_RGBToHSB,
237
+ czm_RGBToHSL : czm_RGBToHSL,
238
+ czm_RGBToXYZ : czm_RGBToXYZ,
240
239
  czm_round : czm_round,
241
240
  czm_sampleOctahedralProjection : czm_sampleOctahedralProjection,
242
241
  czm_saturation : czm_saturation,
@@ -258,5 +257,6 @@ export default {
258
257
  czm_windowToEyeCoordinates : czm_windowToEyeCoordinates,
259
258
  czm_writeDepthClamp : czm_writeDepthClamp,
260
259
  czm_writeLogDepth : czm_writeLogDepth,
261
- czm_writeNonPerspective : czm_writeNonPerspective
260
+ czm_writeNonPerspective : czm_writeNonPerspective,
261
+ czm_XYZToRGB : czm_XYZToRGB
262
262
  };