From 0dfc49a2042105d515d4177f31a3ef225c409ceb Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 15 Jan 2012 21:04:22 -0800 Subject: j3dcore: use the BoundingSphere constructor to get an empty bounds where desired Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/GroupRetained.java | 9 +++------ src/classes/share/javax/media/j3d/SwitchRetained.java | 6 ++---- src/classes/share/javax/media/j3d/TransformGroupRetained.java | 3 +-- 3 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java index 46c982d..a6986fa 100644 --- a/src/classes/share/javax/media/j3d/GroupRetained.java +++ b/src/classes/share/javax/media/j3d/GroupRetained.java @@ -161,8 +161,7 @@ class GroupRetained extends NodeRetained implements BHLeafInterface { if (VirtualUniverse.mc.useBoxForGroupBounds) { localBounds = new BoundingBox((Bounds) null); } else { - localBounds = new BoundingSphere(); - ((BoundingSphere) localBounds).setRadius(-1.0); + localBounds = new BoundingSphere((Bounds)null); } } @@ -2484,8 +2483,7 @@ class GroupRetained extends NodeRetained implements BHLeafInterface { if (VirtualUniverse.mc.useBoxForGroupBounds) { cachedBounds = new BoundingBox((Bounds) null); } else { - cachedBounds = new BoundingSphere(); - ((BoundingSphere) cachedBounds).setRadius(-1); + cachedBounds = new BoundingSphere((Bounds)null); } for (int i = children.size() - 1; i >= 0; i--) { NodeRetained child = (NodeRetained) children.get(i); @@ -2521,8 +2519,7 @@ class GroupRetained extends NodeRetained implements BHLeafInterface { if (VirtualUniverse.mc.useBoxForGroupBounds) { boundingObject = new BoundingBox((Bounds) null); } else { - boundingObject = new BoundingSphere(); - ((BoundingSphere) boundingObject).setRadius(-1.0); + boundingObject = new BoundingSphere((Bounds)null); } for (int i = children.size() - 1; i >= 0; i--) { NodeRetained child = (NodeRetained) children.get(i); diff --git a/src/classes/share/javax/media/j3d/SwitchRetained.java b/src/classes/share/javax/media/j3d/SwitchRetained.java index 5a0b595..e02a789 100644 --- a/src/classes/share/javax/media/j3d/SwitchRetained.java +++ b/src/classes/share/javax/media/j3d/SwitchRetained.java @@ -669,8 +669,7 @@ class SwitchRetained extends GroupRetained implements TargetsInterface if (VirtualUniverse.mc.useBoxForGroupBounds) { cachedBounds = new BoundingBox((Bounds) null); } else { - cachedBounds = new BoundingSphere(); - ((BoundingSphere) cachedBounds).setRadius(-1); + cachedBounds = new BoundingSphere((Bounds)null); } if (whichChild == Switch.CHILD_ALL) { for (i = 0; i < children.size(); i++) { @@ -728,8 +727,7 @@ class SwitchRetained extends GroupRetained implements TargetsInterface if (VirtualUniverse.mc.useBoxForGroupBounds) { boundingObject = new BoundingBox((Bounds) null); } else { - boundingObject = new BoundingSphere(); - ((BoundingSphere) boundingObject).setRadius(-1.0); + boundingObject = new BoundingSphere((Bounds)null); } if (whichChild == Switch.CHILD_ALL) { diff --git a/src/classes/share/javax/media/j3d/TransformGroupRetained.java b/src/classes/share/javax/media/j3d/TransformGroupRetained.java index 4f1781b..4d98a5e 100644 --- a/src/classes/share/javax/media/j3d/TransformGroupRetained.java +++ b/src/classes/share/javax/media/j3d/TransformGroupRetained.java @@ -807,8 +807,7 @@ class TransformGroupRetained extends GroupRetained implements TargetsInterface if (VirtualUniverse.mc.useBoxForGroupBounds) { boundingObject = new BoundingBox((Bounds) null); } else { - boundingObject = new BoundingSphere(); - ((BoundingSphere) boundingObject).setRadius(-1.0); + boundingObject = new BoundingSphere((Bounds)null); } if(boundsAutoCompute) { for (int i=children.size()-1; i>=0; i--) { -- cgit v1.2.3