cesium 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/Cesium.js +5 -2
  3. data/app/assets/javascripts/Core/Cartesian2.js +58 -0
  4. data/app/assets/javascripts/Core/Cartesian3.js +67 -7
  5. data/app/assets/javascripts/Core/Cartesian4.js +63 -0
  6. data/app/assets/javascripts/Core/CatmullRomSpline.js +183 -163
  7. data/app/assets/javascripts/Core/CorridorGeometry.js +2 -2
  8. data/app/assets/javascripts/Core/Ellipsoid.js +16 -0
  9. data/app/assets/javascripts/Core/ExtentGeometry.js +9 -2
  10. data/app/assets/javascripts/Core/ExtentOutlineGeometry.js +2 -2
  11. data/app/assets/javascripts/Core/GeometryPipeline.js +23 -23
  12. data/app/assets/javascripts/Core/HermiteSpline.js +260 -155
  13. data/app/assets/javascripts/Core/IndexDatatype.js +43 -34
  14. data/app/assets/javascripts/Core/LinearSpline.js +118 -0
  15. data/app/assets/javascripts/Core/Math.js +34 -3
  16. data/app/assets/javascripts/Core/Matrix2.js +26 -0
  17. data/app/assets/javascripts/Core/Matrix3.js +98 -0
  18. data/app/assets/javascripts/Core/Matrix4.js +42 -0
  19. data/app/assets/javascripts/Core/ObjectOrientedBoundingBox.js +396 -0
  20. data/app/assets/javascripts/Core/PolygonGeometry.js +87 -47
  21. data/app/assets/javascripts/Core/PolygonGeometryLibrary.js +20 -17
  22. data/app/assets/javascripts/Core/PolygonOutlineGeometry.js +68 -40
  23. data/app/assets/javascripts/Core/PolygonPipeline.js +19 -9
  24. data/app/assets/javascripts/Core/PrimitiveType.js +33 -36
  25. data/app/assets/javascripts/Core/Quaternion.js +147 -1
  26. data/app/assets/javascripts/Core/QuaternionSpline.js +160 -0
  27. data/app/assets/javascripts/Core/Spline.js +121 -0
  28. data/app/assets/javascripts/Core/Transforms.js +0 -2
  29. data/app/assets/javascripts/Core/loadArrayBuffer.js +5 -1
  30. data/app/assets/javascripts/Core/loadBlob.js +5 -1
  31. data/app/assets/javascripts/Core/loadText.js +4 -1
  32. data/app/assets/javascripts/Core/loadWithXhr.js +30 -14
  33. data/app/assets/javascripts/DynamicScene/PolylineOutlineMaterialProperty.js +2 -2
  34. data/app/assets/javascripts/Renderer/AutomaticUniforms.js +41 -41
  35. data/app/assets/javascripts/Renderer/Context.js +171 -201
  36. data/app/assets/javascripts/Renderer/CubeMapFace.js +2 -2
  37. data/app/assets/javascripts/Renderer/DrawCommand.js +2 -2
  38. data/app/assets/javascripts/Renderer/PixelFormat.js +22 -28
  39. data/app/assets/javascripts/Renderer/ShaderProgram.js +65 -46
  40. data/app/assets/javascripts/Renderer/Texture.js +1 -1
  41. data/app/assets/javascripts/Renderer/TextureMagnificationFilter.js +7 -9
  42. data/app/assets/javascripts/Renderer/TextureMinificationFilter.js +19 -25
  43. data/app/assets/javascripts/Renderer/TextureWrap.js +11 -13
  44. data/app/assets/javascripts/Renderer/UniformDatatype.js +29 -29
  45. data/app/assets/javascripts/Renderer/VertexArray.js +43 -35
  46. data/app/assets/javascripts/Scene/ArcGisMapServerImageryProvider.js +1 -2
  47. data/app/assets/javascripts/Scene/BillboardCollection.js +10 -1
  48. data/app/assets/javascripts/Scene/CameraFlightPath.js +58 -101
  49. data/app/assets/javascripts/Scene/CentralBody.js +1 -4
  50. data/app/assets/javascripts/Scene/CentralBodySurface.js +1 -2
  51. data/app/assets/javascripts/Scene/CesiumTerrainProvider.js +1 -2
  52. data/app/assets/javascripts/Scene/CustomSensorVolume.js +17 -3
  53. data/app/assets/javascripts/Scene/EllipsoidPrimitive.js +20 -5
  54. data/app/assets/javascripts/Scene/EllipsoidSurfaceAppearance.js +1 -2
  55. data/app/assets/javascripts/Scene/FrameState.js +1 -3
  56. data/app/assets/javascripts/Scene/GoogleEarthImageryProvider.js +2 -5
  57. data/app/assets/javascripts/Scene/OpenStreetMapImageryProvider.js +1 -2
  58. data/app/assets/javascripts/Scene/OrthographicFrustum.js +1 -2
  59. data/app/assets/javascripts/Scene/PerspectiveOffCenterFrustum.js +1 -2
  60. data/app/assets/javascripts/Scene/Polygon.js +1 -3
  61. data/app/assets/javascripts/Scene/Polyline.js +5 -2
  62. data/app/assets/javascripts/Scene/PolylineCollection.js +4 -6
  63. data/app/assets/javascripts/Scene/Primitive.js +19 -13
  64. data/app/assets/javascripts/Scene/PrimitivePipeline.js +1 -1
  65. data/app/assets/javascripts/Scene/Scene.js +7 -10
  66. data/app/assets/javascripts/Scene/SceneTransforms.js +1 -3
  67. data/app/assets/javascripts/Scene/SceneTransitioner.js +11 -11
  68. data/app/assets/javascripts/Scene/SingleTileImageryProvider.js +1 -2
  69. data/app/assets/javascripts/Scene/TexturePool.js +1 -1
  70. data/app/assets/javascripts/Scene/TileMapServiceImageryProvider.js +1 -2
  71. data/app/assets/javascripts/Scene/VRTheWorldTerrainProvider.js +1 -2
  72. data/app/assets/javascripts/Scene/ViewportQuad.js +1 -3
  73. data/app/assets/javascripts/Scene/WebMapServiceImageryProvider.js +1 -2
  74. data/app/assets/javascripts/ThirdParty/knockout-3.0.0.js +6 -3
  75. data/app/assets/javascripts/Widgets/CesiumWidget/CesiumWidget.js +4 -3
  76. data/app/assets/javascripts/Widgets/SceneModePicker/SceneModePickerViewModel.js +1 -1
  77. data/app/assets/javascripts/Widgets/Viewer/Viewer.js +5 -5
  78. data/app/assets/javascripts/Widgets/Viewer/viewerDragDropMixin.js +13 -13
  79. data/app/assets/javascripts/Widgets/Viewer/viewerDynamicObjectMixin.js +6 -6
  80. data/app/assets/javascripts/Widgets/widgets.css +1 -1
  81. data/lib/cesium/version.rb +1 -1
  82. metadata +6 -3
  83. data/app/assets/javascripts/Core/OrientationInterpolator.js +0 -106
