From eee16fa23212d548b07de46cea267ecd8eee75b6 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Mon, 23 Jan 2017 16:56:43 -0500 Subject: [PATCH 1/2] This is @mramato's fix for the busted ellipsoid bounding spheres. --- Source/DataSources/dynamicGeometryGetBoundingSphere.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/DataSources/dynamicGeometryGetBoundingSphere.js b/Source/DataSources/dynamicGeometryGetBoundingSphere.js index 6763186b8b81..09e277d811c3 100644 --- a/Source/DataSources/dynamicGeometryGetBoundingSphere.js +++ b/Source/DataSources/dynamicGeometryGetBoundingSphere.js @@ -29,14 +29,12 @@ define([ //>>includeEnd('debug'); var attributes; - var modelMatrix; //Outline and Fill geometries have the same bounding sphere, so just use whichever one is defined and ready if (defined(primitive) && primitive.show && primitive.ready) { attributes = primitive.getGeometryInstanceAttributes(entity); if (defined(attributes) && defined(attributes.boundingSphere)) { - modelMatrix = defaultValue(primitive.modelMatrix, Matrix4.IDENTITY); - BoundingSphere.transform(attributes.boundingSphere, modelMatrix, result); + BoundingSphere.clone(attributes.boundingSphere, result); return BoundingSphereState.DONE; } } @@ -44,8 +42,7 @@ define([ if (defined(outlinePrimitive) && outlinePrimitive.show && outlinePrimitive.ready) { attributes = outlinePrimitive.getGeometryInstanceAttributes(entity); if (defined(attributes) && defined(attributes.boundingSphere)) { - modelMatrix = defaultValue(outlinePrimitive.modelMatrix, Matrix4.IDENTITY); - BoundingSphere.transform(attributes.boundingSphere, modelMatrix, result); + BoundingSphere.clone(attributes.boundingSphere, result); return BoundingSphereState.DONE; } } From 3df7deae56e4062110dad5e93aa7b79e518ad515 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Mon, 23 Jan 2017 17:07:57 -0500 Subject: [PATCH 2/2] Fix unit tests for bounding spheres. --- Specs/createDynamicGeometryBoundingSphereSpecs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Specs/createDynamicGeometryBoundingSphereSpecs.js b/Specs/createDynamicGeometryBoundingSphereSpecs.js index 55868924cbe4..b54661b3ec8d 100644 --- a/Specs/createDynamicGeometryBoundingSphereSpecs.js +++ b/Specs/createDynamicGeometryBoundingSphereSpecs.js @@ -35,7 +35,7 @@ define([ var primitive = scene.primitives.get(0); expect(state).toBe(BoundingSphereState.DONE); var attributes = primitive.getGeometryInstanceAttributes(entity); - expect(result).toEqualEpsilon(BoundingSphere.transform(attributes.boundingSphere, primitive.modelMatrix, new BoundingSphere()), CesiumMath.EPSILON6); + expect(result).toEqualEpsilon(attributes.boundingSphere, CesiumMath.EPSILON6); updater.destroy(); scene.primitives.removeAll(); @@ -62,7 +62,7 @@ define([ var primitive = scene.primitives.get(0); expect(state).toBe(BoundingSphereState.DONE); var attributes = primitive.getGeometryInstanceAttributes(entity); - expect(result).toEqualEpsilon(BoundingSphere.transform(attributes.boundingSphere, primitive.modelMatrix, new BoundingSphere()), CesiumMath.EPSILON6); + expect(result).toEqualEpsilon(attributes.boundingSphere, CesiumMath.EPSILON6); updater.destroy(); scene.primitives.removeAll();