aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorpaulby <[email protected]>2007-04-23 18:44:29 +0000
committerpaulby <[email protected]>2007-04-23 18:44:29 +0000
commit464c325bf738716a77af113b250cb87b1dc8b5d0 (patch)
tree2632ee711c433f9e959764c8dde5bbe912547c19 /src/classes
parent8a4436ea3faed5f56424d9f7991253505e22b1e8 (diff)
Fix for issue 480.
The bounds were being cached after being transformed, which is not what getBounds expects. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@830 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes')
-rw-r--r--src/classes/share/javax/media/j3d/TransformGroupRetained.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/classes/share/javax/media/j3d/TransformGroupRetained.java b/src/classes/share/javax/media/j3d/TransformGroupRetained.java
index 3ef24af..518c84d 100644
--- a/src/classes/share/javax/media/j3d/TransformGroupRetained.java
+++ b/src/classes/share/javax/media/j3d/TransformGroupRetained.java
@@ -771,7 +771,14 @@ class TransformGroupRetained extends GroupRetained implements TargetsInterface
void computeCombineBounds(Bounds bounds) {
if (cachedBounds!=null && boundsAutoCompute) {
- bounds.combine(cachedBounds);
+ Bounds b = (Bounds) cachedBounds.clone();
+ // Should this be lock too ? ( MT safe ? )
+ // Thoughts :
+ // Make a temp copy with lock : transform.getWithLock(trans);, but this will cause gc ...
+ synchronized(transform) {
+ b.transform(transform);
+ }
+ bounds.combine(b);
return;
}
@@ -784,7 +791,11 @@ class TransformGroupRetained extends GroupRetained implements TargetsInterface
child = (NodeRetained)children.get(i);
if(child != null)
child.computeCombineBounds(boundingSphere);
- }
+ }
+
+ if (VirtualUniverse.mc.cacheAutoComputedBounds) {
+ cachedBounds = (Bounds) boundingSphere.clone();
+ }
}
else {
// Should this be lock too ? ( MT safe ? )
@@ -793,7 +804,7 @@ class TransformGroupRetained extends GroupRetained implements TargetsInterface
}
}
- // Should this be lock too ? ( MT safe ? )
+ // Should this be lock too ? ( MT safe ? )
// Thoughts :
// Make a temp copy with lock : transform.getWithLock(trans);, but this will cause gc ...
synchronized(transform) {
@@ -801,9 +812,6 @@ class TransformGroupRetained extends GroupRetained implements TargetsInterface
}
bounds.combine(boundingSphere);
- if (boundsAutoCompute && VirtualUniverse.mc.cacheAutoComputedBounds) {
- cachedBounds = boundingSphere;
- }
}
void processChildLocalToVworld(ArrayList dirtyTransformGroups,