de.javagl.swogl.rendering
Class PickingRayComputerJOGL

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

public class PickingRayComputerJOGL
extends java.lang.Object
implements de.javagl.swogl.PickingRayComputer

Implementation of a PickingRayComputer that obtains the information required for picking from the viewport and modelview and projection matrix of JOGL.

This implementation requires the current GL object to work. This GL object should be set by calling setGL(GL2) in the GLEventListener#init(GLDrawable) method of JOGL.
Note that, in order to make this PickingRayComputer work properly, the update() method has to be called after the GL modelview matrix has been set up to include the view transformation.


Constructor Summary
PickingRayComputerJOGL()
          Creates a new PickingRayComputerJOGL
 
Method Summary
 de.javagl.swogl.geometry.Ray computePickingRay(int x, int y)
           
 void setGL(javax.media.opengl.GL2 gl)
          Set the current GL
 void update()
          Update this picking ray computer based on the state that is obtained from the current GL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PickingRayComputerJOGL

public PickingRayComputerJOGL()
Creates a new PickingRayComputerJOGL

Method Detail

setGL

public void setGL(javax.media.opengl.GL2 gl)
Set the current GL

Parameters:
gl - The GL

update

public void update()
Update this picking ray computer based on the state that is obtained from the current GL. This method should be called during each rendering pass, on the rendering thread.


computePickingRay

public de.javagl.swogl.geometry.Ray computePickingRay(int x,
                                                      int y)
Specified by:
computePickingRay in interface de.javagl.swogl.PickingRayComputer