l2.setStrokeColor(255, 10, 10, 255);
this.getAncestor().addChild(l2);
*/
//Check if component is clipped and only proceed if the ray intersects the clip shape
Clip clip = this.getClip();
if (clip == null || (clip != null && clip.getClipShapeIntersectionLocal(invertedRay) != null)){
interSP = this.getIntersectionLocal(invertedRay);
if (interSP != null){
//FIXME TRIAL - muss f�r die distance messung der world ray genommen
//werden oder geht der invertierte ray? -> musss wohl der world ray sein
interSP.transform(this.getGlobalMatrix());
// Get distance from raystart to the intersecting point
objDistance = interSP.getSubtracted(currentRay.getRayStartPoint()).length();
//System.out.println("Pick found: " + this.getName() + " InterSP: " + interSP + " ObjDist: " + objDistance + " Mouse Pos: " + pickInfo.getScreenXCoordinate() + "," + pickInfo.getScreenYCoordinate() + " InvRay RS:" + invertedRay.getRayStartPoint() + ",RE: " + invertedRay.getPointInRayDirection());
// //If the distance is the smallest yet = closest to the raystart: replace the returnObject and current distanceFrom
// if ( (objDistance - HIT_TOLERANCE) <= currObjDist /*|| this.isAlwaysDrawnOnTop()*/){//take isDrawnOnTop into account here?? -> OBJDistance auf 0 setzen?
// currObjDist = objDistance;
// pickResult.addPickedObject(this, interSP, objDistance);
//// System.out.println("-> Now nearest: " + this.getName());
// }
//FIXME TEST - ADD ALL PICKED OBJECTS - SORT LATER
pickResult.addPickedObject(this, interSP, objDistance);
}
}
//Check for child clipping shape intersection, if not intersecting -> dont try to pick children
Clip childClip = this.getChildClip();
if (childClip != null && childClip.getClipShapeIntersectionLocal(invertedRay) == null){
return currObjDist;
}
}
/* recursively check all children now */