/** Extract the picked node from the SceneGraphPath */ void storeNode () { if (pickedSceneGraphPath == null) { throw new RuntimeException ("SceneGraphPath missing"); } pickedNode = pickedSceneGraphPath.getObject(); }
/** Construct a PickResult using a SceneGraphPath @param sgp SceneGraphPath associated with this PickResult @param ps The pickShape to intersect against */ public PickResult (SceneGraphPath sgp, PickShape ps) { pickedSceneGraphPath = sgp; pickedNode = sgp.getObject(); localToVWorld = sgp.getTransform(); pickShape = ps; initPickShape(); }
Node pickedNode = sgPath.getObject();
/** * Constructs a new WakeupOnCollisionEntry criterion. * @param armingPath the path used to <em>arm</em> collision * detection * @param speedHint one of USE_GEOMETRY or USE_BOUNDS, specifies how * accurately Java 3D will perform collision detection * @param armingBounds the bounds object used to <em>arm</em> collision * detection * @exception IllegalArgumentException if hint is not one of * USE_GEOMETRY or USE_BOUNDS. * @exception IllegalArgumentException if object associated with the * SceneGraphPath is other than a Group, Shape3D, Morph, or * BoundingLeaf node. */ WakeupOnCollisionEntry(SceneGraphPath armingPath, int speedHint, Bounds armingBounds) { if (armingPath != null) { this.armingNode = (NodeRetained) armingPath.getObject().retained; nodeType = getNodeType(armingNode, armingPath, "WakeupOnCollisionEntry"); this.armingPath = armingPath; validateSpeedHint(speedHint, "WakeupOnCollisionEntry4"); } else { this.armingBounds = armingBounds; nodeType = BOUND; } accuracyMode = speedHint; WakeupIndexedList.init(this, TOTAL_INDEXED_UNORDER_SET_TYPES); }
/** * Constructs a new WakeupOnCollisionMovement criterion. * @param armingPath the path used to <em>arm</em> collision * detection * @param speedHint one of USE_GEOMETRY or USE_BOUNDS, specifies how * accurately Java 3D will perform collision detection * @param armingBounds the bounds object used to <em>arm</em> collision * detection * @exception IllegalArgumentException if hint is not one of * USE_GEOMETRY or USE_BOUNDS. * @exception IllegalArgumentException if object associated with the * SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node. */ WakeupOnCollisionMovement(SceneGraphPath armingPath, int speedHint, Bounds armingBounds) { if (armingPath != null) { this.armingNode = (NodeRetained) armingPath.getObject().retained; nodeType = WakeupOnCollisionEntry.getNodeType(armingNode, armingPath, "WakeupOnCollisionMovement"); this.armingPath = armingPath; WakeupOnCollisionEntry.validateSpeedHint(speedHint, "WakeupOnCollisionMovement4"); } else { this.armingBounds = armingBounds; nodeType = WakeupOnCollisionEntry.BOUND; } accuracyMode = speedHint; WakeupIndexedList.init(this, TOTAL_INDEXED_UNORDER_SET_TYPES); }
Node pickedNode = sgPath.getObject();
/** * Constructs a new WakeupOnCollisionExit criterion. * @param armingPath the path used to <em>arm</em> collision * detection * @param speedHint one of USE_GEOMETRY or USE_BOUNDS, specifies how * accurately Java 3D will perform collision detection * @param armingBounds the bounds object used to <em>arm</em> collision * detection * @exception IllegalArgumentException if hint is not one of * USE_GEOMETRY or USE_BOUNDS. * @exception IllegalArgumentException if object associated with the * SceneGraphPath is other than a Group, Shape3D, Morph, or BoundingLeaf node. */ WakeupOnCollisionExit(SceneGraphPath armingPath, int speedHint, Bounds armingBounds) { if (armingPath != null) { this.armingNode = (NodeRetained) armingPath.getObject().retained; nodeType = WakeupOnCollisionEntry.getNodeType(armingNode, armingPath, "WakeupOnCollisionExit"); this.armingPath = armingPath; WakeupOnCollisionEntry.validateSpeedHint(speedHint, "WakeupOnCollisionExit4"); } else { this.armingBounds = armingBounds; nodeType = WakeupOnCollisionEntry.BOUND; } accuracyMode = speedHint; WakeupIndexedList.init(this, TOTAL_INDEXED_UNORDER_SET_TYPES); }
private SceneGraphPath pickGeomAny(int xpos, int ypos) { Node obj; int i; pickRay = (PickRay) generatePickRay(xpos, ypos); sceneGraphPathArr = pickRoot.pickAll(pickRay); for(i=0; i<sceneGraphPathArr.length; i++) { obj = sceneGraphPathArr[i].getObject(); if(obj instanceof Shape3D) { if(((Shape3D) obj).intersect(sceneGraphPathArr[i],(PickShape) pickRay)) return sceneGraphPathArr[i]; } else if(obj instanceof Morph) { if(((Morph) obj).intersect(sceneGraphPathArr[i],(PickShape) pickRay)) return sceneGraphPathArr[i]; } } return null; }
obj = sceneGraphPathArr[i].getObject(); if(obj instanceof Shape3D) { found[i] = ((Shape3D) obj).intersect(sceneGraphPathArr[i],
Shape3D shape = (Shape3D) path.getObject();
private PickResult pickGeomAny (PickShape pickShape) { Node obj = null; int i; SceneGraphPath[] sgpa = null; if (pickRootBG != null) { sgpa = pickRootBG.pickAll(pickShape); } else if (pickRootL != null) { sgpa = pickRootL.pickAll(pickShape); } if (sgpa == null) return null; // no match for(i=0; i<sgpa.length; i++) { obj = sgpa[i].getObject(); PickResult pr = new PickResult(sgpa[i], pickShape); if(obj instanceof Shape3D) { if(((Shape3D) obj).intersect(sgpa[i], pickShape)) { return pr; } } else if (obj instanceof Morph) { if(((Morph) obj).intersect(sgpa[i], pickShape)){ return pr; } } } return null; }
PickResult[] pr = new PickResult[sgp.length]; for (i=0; i<sgp.length; i++) { obj[i] = sgp[i].getObject(); pr[i] = new PickResult (sgp[i], pickShape);
obj = sceneGraphPathArr[i].getObject(); if(obj instanceof Shape3D) { found[i] = ((Shape3D) obj).intersect(sceneGraphPathArr[i],
obj[i] = sgp[i].getObject(); pr[i] = new PickResult (sgp[i], pickShape); if (obj[i] instanceof Shape3D) {