cesium 0.21 → 0.21.1
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/Assets/Textures/moonSmall.jpg +0 -0
- data/app/assets/javascripts/Cesium.js +10 -1
- data/app/assets/javascripts/Core/Cartesian2.js +28 -0
- data/app/assets/javascripts/Core/Cartesian3.js +28 -0
- data/app/assets/javascripts/Core/Cartesian4.js +28 -0
- data/app/assets/javascripts/Core/CatmullRomSpline.js +3 -3
- data/app/assets/javascripts/Core/Clock.js +7 -7
- data/app/assets/javascripts/Core/Color.js +1 -1
- data/app/assets/javascripts/Core/ComponentDatatype.js +11 -7
- data/app/assets/javascripts/Core/CorridorGeometryLibrary.js +23 -29
- data/app/assets/javascripts/Core/Ellipsoid.js +6 -0
- data/app/assets/javascripts/Core/EllipsoidTangentPlane.js +5 -4
- data/app/assets/javascripts/Core/Event.js +2 -1
- data/app/assets/javascripts/Core/ExtentGeometry.js +1 -1
- data/app/assets/javascripts/Core/ExtentOutlineGeometry.js +1 -1
- data/app/assets/javascripts/Core/GeometryAttributes.js +1 -1
- data/app/assets/javascripts/Core/GeometryInstance.js +2 -2
- data/app/assets/javascripts/Core/GeometryPipeline.js +10 -7
- data/app/assets/javascripts/Core/HermiteSpline.js +1 -1
- data/app/assets/javascripts/Core/Iau2000Orientation.js +132 -0
- data/app/assets/javascripts/Core/IauOrientationAxes.js +98 -0
- data/app/assets/javascripts/Core/IauOrientationParameters.js +48 -0
- data/app/assets/javascripts/Core/IntersectionTests.js +5 -5
- data/app/assets/javascripts/Core/JulianDate.js +27 -5
- data/app/assets/javascripts/Core/Math.js +9 -0
- data/app/assets/javascripts/Core/Matrix2.js +1 -142
- data/app/assets/javascripts/Core/Matrix3.js +168 -153
- data/app/assets/javascripts/Core/Matrix4.js +0 -249
- data/app/assets/javascripts/Core/NearFarScalar.js +13 -0
- data/app/assets/javascripts/Core/PolygonGeometry.js +1 -1
- data/app/assets/javascripts/Core/PolygonOutlineGeometry.js +2 -2
- data/app/assets/javascripts/Core/PolygonPipeline.js +2 -2
- data/app/assets/javascripts/Core/PolylinePipeline.js +7 -3
- data/app/assets/javascripts/Core/PolylineVolumeGeometry.js +239 -0
- data/app/assets/javascripts/Core/PolylineVolumeGeometryLibrary.js +404 -0
- data/app/assets/javascripts/Core/PolylineVolumeOutlineGeometry.js +154 -0
- data/app/assets/javascripts/Core/Quaternion.js +37 -10
- data/app/assets/javascripts/Core/Shapes.js +26 -2
- data/app/assets/javascripts/Core/Simon1994PlanetaryPositions.js +3 -3
- data/app/assets/javascripts/Core/TimeInterval.js +28 -17
- data/app/assets/javascripts/Core/TimeIntervalCollection.js +30 -0
- data/app/assets/javascripts/Core/Transforms.js +5 -5
- data/app/assets/javascripts/Core/WallGeometryLibrary.js +2 -2
- data/app/assets/javascripts/Core/getFilenameFromUri.js +37 -0
- data/app/assets/javascripts/DynamicScene/ColorMaterialProperty.js +2 -2
- data/app/assets/javascripts/DynamicScene/CzmlDataSource.js +96 -18
- data/app/assets/javascripts/DynamicScene/DataSource.js +8 -0
- data/app/assets/javascripts/DynamicScene/DynamicBillboard.js +15 -3
- data/app/assets/javascripts/DynamicScene/DynamicBillboardVisualizer.js +6 -1
- data/app/assets/javascripts/DynamicScene/DynamicConeVisualizerUsingCustomSensor.js +1 -1
- data/app/assets/javascripts/DynamicScene/DynamicLabel.js +12 -1
- data/app/assets/javascripts/DynamicScene/DynamicLabelVisualizer.js +5 -0
- data/app/assets/javascripts/DynamicScene/DynamicObject.js +44 -17
- data/app/assets/javascripts/DynamicScene/DynamicObjectView.js +3 -3
- data/app/assets/javascripts/DynamicScene/DynamicPoint.js +12 -1
- data/app/assets/javascripts/DynamicScene/DynamicPointVisualizer.js +11 -2
- data/app/assets/javascripts/DynamicScene/DynamicPolyline.js +10 -30
- data/app/assets/javascripts/DynamicScene/DynamicPolylineVisualizer.js +5 -20
- data/app/assets/javascripts/DynamicScene/GeoJsonDataSource.js +26 -8
- data/app/assets/javascripts/DynamicScene/GridMaterialProperty.js +2 -2
- data/app/assets/javascripts/DynamicScene/ImageMaterialProperty.js +2 -2
- data/app/assets/javascripts/DynamicScene/PolylineOutlineMaterialProperty.js +66 -0
- data/app/assets/javascripts/DynamicScene/PositionProperty.js +3 -3
- data/app/assets/javascripts/DynamicScene/ReferenceProperty.js +1 -1
- data/app/assets/javascripts/DynamicScene/SampledProperty.js +14 -8
- data/app/assets/javascripts/Renderer/AutomaticUniforms.js +4 -3
- data/app/assets/javascripts/Renderer/Context.js +16 -2
- data/app/assets/javascripts/Renderer/UniformState.js +14 -14
- data/app/assets/javascripts/Scene/Billboard.js +102 -26
- data/app/assets/javascripts/Scene/BillboardCollection.js +69 -16
- data/app/assets/javascripts/Scene/Camera.js +7 -7
- data/app/assets/javascripts/Scene/CameraController.js +23 -12
- data/app/assets/javascripts/Scene/CameraFlightPath.js +11 -11
- data/app/assets/javascripts/Scene/CentralBodySurface.js +1 -1
- data/app/assets/javascripts/Scene/CustomSensorVolume.js +17 -2
- data/app/assets/javascripts/Scene/EllipsoidPrimitive.js +79 -24
- data/app/assets/javascripts/Scene/ExtentPrimitive.js +17 -1
- data/app/assets/javascripts/Scene/Label.js +94 -18
- data/app/assets/javascripts/Scene/LabelCollection.js +6 -2
- data/app/assets/javascripts/Scene/Moon.js +150 -0
- data/app/assets/javascripts/Scene/Polygon.js +18 -1
- data/app/assets/javascripts/Scene/Polyline.js +32 -13
- data/app/assets/javascripts/Scene/PolylineCollection.js +7 -6
- data/app/assets/javascripts/Scene/Primitive.js +2 -2
- data/app/assets/javascripts/Scene/RectangularPyramidSensorVolume.js +12 -0
- data/app/assets/javascripts/Scene/Scene.js +122 -14
- data/app/assets/javascripts/Scene/SceneTransforms.js +2 -2
- data/app/assets/javascripts/Scene/SceneTransitioner.js +4 -4
- data/app/assets/javascripts/Scene/ScreenSpaceCameraController.js +1 -1
- data/app/assets/javascripts/Scene/SkyBox.js +53 -48
- data/app/assets/javascripts/Scene/TileMapServiceImageryProvider.js +2 -2
- data/app/assets/javascripts/Shaders/BillboardCollectionVS.glsl +36 -14
- data/app/assets/javascripts/Shaders/BillboardCollectionVS.js +27 -9
- data/app/assets/javascripts/Shaders/Builtin/Functions/phong.glsl +13 -0
- data/app/assets/javascripts/Shaders/Builtin/Functions/phong.js +10 -0
- data/app/assets/javascripts/Shaders/EllipsoidFS.glsl +24 -0
- data/app/assets/javascripts/Shaders/EllipsoidFS.js +21 -1
- data/app/assets/javascripts/Widgets/CesiumWidget/CesiumWidget.js +30 -9
- data/app/assets/javascripts/Widgets/HomeButton/HomeButtonViewModel.js +6 -5
- data/app/assets/javascripts/Widgets/Viewer/Viewer.js +13 -0
- data/app/assets/javascripts/Widgets/Viewer/viewerDynamicObjectMixin.js +46 -4
- data/app/assets/javascripts/Workers/cesiumWorkerBootstrapper.js +16 -8
- data/app/assets/javascripts/Workers/createPolylineVolumeGeometry.js +23 -0
- data/app/assets/javascripts/Workers/createPolylineVolumeOutlineGeometry.js +23 -0
- data/lib/cesium/version.rb +1 -1
- metadata +15 -5
- data/test/dummy/tmp/pids/server.pid +0 -1
|
@@ -16,6 +16,14 @@ define(['Core/DeveloperError'], function(
|
|
|
16
16
|
*/
|
|
17
17
|
var DataSource = throwInstantiationError;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Gets the name of this data source.
|
|
21
|
+
* @memberof DataSource
|
|
22
|
+
*
|
|
23
|
+
* @returns {String} The name.
|
|
24
|
+
*/
|
|
25
|
+
DataSource.prototype.getName = throwInstantiationError;
|
|
26
|
+
|
|
19
27
|
/**
|
|
20
28
|
* Gets an event that will be raised when non-time-Varying data changes
|
|
21
29
|
* or if the return value of getIsTimeVarying changes.
|
|
@@ -27,6 +27,8 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
27
27
|
this._eyeOffset = undefined;
|
|
28
28
|
this._pixelOffset = undefined;
|
|
29
29
|
this._show = undefined;
|
|
30
|
+
this._scaleByDistance = undefined;
|
|
31
|
+
this._translucencyByDistance = undefined;
|
|
30
32
|
this._propertyChanged = new Event();
|
|
31
33
|
};
|
|
32
34
|
|
|
@@ -134,7 +136,15 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
134
136
|
* @memberof DynamicBillboard.prototype
|
|
135
137
|
* @type {Property}
|
|
136
138
|
*/
|
|
137
|
-
|
|
139
|
+
scaleByDistance : createDynamicPropertyDescriptor('scaleByDistance', '_scaleByDistance'),
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Gets or sets the {@link NearFarScalar} {@link Property} used to set translucency based on distance.
|
|
143
|
+
* If undefined, a constant size is used.
|
|
144
|
+
* @memberof DynamicBillboard.prototype
|
|
145
|
+
* @type {Property}
|
|
146
|
+
*/
|
|
147
|
+
translucencyByDistance : createDynamicPropertyDescriptor('translucencyByDistance', '_translucencyByDistance')
|
|
138
148
|
});
|
|
139
149
|
|
|
140
150
|
/**
|
|
@@ -160,7 +170,8 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
160
170
|
result.verticalOrigin = this._verticalOrigin;
|
|
161
171
|
result.width = this._width;
|
|
162
172
|
result.height = this._height;
|
|
163
|
-
result.
|
|
173
|
+
result.scaleByDistance = this._scaleByDistance;
|
|
174
|
+
result.translucencyByDistance = this._translucencyByDistance;
|
|
164
175
|
return result;
|
|
165
176
|
};
|
|
166
177
|
|
|
@@ -188,7 +199,8 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
188
199
|
this.verticalOrigin = defaultValue(this._verticalOrigin, source._verticalOrigin);
|
|
189
200
|
this.width = defaultValue(this._width, source._width);
|
|
190
201
|
this.height = defaultValue(this._height, source._height);
|
|
191
|
-
this.
|
|
202
|
+
this.scaleByDistance = defaultValue(this._scaleByDistance, source._scaleByDistance);
|
|
203
|
+
this.translucencyByDistance = defaultValue(this._translucencyByDistance, source._translucencyByDistance);
|
|
192
204
|
};
|
|
193
205
|
|
|
194
206
|
return DynamicBillboard;
|
|
@@ -341,10 +341,15 @@ define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Color
|
|
|
341
341
|
billboard.setHeight(property.getValue(time));
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
property = dynamicBillboard.
|
|
344
|
+
property = dynamicBillboard._scaleByDistance;
|
|
345
345
|
if (defined(property)) {
|
|
346
346
|
billboard.setScaleByDistance(property.getValue(time));
|
|
347
347
|
}
|
|
348
|
+
|
|
349
|
+
property = dynamicBillboard._translucencyByDistance;
|
|
350
|
+
if (defined(property)) {
|
|
351
|
+
billboard.setTranslucencyByDistance(property.getValue(time));
|
|
352
|
+
}
|
|
348
353
|
}
|
|
349
354
|
|
|
350
355
|
DynamicBillboardVisualizer.prototype._onObjectsRemoved = function(dynamicObjectCollection, added, dynamicObjects) {
|
|
@@ -269,7 +269,7 @@ define(['Core/Cartesian3', 'Core/Color', 'Core/defined', 'Core/destroyObject', '
|
|
|
269
269
|
|
|
270
270
|
// CZML_TODO Determine official defaults
|
|
271
271
|
cone.material = Material.fromType(Material.ColorType);
|
|
272
|
-
cone.intersectionColor = Color.
|
|
272
|
+
cone.intersectionColor = Color.clone(Color.YELLOW);
|
|
273
273
|
cone.intersectionWidth = 5.0;
|
|
274
274
|
cone.radius = Number.POSITIVE_INFINITY;
|
|
275
275
|
cone.showIntersection = true;
|
|
@@ -26,6 +26,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
26
26
|
this._pixelOffset = undefined;
|
|
27
27
|
this._scale = undefined;
|
|
28
28
|
this._show = undefined;
|
|
29
|
+
this._translucencyByDistance = undefined;
|
|
29
30
|
this._propertyChanged = new Event();
|
|
30
31
|
};
|
|
31
32
|
|
|
@@ -123,7 +124,15 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
123
124
|
* @memberof DynamicLabel.prototype
|
|
124
125
|
* @type {Property}
|
|
125
126
|
*/
|
|
126
|
-
show : createDynamicPropertyDescriptor('show', '_show')
|
|
127
|
+
show : createDynamicPropertyDescriptor('show', '_show'),
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Gets or sets the {@link NearFarScalar} {@link Property} used to set translucency based on distance.
|
|
131
|
+
* If undefined, a constant size is used.
|
|
132
|
+
* @memberof DynamicLabel.prototype
|
|
133
|
+
* @type {Property}
|
|
134
|
+
*/
|
|
135
|
+
translucencyByDistance : createDynamicPropertyDescriptor('translucencyByDistance', '_translucencyByDistance')
|
|
127
136
|
});
|
|
128
137
|
|
|
129
138
|
/**
|
|
@@ -149,6 +158,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
149
158
|
result.verticalOrigin = this.verticalOrigin;
|
|
150
159
|
result.eyeOffset = this.eyeOffset;
|
|
151
160
|
result.pixelOffset = this.pixelOffset;
|
|
161
|
+
result.translucencyByDistance = this._translucencyByDistance;
|
|
152
162
|
return result;
|
|
153
163
|
};
|
|
154
164
|
|
|
@@ -176,6 +186,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
176
186
|
this.verticalOrigin = defaultValue(this.verticalOrigin, source.verticalOrigin);
|
|
177
187
|
this.eyeOffset = defaultValue(this.eyeOffset, source.eyeOffset);
|
|
178
188
|
this.pixelOffset = defaultValue(this.pixelOffset, source.pixelOffset);
|
|
189
|
+
this.translucencyByDistance = defaultValue(this._translucencyByDistance, source._translucencyByDistance);
|
|
179
190
|
};
|
|
180
191
|
|
|
181
192
|
return DynamicLabel;
|
|
@@ -320,6 +320,11 @@ define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Color
|
|
|
320
320
|
label.setVerticalOrigin(verticalOrigin);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
+
|
|
324
|
+
property = dynamicLabel._translucencyByDistance;
|
|
325
|
+
if (defined(property)) {
|
|
326
|
+
label.setTranslucencyByDistance(property.getValue(time));
|
|
327
|
+
}
|
|
323
328
|
}
|
|
324
329
|
|
|
325
330
|
DynamicLabelVisualizer.prototype._onObjectsRemoved = function(dynamicObjectCollection, added, dynamicObjects) {
|
|
@@ -21,7 +21,7 @@ define(['Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/defineProp
|
|
|
21
21
|
* @alias DynamicObject
|
|
22
22
|
* @constructor
|
|
23
23
|
*
|
|
24
|
-
* @param {
|
|
24
|
+
* @param {String} [id] A unique identifier for this object. If no id is provided, a GUID is generated.
|
|
25
25
|
*
|
|
26
26
|
* @see Property
|
|
27
27
|
* @see DynamicObjectCollection
|
|
@@ -43,6 +43,8 @@ define(['Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/defineProp
|
|
|
43
43
|
this._ellipsoid = undefined;
|
|
44
44
|
this._ellipse = undefined;
|
|
45
45
|
this._label = undefined;
|
|
46
|
+
this._name = undefined;
|
|
47
|
+
this._parent = undefined;
|
|
46
48
|
this._path = undefined;
|
|
47
49
|
this._point = undefined;
|
|
48
50
|
this._polygon = undefined;
|
|
@@ -53,7 +55,7 @@ define(['Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/defineProp
|
|
|
53
55
|
this._viewFrom = undefined;
|
|
54
56
|
|
|
55
57
|
this._propertyChanged = new Event();
|
|
56
|
-
this._propertyNames = ['
|
|
58
|
+
this._propertyNames = ['parent', 'position', 'orientation', 'billboard', //
|
|
57
59
|
'cone', 'ellipsoid', 'ellipse', 'label', 'path', 'point', 'polygon', //
|
|
58
60
|
'polyline', 'pyramid', 'vertexPositions', 'vector', 'viewFrom'];
|
|
59
61
|
};
|
|
@@ -82,13 +84,32 @@ define(['Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/defineProp
|
|
|
82
84
|
/**
|
|
83
85
|
* Gets the unique ID associated with this object.
|
|
84
86
|
* @memberof DynamicObject.prototype
|
|
85
|
-
* @type {
|
|
87
|
+
* @type {String}
|
|
86
88
|
*/
|
|
87
89
|
id : {
|
|
88
90
|
get : function() {
|
|
89
91
|
return this._id;
|
|
90
92
|
}
|
|
91
93
|
},
|
|
94
|
+
/**
|
|
95
|
+
* Gets or sets the name of the object. The name is intended for end-user
|
|
96
|
+
* consumption and does not need to be unique.
|
|
97
|
+
* @memberof DynamicObject.prototype
|
|
98
|
+
* @type {String}
|
|
99
|
+
*/
|
|
100
|
+
name : {
|
|
101
|
+
configurable : false,
|
|
102
|
+
get : function() {
|
|
103
|
+
return this._name;
|
|
104
|
+
},
|
|
105
|
+
set : function(value) {
|
|
106
|
+
var oldValue = this._name;
|
|
107
|
+
if (oldValue !== value) {
|
|
108
|
+
this._name = value;
|
|
109
|
+
this._propertyChanged.raiseEvent(this, 'name', value, oldValue);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
92
113
|
/**
|
|
93
114
|
* The availability TimeInterval, if any, associated with this object.
|
|
94
115
|
* If availability is undefined, it is assumed that this object's
|
|
@@ -149,6 +170,12 @@ define(['Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/defineProp
|
|
|
149
170
|
* @type {DynamicLabel}
|
|
150
171
|
*/
|
|
151
172
|
label : createDynamicPropertyDescriptor('label', '_label'),
|
|
173
|
+
/**
|
|
174
|
+
* Gets or sets the parent object.
|
|
175
|
+
* @memberof DynamicObject.prototype
|
|
176
|
+
* @type {DynamicObject}
|
|
177
|
+
*/
|
|
178
|
+
parent : createDynamicPropertyDescriptor('parent', '_parent'),
|
|
152
179
|
/**
|
|
153
180
|
* Gets or sets the path.
|
|
154
181
|
* @memberof DynamicObject.prototype
|
|
@@ -279,30 +306,30 @@ define(['Core/createGuid', 'Core/defaultValue', 'Core/defined', 'Core/defineProp
|
|
|
279
306
|
if (!defined(source)) {
|
|
280
307
|
throw new DeveloperError('source is required.');
|
|
281
308
|
}
|
|
309
|
+
|
|
310
|
+
//Name and availability are not Property objects and are currently handled differently.
|
|
311
|
+
this.name = defaultValue(this.name, source.name);
|
|
282
312
|
this.availability = defaultValue(source.availability, this.availability);
|
|
283
313
|
|
|
284
314
|
var propertyNames = this._propertyNames;
|
|
285
315
|
var propertyNamesLength = propertyNames.length;
|
|
286
316
|
for ( var i = 0; i < propertyNamesLength; i++) {
|
|
287
317
|
var name = propertyNames[i];
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
if (defined(targetProperty.merge)) {
|
|
295
|
-
targetProperty.merge(sourceProperty);
|
|
296
|
-
}
|
|
297
|
-
} else if (defined(sourceProperty.merge) && defined(sourceProperty.clone)) {
|
|
298
|
-
this[name] = sourceProperty.clone();
|
|
299
|
-
} else {
|
|
300
|
-
this[name] = sourceProperty;
|
|
318
|
+
var targetProperty = this[name];
|
|
319
|
+
var sourceProperty = source[name];
|
|
320
|
+
if (defined(sourceProperty)) {
|
|
321
|
+
if (defined(targetProperty)) {
|
|
322
|
+
if (defined(targetProperty.merge)) {
|
|
323
|
+
targetProperty.merge(sourceProperty);
|
|
301
324
|
}
|
|
325
|
+
} else if (defined(sourceProperty.merge) && defined(sourceProperty.clone)) {
|
|
326
|
+
this[name] = sourceProperty.clone();
|
|
327
|
+
} else {
|
|
328
|
+
this[name] = sourceProperty;
|
|
302
329
|
}
|
|
303
330
|
}
|
|
304
331
|
}
|
|
305
332
|
};
|
|
306
333
|
|
|
307
334
|
return DynamicObject;
|
|
308
|
-
});
|
|
335
|
+
});
|
|
@@ -164,7 +164,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Math',
|
|
|
164
164
|
updateColumbusCartesian4.z = projectedPosition.y;
|
|
165
165
|
|
|
166
166
|
var tranform = camera.transform;
|
|
167
|
-
|
|
167
|
+
Matrix4.setColumn(tranform, 3, updateColumbusCartesian4, tranform);
|
|
168
168
|
|
|
169
169
|
var controller = that._screenSpaceCameraController;
|
|
170
170
|
controller.enableTranslate = false;
|
|
@@ -209,9 +209,9 @@ define(['Core/defaultValue', 'Core/defined', 'Core/DeveloperError', 'Core/Math',
|
|
|
209
209
|
first2dUp.x = 0.0;
|
|
210
210
|
first2dUp.y = 0.0;
|
|
211
211
|
|
|
212
|
-
var theta =
|
|
212
|
+
var theta = endTheta - startTheta;
|
|
213
213
|
var rotation = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, theta, update3DControllerQuaternion);
|
|
214
|
-
Matrix3.fromQuaternion(rotation, update3DControllerMatrix3)
|
|
214
|
+
Matrix3.multiplyByVector(Matrix3.fromQuaternion(rotation, update3DControllerMatrix3), offset, offset);
|
|
215
215
|
}
|
|
216
216
|
Cartesian3.multiplyByScalar(Cartesian3.normalize(offset, offset), that._lastDistance, offset);
|
|
217
217
|
camera.controller.lookAt(offset, Cartesian3.ZERO, Cartesian3.UNIT_Z);
|
|
@@ -19,6 +19,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
19
19
|
this._outlineColor = undefined;
|
|
20
20
|
this._outlineWidth = undefined;
|
|
21
21
|
this._show = undefined;
|
|
22
|
+
this._scaleByDistance = undefined;
|
|
22
23
|
this._propertyChanged = new Event();
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -67,7 +68,15 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
67
68
|
* @memberof DynamicPoint.prototype
|
|
68
69
|
* @type {Property}
|
|
69
70
|
*/
|
|
70
|
-
show : createDynamicPropertyDescriptor('show', '_show')
|
|
71
|
+
show : createDynamicPropertyDescriptor('show', '_show'),
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets or sets the {@link NearFarScalar} {@link Property} used to scale billboards based on distance.
|
|
75
|
+
* If undefined, a constant size is used.
|
|
76
|
+
* @memberof DynamicBillboard.prototype
|
|
77
|
+
* @type {Property}
|
|
78
|
+
*/
|
|
79
|
+
scaleByDistance : createDynamicPropertyDescriptor('scaleByDistance', '_scaleByDistance')
|
|
71
80
|
});
|
|
72
81
|
|
|
73
82
|
/**
|
|
@@ -86,6 +95,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
86
95
|
result.outlineColor = this.outlineColor;
|
|
87
96
|
result.outlineWidth = this.outlineWidth;
|
|
88
97
|
result.show = this.show;
|
|
98
|
+
result.scaleByDistance = this.scaleByDistance;
|
|
89
99
|
return result;
|
|
90
100
|
};
|
|
91
101
|
|
|
@@ -106,6 +116,7 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
106
116
|
this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);
|
|
107
117
|
this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);
|
|
108
118
|
this.show = defaultValue(this.show, source.show);
|
|
119
|
+
this.scaleByDistance = defaultValue(this.scaleByDistance, source.scaleByDistance);
|
|
109
120
|
};
|
|
110
121
|
|
|
111
122
|
return DynamicPoint;
|
|
@@ -165,6 +165,7 @@ define(['Core/Color', 'Core/defaultValue', 'Core/defined', 'Core/destroyObject',
|
|
|
165
165
|
var color;
|
|
166
166
|
var position;
|
|
167
167
|
var outlineColor;
|
|
168
|
+
var scaleByDistance;
|
|
168
169
|
function updateObject(dynamicPointVisualizer, time, dynamicObject) {
|
|
169
170
|
var dynamicPoint = dynamicObject._point;
|
|
170
171
|
if (!defined(dynamicPoint)) {
|
|
@@ -208,8 +209,8 @@ define(['Core/Color', 'Core/defaultValue', 'Core/defined', 'Core/destroyObject',
|
|
|
208
209
|
billboard.dynamicObject = dynamicObject;
|
|
209
210
|
|
|
210
211
|
// CZML_TODO Determine official defaults
|
|
211
|
-
billboard._visualizerColor = Color.
|
|
212
|
-
billboard._visualizerOutlineColor = Color.
|
|
212
|
+
billboard._visualizerColor = Color.clone(Color.WHITE, billboard._visualizerColor);
|
|
213
|
+
billboard._visualizerOutlineColor = Color.clone(Color.BLACK, billboard._visualizerOutlineColor);
|
|
213
214
|
billboard._visualizerOutlineWidth = 0;
|
|
214
215
|
billboard._visualizerPixelSize = 1;
|
|
215
216
|
needRedraw = true;
|
|
@@ -260,6 +261,14 @@ define(['Core/Color', 'Core/defaultValue', 'Core/defined', 'Core/destroyObject',
|
|
|
260
261
|
}
|
|
261
262
|
}
|
|
262
263
|
|
|
264
|
+
property = dynamicPoint._scaleByDistance;
|
|
265
|
+
if (defined(property)) {
|
|
266
|
+
scaleByDistance = property.getValue(time, scaleByDistance);
|
|
267
|
+
if (defined(scaleByDistance)) {
|
|
268
|
+
billboard.setScaleByDistance(scaleByDistance);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
263
272
|
if (needRedraw) {
|
|
264
273
|
var cssColor = defaultValue(billboard._visualizerColor, Color.WHITE).toCssColorString();
|
|
265
274
|
var cssOutlineColor = defaultValue(billboard._visualizerOutlineColor, Color.BLACK).toCssColorString();
|
|
@@ -14,10 +14,8 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
14
14
|
* @constructor
|
|
15
15
|
*/
|
|
16
16
|
var DynamicPolyline = function() {
|
|
17
|
-
this._color = undefined;
|
|
18
|
-
this._outlineColor = undefined;
|
|
19
|
-
this._outlineWidth = undefined;
|
|
20
17
|
this._show = undefined;
|
|
18
|
+
this._material = undefined;
|
|
21
19
|
this._width = undefined;
|
|
22
20
|
this._propertyChanged = new Event();
|
|
23
21
|
};
|
|
@@ -35,32 +33,18 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
35
33
|
},
|
|
36
34
|
|
|
37
35
|
/**
|
|
38
|
-
* Gets or sets the
|
|
39
|
-
* @memberof DynamicPolyline.prototype
|
|
40
|
-
* @type {Property}
|
|
41
|
-
*/
|
|
42
|
-
color : createDynamicPropertyDescriptor('color', '_color'),
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Gets or sets the {@link Color} {@link Property} specifying the the line's outline color.
|
|
46
|
-
* @memberof DynamicPolyline.prototype
|
|
47
|
-
* @type {Property}
|
|
48
|
-
*/
|
|
49
|
-
outlineColor : createDynamicPropertyDescriptor('outlineColor', '_outlineColor'),
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Gets or sets the numeric {@link Property} specifying the the line's outline width.
|
|
36
|
+
* Gets or sets the boolean {@link Property} specifying the line's visibility.
|
|
53
37
|
* @memberof DynamicPolyline.prototype
|
|
54
38
|
* @type {Property}
|
|
55
39
|
*/
|
|
56
|
-
|
|
40
|
+
show : createDynamicPropertyDescriptor('show', '_show'),
|
|
57
41
|
|
|
58
42
|
/**
|
|
43
|
+
* Gets or sets the {@link MaterialProperty} specifying the appearance of the polyline.
|
|
59
44
|
* @memberof DynamicPolyline.prototype
|
|
60
|
-
*
|
|
61
|
-
* @type {Property}
|
|
45
|
+
* @type {MaterialProperty}
|
|
62
46
|
*/
|
|
63
|
-
|
|
47
|
+
material : createDynamicPropertyDescriptor('material', '_material'),
|
|
64
48
|
|
|
65
49
|
/**
|
|
66
50
|
* Gets or sets the numeric {@link Property} specifying the the line's width.
|
|
@@ -81,11 +65,9 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
81
65
|
if (!defined(result)) {
|
|
82
66
|
result = new DynamicPolyline();
|
|
83
67
|
}
|
|
84
|
-
result.color = this.color;
|
|
85
|
-
result.width = this.width;
|
|
86
|
-
result.outlineColor = this.outlineColor;
|
|
87
|
-
result.outlineWidth = this.outlineWidth;
|
|
88
68
|
result.show = this.show;
|
|
69
|
+
result.material = this.material;
|
|
70
|
+
result.width = this.width;
|
|
89
71
|
return result;
|
|
90
72
|
};
|
|
91
73
|
|
|
@@ -101,11 +83,9 @@ define(['Core/defaultValue', 'Core/defined', 'Core/defineProperties', 'Core/Deve
|
|
|
101
83
|
if (!defined(source)) {
|
|
102
84
|
throw new DeveloperError('source is required.');
|
|
103
85
|
}
|
|
104
|
-
this.color = defaultValue(this.color, source.color);
|
|
105
|
-
this.width = defaultValue(this.width, source.width);
|
|
106
|
-
this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);
|
|
107
|
-
this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);
|
|
108
86
|
this.show = defaultValue(this.show, source.show);
|
|
87
|
+
this.material = defaultValue(this.material, source.material);
|
|
88
|
+
this.width = defaultValue(this.width, source.width);
|
|
109
89
|
};
|
|
110
90
|
|
|
111
91
|
return DynamicPolyline;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*global define*/
|
|
2
|
-
define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Cartesian3', '
|
|
2
|
+
define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Cartesian3', 'DynamicScene/MaterialProperty', 'Scene/Material', 'Scene/PolylineCollection'], function(
|
|
3
3
|
DeveloperError,
|
|
4
4
|
defined,
|
|
5
5
|
destroyObject,
|
|
6
6
|
Cartesian3,
|
|
7
|
-
|
|
7
|
+
MaterialProperty,
|
|
8
8
|
Material,
|
|
9
9
|
PolylineCollection) {
|
|
10
10
|
"use strict";
|
|
@@ -177,6 +177,7 @@ define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Carte
|
|
|
177
177
|
var vertexPositionsProperty = dynamicObject._vertexPositions;
|
|
178
178
|
var polylineVisualizerIndex = dynamicObject._polylineVisualizerIndex;
|
|
179
179
|
var show = dynamicObject.isAvailable(time) && (!defined(showProperty) || showProperty.getValue(time));
|
|
180
|
+
var context = dynamicPolylineVisualizer._scene.getContext();
|
|
180
181
|
|
|
181
182
|
if (!show || //
|
|
182
183
|
(!defined(vertexPositionsProperty) && //
|
|
@@ -191,7 +192,6 @@ define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Carte
|
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
var uniforms;
|
|
195
195
|
if (!defined(polylineVisualizerIndex)) {
|
|
196
196
|
var unusedIndexes = dynamicPolylineVisualizer._unusedIndexes;
|
|
197
197
|
var length = unusedIndexes.length;
|
|
@@ -212,13 +212,8 @@ define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Carte
|
|
|
212
212
|
material = Material.fromType(Material.PolylineOutlineType);
|
|
213
213
|
polyline.setMaterial(material);
|
|
214
214
|
}
|
|
215
|
-
uniforms = material.uniforms;
|
|
216
|
-
Color.clone(Color.WHITE, uniforms.color);
|
|
217
|
-
Color.clone(Color.BLACK, uniforms.outlineColor);
|
|
218
|
-
uniforms.outlineWidth = 0;
|
|
219
215
|
} else {
|
|
220
216
|
polyline = dynamicPolylineVisualizer._polylineCollection.get(polylineVisualizerIndex);
|
|
221
|
-
uniforms = polyline.getMaterial().uniforms;
|
|
222
217
|
}
|
|
223
218
|
|
|
224
219
|
polyline.setShow(true);
|
|
@@ -235,19 +230,9 @@ define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Carte
|
|
|
235
230
|
polyline._visualizerPositions = vertexPositions;
|
|
236
231
|
}
|
|
237
232
|
|
|
238
|
-
var property = dynamicPolyline.
|
|
233
|
+
var property = dynamicPolyline._material;
|
|
239
234
|
if (defined(property)) {
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
property = dynamicPolyline._outlineColor;
|
|
244
|
-
if (defined(property)) {
|
|
245
|
-
uniforms.outlineColor = property.getValue(time, uniforms.outlineColor);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
property = dynamicPolyline._outlineWidth;
|
|
249
|
-
if (defined(property)) {
|
|
250
|
-
uniforms.outlineWidth = property.getValue(time);
|
|
235
|
+
polyline.setMaterial(MaterialProperty.getValue(time, property, polyline.getMaterial()));
|
|
251
236
|
}
|
|
252
237
|
|
|
253
238
|
property = dynamicPolyline._width;
|