app/assets/javascripts/Core/BoxOutlineGeometry.js in cesium-0.20.0 vs app/assets/javascripts/Core/BoxOutlineGeometry.js in cesium-0.21

- old
+ new

@@ -48,12 +48,12 @@ if (!defined(max)) { throw new DeveloperError('options.maximumCorner is required'); } - this._min = min; - this._max = max; + this._min = Cartesian3.clone(min); + this._max = Cartesian3.clone(max); this._workerName = 'createBoxOutlineGeometry'; }; /** * Creates an outline of a cube centered at the origin given its dimensions. @@ -82,12 +82,12 @@ if (dimensions.x < 0 || dimensions.y < 0 || dimensions.z < 0) { throw new DeveloperError('All dimensions components must be greater than or equal to zero.'); } - var corner = dimensions.multiplyByScalar(0.5); - var min = corner.negate(); + var corner = Cartesian3.multiplyByScalar(dimensions, 0.5); + var min = Cartesian3.negate(corner); var max = corner; var newOptions = { minimumCorner : min, maximumCorner : max @@ -173,17 +173,17 @@ indices[21] = 6; indices[22] = 3; indices[23] = 7; var diff = Cartesian3.subtract(max, min, diffScratch); - var radius = diff.magnitude() * 0.5; + var radius = Cartesian3.magnitude(diff) * 0.5; return new Geometry({ attributes : attributes, indices : indices, primitiveType : PrimitiveType.LINES, boundingSphere : new BoundingSphere(Cartesian3.ZERO, radius) }); }; return BoxOutlineGeometry; -}); \ No newline at end of file +});