de.rico.engine.geometry.collision.picking
Class RayMeshPicker

java.lang.Object
  extended by de.rico.engine.geometry.collision.picking.RayMeshPicker
All Implemented Interfaces:
MeshPickerIface

public class RayMeshPicker
extends java.lang.Object
implements MeshPickerIface

This class uses a picking ray to find the mesh that has been clicked on and doesn't make use of the internal OpenGL mesthod.

Author:
Frank Bruns

Method Summary
static RayMeshPicker getInstance()
          Returns the RayMeshPicker singleton instance.
 AbstractMesh getMesh(java.util.List<AbstractMesh> meshes, int screenX, int screenY)
          Returns the mesh that was clicked on, if it is set to be pickable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RayMeshPicker getInstance()
Returns the RayMeshPicker singleton instance.

Returns:
RayMeshPicker singleton instance

getMesh

public AbstractMesh getMesh(java.util.List<AbstractMesh> meshes,
                            int screenX,
                            int screenY)
Description copied from interface: MeshPickerIface
Returns the mesh that was clicked on, if it is set to be pickable. If no mesh was picked, the method returns null.

Specified by:
getMesh in interface MeshPickerIface
Parameters:
meshes - meshes to take into consideration for picking
screenX - x-position on screen
screenY - y-position on screen
Returns:
picked mesh