Class HitResult


public class HitResult
extends java.lang.Object

The immutable result object of a pick operation target hit, which occurs between a picker and a pickable object. Allows pick hits to return as much information as is readily and efficiently available. (TODO: Is this true???) All hit geometry is defined relative to the root graphic space (world, view, display), not the picker or pickable local space.

$Revision: 1.2 $
Jon Barrilleaux ( of JMB and Associates Inc.

Constructor Summary
HitResult(java.lang.Object picker, java.lang.Object pickable, java.lang.Object target, double dist, java.util.Map info)
          Creates an instance.
Method Summary
 double getDistance()
 java.lang.Object getInformation(java.lang.Object hitFlag)
 java.lang.Object getPickable()
 java.lang.Object getPicker()
 java.lang.Object getTarget()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public HitResult(java.lang.Object picker,
                 java.lang.Object pickable,
                 java.lang.Object target,
                 double dist,
                 java.util.Map info)
Creates an instance.

picker - Reference to the picker making the hit. Never null.
pickable - Reference to the pickable object that is or contains the hit. Never null.
target - Reference to the target object that was hit. Never null. Will be different from the pickable if the pickable is a space or context containing the actual target objects.
dist - Distance of the hit relative to the picker position), which is the basis for ordering hits if required. <0.0 if unknown or not readily available (an invalid distance). 0.0 if distance is required but irrelavent, such as in simple forms of proximity and visibility detection. Must be valid if the pick operation has the Picks.PICK_ORDERED flag set.
info - Hit information map, which maps hit flags (Object) to hit information whose type is defined by the hit flag. Possibly empty but never null. Typically, hit flags are Picks.HIT_???, and HIT_DISTANCE is not included since it is a parameter.
Method Detail


public java.lang.Object getPicker()


public java.lang.Object getPickable()


public java.lang.Object getTarget()


public double getDistance()


public java.lang.Object getInformation(java.lang.Object hitFlag)