aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2007-02-15 01:06:15 +0000
committerChien Yang <[email protected]>2007-02-15 01:06:15 +0000
commit8cfdfa582aaa411c47334c5c32363606f7c94eb6 (patch)
treecc44e21c633bc45cc5feb9b42a6bc5c5ab3290b4 /src
parent1b312d6d8e83609d74df2a4c5f1897caf02d68e8 (diff)
Fix to Issue 274 : NPE With Simultaneous View and Content Side PickingBehaviors
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@776 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/PickInfo.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/classes/share/javax/media/j3d/PickInfo.java b/src/classes/share/javax/media/j3d/PickInfo.java
index f1b0b0d..5c3c856 100644
--- a/src/classes/share/javax/media/j3d/PickInfo.java
+++ b/src/classes/share/javax/media/j3d/PickInfo.java
@@ -597,10 +597,17 @@ public class PickInfo extends Object {
Shape3DRetained shape = geomAtoms[i].source;
srcNode = shape.sourceNode;
+ // Fix to Issue 274 : NPE With Simultaneous View and Content Side PickingBehaviors
+ // This node isn't under the selected BG for pick operation.
+ if (!inside(shape.branchGroupPath,bgRetained)) {
+ continue;
+ }
+
if (srcNode == null) {
// The node is just detach from branch so sourceNode = null
continue;
}
+
// Special case, for Text3DRetained, it is possible
// for different geomAtoms pointing to the same
@@ -657,8 +664,7 @@ public class PickInfo extends Object {
pickInfo = null;
// PickInfo.SCENEGRAPHPATH - request for computed SceneGraphPath.
- if (((flags & SCENEGRAPHPATH) != 0) &&
- (inside(shape.branchGroupPath,bgRetained))){
+ if ((flags & SCENEGRAPHPATH) != 0){
if(first) {
mpath = createPath(srcNode, bgRetained, geomAtoms[i], initpath);
@@ -714,19 +720,18 @@ public class PickInfo extends Object {
Node[] mpath = null;
// PickInfo.SCENEGRAPHPATH - request for computed SceneGraphPath.
- if (((flags & SCENEGRAPHPATH) != 0) &&
- (inside(shape.branchGroupPath,bgRetained))) {
-
+ if ((flags & SCENEGRAPHPATH) != 0) {
+
mpath = createPath(srcNode, bgRetained, geomAtoms[i], initpath);
if(mpath != null) {
SceneGraphPath sgpath = new SceneGraphPath(locale, mpath,
(Node) srcNode.source);
sgpath.setTransform(shape.getCurrentLocalToVworld(0));
- if(pickInfo == null)
- pickInfo = new PickInfo();
+ if(pickInfo == null)
+ pickInfo = new PickInfo();
pickInfo.setSceneGraphPath(sgpath);
- }
+ }
}
// PickInfo.NODE - request for computed intersected Node.