aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/share/javax/media/j3d/BoundingBox.java11
-rw-r--r--src/classes/share/javax/media/j3d/BoundingSphere.java12
2 files changed, 4 insertions, 19 deletions
diff --git a/src/classes/share/javax/media/j3d/BoundingBox.java b/src/classes/share/javax/media/j3d/BoundingBox.java
index 9ccb4d8..817b831 100644
--- a/src/classes/share/javax/media/j3d/BoundingBox.java
+++ b/src/classes/share/javax/media/j3d/BoundingBox.java
@@ -61,7 +61,6 @@ final Point3d upper;
// reusable temp objects
private BoundingSphere tmpSphere = null;
- private BoundingBox tmpBox = null;
private BoundingPolytope tmpPolytope = null;
private Point3d tmpP3d = null;
@@ -657,13 +656,8 @@ public void setUpper(Point3d p1) {
}
if(boundsObject.boundId == BOUNDING_BOX){
- if (tmpBox == null) {
- tmpBox = new BoundingBox( (BoundingBox)boundsObject);
- } else {
- tmpBox.set((BoundingBox)boundsObject);
- }
- tmpBox.transform(matrix);
- this.set(tmpBox);
+ this.set(boundsObject);
+ this.transform(matrix);
}
else if(boundsObject.boundId == BOUNDING_SPHERE) {
if (tmpSphere == null) {
@@ -692,7 +686,6 @@ public void setUpper(Point3d p1) {
// Release the temporary fields:
if (releaseBoundingBoxMemory) {
tmpSphere = null;
- tmpBox = null;
tmpPolytope = null;
}
}
diff --git a/src/classes/share/javax/media/j3d/BoundingSphere.java b/src/classes/share/javax/media/j3d/BoundingSphere.java
index 2bf17a6..9e163f2 100644
--- a/src/classes/share/javax/media/j3d/BoundingSphere.java
+++ b/src/classes/share/javax/media/j3d/BoundingSphere.java
@@ -757,8 +757,6 @@ public void setCenter(Point3d center) {
* @param matrix a transformation matrix
*/
public void transform( Bounds boundsObject, Transform3D matrix) {
- double scale;
-
if (boundsObject == null || boundsObject.boundsIsEmpty) {
setEmptyBounds();
return;
@@ -778,14 +776,8 @@ public void setCenter(Point3d center) {
tmpBox.transform(matrix);
this.set(tmpBox);
}else if( boundsObject.boundId == BOUNDING_SPHERE ) {
- matrix.transform(((BoundingSphere)boundsObject).center, this.center);
- // A very simple radius scale.
- scale = matrix.getDistanceScale();
- this.radius = ((BoundingSphere)boundsObject).radius * scale;
- if (Double.isNaN(radius)) {
- setEmptyBounds();
- return;
- }
+ this.set(boundsObject);
+ this.transform(matrix);
} else if(boundsObject.boundId == BOUNDING_POLYTOPE) {
if (tmpPolytope == null) {
tmpPolytope = new BoundingPolytope((BoundingPolytope)boundsObject);