summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2007-11-28 18:07:20 +0000
committerChien Yang <[email protected]>2007-11-28 18:07:20 +0000
commitfeb9cb907951b0ba0961742ead6ba0a9a761e27b (patch)
tree490e3c2e1c3adc2ee21fceb86d31a0f689a47a75
parent528102f8f0e3576352dda8749a73f9b13af26e91 (diff)
1) Completed the fix to issue 540.
2) Minor cleanup. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@875 ba19aa83-45c5-6ac9-afd3-db810772062c
-rw-r--r--src/classes/share/javax/media/j3d/GroupRetained.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/classes/share/javax/media/j3d/GroupRetained.java b/src/classes/share/javax/media/j3d/GroupRetained.java
index b006df0..f69a14b 100644
--- a/src/classes/share/javax/media/j3d/GroupRetained.java
+++ b/src/classes/share/javax/media/j3d/GroupRetained.java
@@ -15,7 +15,6 @@ package javax.media.j3d;
import java.util.Vector;
import java.util.Enumeration;
import java.util.ArrayList;
-import java.util.Hashtable;
/**
* Group node.
@@ -1089,7 +1088,7 @@ class GroupRetained extends NodeRetained implements BHLeafInterface {
newFogs = new ArrayList();
for (int i = 0; i < localToVworldKeys.length; i++) {
newFogs.add(new ArrayList());
- };
+ }
}
else {
newFogs = new ArrayList();
@@ -1326,18 +1325,18 @@ class GroupRetained extends NodeRetained implements BHLeafInterface {
void updatePickable(HashKey keys[], boolean pick[]) {
- int nchild = children.size()-1;
+ int numChildLessOne = children.size() - 1;
super.updatePickable(keys, pick);
int i=0;
NodeRetained child;
// Fix for issue 540
- if (children.size()==0) {
+ if (numChildLessOne < 0) {
return;
}
// End fix for issue 540
- for (i = 0; i < nchild; i++) {
+ for (i = 0; i < numChildLessOne; i++) {
child = (NodeRetained)children.get(i);
if(child != null)
child.updatePickable(keys, (boolean []) pick.clone());
@@ -1352,12 +1351,18 @@ class GroupRetained extends NodeRetained implements BHLeafInterface {
void updateCollidable(HashKey keys[], boolean collide[]) {
- int nchild = children.size()-1;
+ int numChildLessOne = children.size() - 1;
super.updateCollidable(keys, collide);
int i=0;
NodeRetained child;
- for (i = 0; i < nchild; i++) {
+ // Fix for issue 540
+ if (numChildLessOne < 0) {
+ return;
+ }
+ // End fix for issue 540
+
+ for (i = 0; i < numChildLessOne; i++) {
child = (NodeRetained)children.get(i);
if(child != null)
child.updateCollidable(keys, (boolean []) collide.clone());