de.javagl.swogl
Class DefaultPickingRayComputer

java.lang.Object
  extended by de.javagl.swogl.DefaultPickingRayComputer
All Implemented Interfaces:
PickingRayComputer

public final class DefaultPickingRayComputer
extends java.lang.Object
implements PickingRayComputer

Implementation of a PickingRayComputer that computes the picking Ray based on a given Camera and View.


Constructor Summary
DefaultPickingRayComputer(Camera camera, View view)
          Creates a new picking ray computer that computes the picking ray based on the given camera and view.
 
Method Summary
 Ray computePickingRay(int x, int y)
          Returns the picking Ray for the given position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPickingRayComputer

public DefaultPickingRayComputer(Camera camera,
                                 View view)
Creates a new picking ray computer that computes the picking ray based on the given camera and view.

Parameters:
camera - The camera to operate on.
view - The view to operate on.
Method Detail

computePickingRay

public Ray computePickingRay(int x,
                             int y)
Description copied from interface: PickingRayComputer
Returns the picking Ray for the given position. The position is given in local screen coordinates. The direction of the returned ray is normalized.

Specified by:
computePickingRay in interface PickingRayComputer
Parameters:
x - The x-coordinate
y - The y-coordinate
Returns:
The picking ray