@@ -1,9 +1,7 @@
1
1
  /*global define*/
2
- define(['Core/Color', 'Core/combine', 'Core/destroyObject', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/BoundingRectangle', 'Core/ComponentDatatype', 'Core/PrimitiveType', 'Core/Geometry', 'Core/GeometryAttribute', 'Scene/Material', 'Renderer/BufferUsage', 'Renderer/BlendingState', 'Renderer/CommandLists', 'Renderer/DrawCommand', 'Renderer/createShaderSource', 'Shaders/ViewportQuadVS', 'Shaders/ViewportQuadFS'], function(
2
+ define(['Core/Color', 'Core/destroyObject', 'Core/defined', 'Core/DeveloperError', 'Core/BoundingRectangle', 'Core/ComponentDatatype', 'Core/PrimitiveType', 'Core/Geometry', 'Core/GeometryAttribute', 'Scene/Material', 'Renderer/BufferUsage', 'Renderer/BlendingState', 'Renderer/CommandLists', 'Renderer/DrawCommand', 'Renderer/createShaderSource', 'Shaders/ViewportQuadVS', 'Shaders/ViewportQuadFS'], function(
3
3
  Color,
4
- combine,
5
4
  destroyObject,
6
- defaultValue,
7
5
  defined,
8
6
  DeveloperError,
9
7
  BoundingRectangle,
@@ -1,10 +1,9 @@
1
1
  /*global define*/
2
- define(['Core/clone', 'Core/defaultValue', 'Core/defined', 'Core/freezeObject', 'Core/writeTextToCanvas', 'Core/DeveloperError', 'Core/Event', 'Core/Extent', 'Scene/Credit', 'Scene/ImageryProvider', 'Scene/GeographicTilingScheme'], function(
2
+ define(['Core/clone', 'Core/defaultValue', 'Core/defined', 'Core/freezeObject', 'Core/DeveloperError', 'Core/Event', 'Core/Extent', 'Scene/Credit', 'Scene/ImageryProvider', 'Scene/GeographicTilingScheme'], function(
3
3
  clone,
4
4
  defaultValue,
5
5
  defined,
6
6
  freezeObject,
7
- writeTextToCanvas,
8
7
  DeveloperError,
9
8
  Event,
10
9
  Extent,
@@ -1,6 +1,9 @@
1
- // Knockout JavaScript library v3.0.0
2
- // (c) Steven Sanderson - http://knockoutjs.com/
3
- // License: MIT (http://www.opensource.org/licenses/mit-license.php)
1
+ /**
2
+ @license
3
+ Knockout JavaScript library v3.0.0
4
+ (c) Steven Sanderson - http://knockoutjs.com/
5
+ License: MIT (http://www.opensource.org/licenses/mit-license.php)
6
+ */
4
7
 
5
8
  (function() {(function(q){var y=this||(0,eval)("this"),w=y.document,K=y.navigator,u=y.jQuery,B=y.JSON;(function(q){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?q(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],q):q(y.ko={})})(function(F){function G(a,c){return null===a||typeof a in N?a===c:!1}function H(b,c,d,e){a.d[b]={init:function(b){a.a.f.set(b,L,{});return{controlsDescendantBindings:!0}},update:function(b,h,k,m,f){k=a.a.f.get(b,L);h=a.a.c(h());
6
9
  m=!d!==!h;var p=!k.ob;if(p||c||m!==k.Db)p&&(k.ob=a.a.Ya(a.e.childNodes(b),!0)),m?(p||a.e.S(b,a.a.Ya(k.ob)),a.Ta(e?e(f,h):f,b)):a.e.Z(b),k.Db=m}};a.g.Y[b]=!1;a.e.P[b]=!0}var a="undefined"!==typeof F?F:{};a.b=function(b,c){for(var d=b.split("."),e=a,g=0;g<d.length-1;g++)e=e[d[g]];e[d[d.length-1]]=c};a.s=function(a,c,d){a[c]=d};a.version="3.0.0";a.b("version",a.version);a.a=function(){function b(a,b){for(var f in a)a.hasOwnProperty(f)&&b(f,a[f])}function c(k,b){if("input"!==a.a.v(k)||!k.type||"click"!=
@@ -51,7 +51,7 @@ define(['Core/buildModuleUrl', 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Clock
51
51
  } catch (e) {
52
52
  widget._useDefaultRenderLoop = false;
53
53
  widget._renderLoopRunning = false;
54
- widget._onRenderLoopError.raiseEvent(widget, e);
54
+ widget._renderLoopError.raiseEvent(widget, e);
55
55
  if (widget._showRenderLoopErrors) {
56
56
  widget.showErrorPanel('An error occurred while rendering. Rendering has stopped.', e);
57
57
  console.error(e);
@@ -212,7 +212,7 @@ define(['Core/buildModuleUrl', 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Clock
212
212
  this._creditContainer = creditContainer;
213
213
  this._canRender = false;
214
214
  this._showRenderLoopErrors = defaultValue(options.showRenderLoopErrors, true);
215
- this._onRenderLoopError = new Event();
215
+ this._renderLoopError = new Event();
216
216
 
217
217
  if (options.sceneMode) {
218
218
  if (options.sceneMode === SceneMode.SCENE2D) {
@@ -339,7 +339,7 @@ define(['Core/buildModuleUrl', 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Clock
339
339
  */
340
340
  onRenderLoopError : {
341
341
  get : function() {
342
- return this._onRenderLoopError;
342
+ return this._renderLoopError;
343
343
  }
344
344
  },
345
345
 
@@ -432,6 +432,7 @@ define(['Core/buildModuleUrl', 'Core/Cartesian2', 'Core/Cartesian3', 'Core/Clock
432
432
  * @memberof CesiumWidget
433
433
  */
434
434
  CesiumWidget.prototype.destroy = function() {
435
+ this._scene = this._scene && this._scene.destroy();
435
436
  this._container.removeChild(this._element);
436
437
  destroyObject(this);
437
438
  };
@@ -34,7 +34,7 @@ define(['Core/defineProperties', 'Core/defined', 'Core/destroyObject', 'Core/Dev
34
34
  };
35
35
 
36
36
  this._eventHelper = new EventHelper();
37
- this._eventHelper.add(transitioner.onTransitionStart, transitionStart);
37
+ this._eventHelper.add(transitioner.transitionStart, transitionStart);
38
38
 
39
39
  /**
40
40
  * Gets or sets the current SceneMode. This property is observable.
@@ -53,7 +53,7 @@ define(['Core/Cartesian2', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
53
53
  } catch (e) {
54
54
  viewer._useDefaultRenderLoop = false;
55
55
  viewer._renderLoopRunning = false;
56
- viewer._onRenderLoopError.raiseEvent(viewer, e);
56
+ viewer._renderLoopError.raiseEvent(viewer, e);
57
57
  if (viewer._showRenderLoopErrors) {
58
58
  /*global console*/
59
59
  viewer.cesiumWidget.showErrorPanel('An error occurred while rendering. Rendering has stopped.', e);
@@ -143,7 +143,7 @@ define(['Core/Cartesian2', 'Core/defaultValue', 'Core/defined', 'Core/DeveloperE
143
143
  * viewer.extend(Cesium.viewerDynamicObjectMixin);
144
144
  *
145
145
  * //Show a pop-up alert if we encounter an error when processing a dropped file
146
- * viewer.onDropError.addEventListener(function(dropHandler, name, error) {
146
+ * viewer.dropError.addEventListener(function(dropHandler, name, error) {
147
147
  * console.log(error);
148
148
  * window.alert(error);
149
149
  * });
@@ -318,7 +318,7 @@ Either specify options.imageryProvider instead or set options.baseLayerPicker to
318
318
  this._useDefaultRenderLoop = undefined;
319
319
  this._renderLoopRunning = false;
320
320
  this._showRenderLoopErrors = defaultValue(options.showRenderLoopErrors, true);
321
- this._onRenderLoopError = new Event();
321
+ this._renderLoopError = new Event();
322
322
 
323
323
  //Start the render loop if not explicitly disabled in options.
324
324
  this.useDefaultRenderLoop = defaultValue(options.useDefaultRenderLoop, true);
@@ -531,9 +531,9 @@ Either specify options.imageryProvider instead or set options.baseLayerPicker to
531
531
  * @memberof Viewer.prototype
532
532
  * @type {Event}
533
533
  */
534
- onRenderLoopError : {
534
+ renderLoopError : {
535
535
  get : function() {
536
- return this._onRenderLoopError;
536
+ return this._renderLoopError;
537
537
  }
538
538
  },
539
539
 
@@ -28,14 +28,14 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
28
28
  * @exception {DeveloperError} Element with id <options.dropTarget> does not exist in the document.
29
29
  * @exception {DeveloperError} dropTarget is already defined by another mixin.
30
30
  * @exception {DeveloperError} dropEnabled is already defined by another mixin.
31
- * @exception {DeveloperError} onDropError is already defined by another mixin.
31
+ * @exception {DeveloperError} dropError is already defined by another mixin.
32
32
  * @exception {DeveloperError} clearOnDrop is already defined by another mixin.
33
33
  *
34
34
  * @example
35
35
  * // Add basic drag and drop support and pop up an alert window on error.
36
36
  * var viewer = new Cesium.Viewer('cesiumContainer');
37
37
  * viewer.extend(Cesium.viewerDragDropMixin);
38
- * viewer.onDropError.addEventListener(function(viewerArg, source, error) {
38
+ * viewer.dropError.addEventListener(function(viewerArg, source, error) {
39
39
  * window.alert('Error processing ' + source + ':' + error);
40
40
  * });
41
41
  */
@@ -49,8 +49,8 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
49
49
  if (viewer.hasOwnProperty('dropEnabled')) {
50
50
  throw new DeveloperError('dropEnabled is already defined by another mixin.');
51
51
  }
52
- if (viewer.hasOwnProperty('onDropError')) {
53
- throw new DeveloperError('onDropError is already defined by another mixin.');
52
+ if (viewer.hasOwnProperty('dropError')) {
53
+ throw new DeveloperError('dropError is already defined by another mixin.');
54
54
  }
55
55
  if (viewer.hasOwnProperty('clearOnDrop')) {
56
56
  throw new DeveloperError('clearOnDrop is already defined by another mixin.');
@@ -60,7 +60,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
60
60
 
61
61
  //Local variables to be closed over by defineProperties.
62
62
  var dropEnabled = true;
63
- var onDropError = new Event();
63
+ var dropError = new Event();
64
64
  var clearOnDrop = defaultValue(options.clearOnDrop, true);
65
65
  var dropTarget = defaultValue(options.dropTarget, viewer.container);
66
66
 
@@ -114,9 +114,9 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
114
114
  * @memberof viewerDragDropMixin.prototype
115
115
  * @type {Event}
116
116
  */
117
- onDropError : {
117
+ dropError : {
118
118
  get : function() {
119
- return onDropError;
119
+ return dropError;
120
120
  }
121
121
  },
122
122
 
@@ -148,7 +148,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
148
148
  var f = files[i];
149
149
  var reader = new FileReader();
150
150
  reader.onload = createOnLoadCallback(viewer, f.name);
151
- reader.onerror = createOnDropErrorCallback(viewer, f.name);
151
+ reader.onerror = createDropErrorCallback(viewer, f.name);
152
152
  reader.readAsText(f);
153
153
  }
154
154
  }
@@ -203,7 +203,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
203
203
  endsWith(sourceUpperCase, ".TOPOJSON")) {
204
204
  DataSource = GeoJsonDataSource;
205
205
  } else {
206
- viewer.onDropError.raiseEvent(viewer, source, 'Unrecognized file extension: ' + source);
206
+ viewer.dropError.raiseEvent(viewer, source, 'Unrecognized file extension: ' + source);
207
207
  return undefined;
208
208
  }
209
209
 
@@ -213,17 +213,17 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
213
213
  when(dataSource.load(JSON.parse(evt.target.result), source), function() {
214
214
  viewer.dataSources.add(dataSource);
215
215
  }, function(error) {
216
- viewer.onDropError.raiseEvent(viewer, source, error);
216
+ viewer.dropError.raiseEvent(viewer, source, error);
217
217
  });
218
218
  } catch (error) {
219
- viewer.onDropError.raiseEvent(viewer, source, error);
219
+ viewer.dropError.raiseEvent(viewer, source, error);
220
220
  }
221
221
  };
222
222
  }
223
223
 
224
- function createOnDropErrorCallback(viewer, name) {
224
+ function createDropErrorCallback(viewer, name) {
225
225
  return function(evt) {
226
- viewer.onDropError.raiseEvent(viewer, name, evt.target.error);
226
+ viewer.dropError.raiseEvent(viewer, name, evt.target.error);
227
227
  };
228
228
  }
229
229
 
@@ -39,12 +39,12 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
39
39
  if (viewer.hasOwnProperty('trackedObject')) {
40
40
  throw new DeveloperError('trackedObject is already defined by another mixin.');
41
41
  }
42
- if (viewer.hasOwnProperty('onObjectTracked')) {
43
- throw new DeveloperError('onObjectTracked is already defined by another mixin.');
42
+ if (viewer.hasOwnProperty('objectTracked')) {
43
+ throw new DeveloperError('objectTracked is already defined by another mixin.');
44
44
  }
45
45
 
46
46
  var eventHelper = new EventHelper();
47
- var onObjectTracked = new Event();
47
+ var objectTracked = new Event();
48
48
  var trackedObject;
49
49
  var dynamicObjectView;
50
50
 
@@ -138,7 +138,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
138
138
  if (trackedObject !== value) {
139
139
  trackedObject = value;
140
140
  dynamicObjectView = defined(value) ? new DynamicObjectView(value, viewer.scene, viewer.centralBody.getEllipsoid()) : undefined;
141
- onObjectTracked.raiseEvent(viewer, value);
141
+ objectTracked.raiseEvent(viewer, value);
142
142
  }
143
143
  }
144
144
  },
@@ -150,9 +150,9 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/define
150
150
  * @memberof viewerDynamicObjectMixin.prototype
151
151
  * @type {Event}
152
152
  */
153
- onObjectTracked : {
153
+ objectTracked : {
154
154
  get : function() {
155
- return onObjectTracked;
155
+ return objectTracked;
156
156
  }
157
157
  }
158
158
  });
@@ -8,4 +8,4 @@
8
8
  @import url(./Viewer/Viewer.css);
9
9
 
10
10
  /* Shared CSS classes are imported last, to ensure that the above CSS must override in an order-independent fashion. */
11
- @import url(../CesiumWidget/CesiumWidget.css);
11
+ @import url(./CesiumWidget/CesiumWidget.css);
@@ -1,3 +1,3 @@
1
1
  module Cesium
2
- VERSION = '0.22.0'
2
+ VERSION = '0.23.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cesium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogumil Wrona
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-02 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -264,6 +264,7 @@ files:
264
264
  - app/assets/javascripts/Core/LagrangePolynomialApproximation.js
265
265
  - app/assets/javascripts/Core/LeapSecond.js
266
266
  - app/assets/javascripts/Core/LinearApproximation.js
267
+ - app/assets/javascripts/Core/LinearSpline.js
267
268
  - app/assets/javascripts/Core/loadArrayBuffer.js
268
269
  - app/assets/javascripts/Core/loadBlob.js
269
270
  - app/assets/javascripts/Core/loadImage.js
@@ -277,8 +278,8 @@ files:
277
278
  - app/assets/javascripts/Core/Matrix3.js
278
279
  - app/assets/javascripts/Core/Matrix4.js
279
280
  - app/assets/javascripts/Core/NearFarScalar.js
281
+ - app/assets/javascripts/Core/ObjectOrientedBoundingBox.js
280
282
  - app/assets/javascripts/Core/Occluder.js
281
- - app/assets/javascripts/Core/OrientationInterpolator.js
282
283
  - app/assets/javascripts/Core/Packable.js
283
284
  - app/assets/javascripts/Core/PackableForInterpolation.js
284
285
  - app/assets/javascripts/Core/package.json
@@ -297,6 +298,7 @@ files:
297
298
  - app/assets/javascripts/Core/QuadraticRealPolynomial.js
298
299
  - app/assets/javascripts/Core/QuarticRealPolynomial.js
299
300
  - app/assets/javascripts/Core/Quaternion.js
301
+ - app/assets/javascripts/Core/QuaternionSpline.js
300
302
  - app/assets/javascripts/Core/Queue.js
301
303
  - app/assets/javascripts/Core/Ray.js
302
304
  - app/assets/javascripts/Core/ReferenceFrame.js
@@ -312,6 +314,7 @@ files:
312
314
  - app/assets/javascripts/Core/SphereGeometry.js
313
315
  - app/assets/javascripts/Core/SphereOutlineGeometry.js
314
316
  - app/assets/javascripts/Core/Spherical.js
317
+ - app/assets/javascripts/Core/Spline.js
315
318
  - app/assets/javascripts/Core/TaskProcessor.js
316
319
  - app/assets/javascripts/Core/throttleRequestByServer.js
317
320
  - app/assets/javascripts/Core/TimeConstants.js
@@ -1,106 +0,0 @@
1
- /*global define*/
2
- define(['Core/defined', 'Core/DeveloperError', 'Core/Quaternion'], function(
3
- defined,
4
- DeveloperError,
5
- Quaternion) {
6
- "use strict";
7
-
8
- /**
9
- * Smoothly interpolates orientation, represented by <code>Quaternion</code>s, over time.
10
- * For example, this can be used to set a camera's axes along a path.
11
- *
12
- * @alias OrientationInterpolator
13
- * @constructor
14
- *
15
- * @param {Array} controlPoints An array, of at least length 2, of objects with <code>orientation</code> and
16
- * <code>time</code> properties.
17
- *
18
- * @exception {DeveloperError} controlPoints is required. It must be an array with at least a length of 3.
19
- *
20
- * @see Quaternion
21
- * @see CatmullRomSpline
22
- * @see HermiteSpline
23
- */
24
- var OrientationInterpolator = function(controlPoints) {
25
- if (!defined(controlPoints) || !(controlPoints instanceof Array) || controlPoints.length < 2) {
26
- throw new DeveloperError('controlPoints is required. It must be an array with at least a length of 3.');
27
- }
28
-
29
- this._points = controlPoints;
30
- this._lastTimeIndex = 0;
31
- };
32
-
33
- /**
34
- * Returns the array of control points.
35
- *
36
- * @memberof OrientationInterpolator
37
- * @returns {Array} The array of control points.
38
- */
39
- OrientationInterpolator.prototype.getControlPoints = function() {
40
- return this._points;
41
- };
42
-
43
- function findIndex(orientationInterpolator, time) {
44
- // Take advantage of temporal coherence by checking current, next and previous intervals
45
- // for containment of time.
46
- var i = orientationInterpolator._lastTimeIndex || 0;
47
- if (time >= orientationInterpolator._points[i].time) {
48
- if (i + 1 < orientationInterpolator._points.length && time < orientationInterpolator._points[i + 1].time) {
49
- return i;
50
- } else if (i + 2 < orientationInterpolator._points.length && time < orientationInterpolator._points[i + 2].time) {
51
- orientationInterpolator._lastTimeIndex = i + 1;
52
- return orientationInterpolator._lastTimeIndex;
53
- }
54
- } else if (i - 1 >= 0 && time >= orientationInterpolator._points[i - 1].time) {
55
- orientationInterpolator._lastTimeIndex = i - 1;
56
- return orientationInterpolator._lastTimeIndex;
57
- }
58
-
59
- // The above failed so do a linear search. For the use cases so far, the
60
- // length of the list is less than 10. In the future, if there is a bottle neck,
61
- // it might be here.
62
- for (i = 0; i < orientationInterpolator._points.length - 1; ++i) {
63
- if (time >= orientationInterpolator._points[i].time && time < orientationInterpolator._points[i + 1].time) {
64
- break;
65
- }
66
- }
67
-
68
- if (i === orientationInterpolator._points.length - 1) {
69
- i = orientationInterpolator._points.length - 2;
70
- }
71
-
72
- orientationInterpolator._lastTimeIndex = i;
73
- return orientationInterpolator._lastTimeIndex;
74
- }
75
-
76
- /**
77
- * Evaluates the orientation at a given time.
78
- *
79
- * @memberof OrientationInterpolator
80
- *
81
- * @param {Number} time The time at which to evaluate the orientation.
82
- *
83
- * @exception {DeveloperError} time is required.
84
- * @exception {DeveloperError} time must be in the range <code>[a<sub>0</sub>, a<sub>n</sub>]</code>,
85
- * where <code>a<sub>0</sub></code> and <code>a<sub>n</sub></code> are the time properties of first and
86
- * last elements in the array given during construction, respectively.
87
- *
88
- * @returns {Quaternion} The orientation at the given <code>time</code>.
89
- */
90
- OrientationInterpolator.prototype.evaluate = function(time) {
91
- if (!defined(time)) {
92
- throw new DeveloperError('time is required.');
93
- }
94
-
95
- if (time < this._points[0].time || time > this._points[this._points.length - 1].time) {
96
- throw new DeveloperError('time is out of range.');
97
- }
98
-
99
- var i = findIndex(this, time);
100
- var u = (time - this._points[i].time) / (this._points[i + 1].time - this._points[i].time);
101
-
102
- return Quaternion.slerp(this._points[i].orientation, this._points[i + 1].orientation, u);
103
- };
104
-
105
- return OrientationInterpolator;
106
- });