org.xith3d.picking
Class PickingLibrary

java.lang.Object
  extended by org.xith3d.picking.PickingLibrary

public class PickingLibrary
extends java.lang.Object

This is used to convert Mouse coordinates to World coordinates


Constructor Summary
PickingLibrary()
           
 
Method Summary
static GeometryPickTester getGeometryPickTester()
           
static boolean isGeometryIgnored()
           
static void pickAll(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, AllPickListener l)
          Finds the closest intersection of a ray and a the nodes in a Group.
static void pickAll(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, AllPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a ray and a the nodes in a Group.
static void pickAll(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, AllPickListener l)
          Finds the closest intersection of a given List of NodeGroups with a given ray.
static void pickAll(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, AllPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a given List of NodeGroups with a given ray.
static void pickAll(java.util.List<? extends GroupNode> groups, org.openmali.vecmath2.Ray3f pickRay, org.jagatoo.input.devices.components.MouseButton button, AllPickListener l)
          Finds the closest intersection of a given List of NodeGroups with a given ray.
static void pickAll(java.util.List<? extends GroupNode> groups, org.openmali.vecmath2.Ray3f pickRay, org.jagatoo.input.devices.components.MouseButton button, AllPickListener l, java.lang.Object userObject)
          Finds all intersections of a given List of GroupNodes with a given ray.
static void pickAll(RenderPassConfig rpConfig, java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, AllPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a given List of NodeGroups with a given ray.
static void pickNearest(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l)
          Finds the closest intersection of a ray and a the nodes in a Group.
static void pickNearest(GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a ray and a the nodes in a Group.
static void pickNearest(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void pickNearest(java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void pickNearest(java.util.List<? extends GroupNode> groups, org.openmali.vecmath2.Ray3f pickRay, org.jagatoo.input.devices.components.MouseButton button, NearestPickListener l)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void pickNearest(java.util.List<? extends GroupNode> groups, org.openmali.vecmath2.Ray3f pickRay, org.jagatoo.input.devices.components.MouseButton button, NearestPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void pickNearest(RenderPassConfig rpConfig, GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void pickNearest(RenderPassConfig rpConfig, GroupNode group, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void pickNearest(RenderPassConfig rpConfig, java.util.List<? extends GroupNode> groups, Canvas3D canvas, org.jagatoo.input.devices.components.MouseButton button, int x, int y, NearestPickListener l, java.lang.Object userObject)
          Finds the closest intersection of a given List of GroupNodes with a given ray.
static void setGeometryIgnored(boolean geomIgnored)
          Sets whether bounds-wise detected pick-result-candidates are checked more prcisely for geometry-ray intersection.
static void setGeometryPickTester(GeometryPickTester geomPickTester)
          Sets the GeometryPickTester to use for Geometry-Ray intersection tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PickingLibrary

public PickingLibrary()
Method Detail

setGeometryPickTester

public static void setGeometryPickTester(GeometryPickTester geomPickTester)
Sets the GeometryPickTester to use for Geometry-Ray intersection tests.

Parameters:
geomPickTester -

getGeometryPickTester

public static final GeometryPickTester getGeometryPickTester()
Returns:
the GeometryPickTester to use for Geometry-Ray intersection tests.

setGeometryIgnored

public static void setGeometryIgnored(boolean geomIgnored)
Sets whether bounds-wise detected pick-result-candidates are checked more prcisely for geometry-ray intersection.

Parameters:
geomIgnored -

isGeometryIgnored

public static boolean isGeometryIgnored()
Returns:
whether bounds-wise detected pick-result-candidates are checked more prcisely for geometry-ray intersection.

pickAll

public static void pickAll(java.util.List<? extends GroupNode> groups,
                           org.openmali.vecmath2.Ray3f pickRay,
                           org.jagatoo.input.devices.components.MouseButton button,
                           AllPickListener l,
                           java.lang.Object userObject)
Finds all intersections of a given List of GroupNodes with a given ray. The PickResults will be in ascending order so that the nearest one will be at index 0. Don't forget to set the static property Node.setDefaultPickable() to true. If you are using Xith3DEnvironment, it is already done.

Parameters:
groups - the groups that should be tested
pickRay - the pick ray
button - the mouse button, that was clicked
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickAll

public static void pickAll(java.util.List<? extends GroupNode> groups,
                           org.openmali.vecmath2.Ray3f pickRay,
                           org.jagatoo.input.devices.components.MouseButton button,
                           AllPickListener l)
Finds the closest intersection of a given List of NodeGroups with a given ray. You can use it, if you want to know where your mouse is pointing at. Don't forget to set the static property Node.setDefaultPickable() to true. If you are using (Ext)Xith3DEnvironment, it is already done.

Parameters:
groups - the groups that should be tested
pickRay - the pick ray
button - the mouse button, that was clicked
l - the listener to be notified of the PickResult

pickAll

public static void pickAll(RenderPassConfig rpConfig,
                           java.util.List<? extends GroupNode> groups,
                           Canvas3D canvas,
                           org.jagatoo.input.devices.components.MouseButton button,
                           int x,
                           int y,
                           AllPickListener l,
                           java.lang.Object userObject)
Finds the closest intersection of a given List of NodeGroups with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
rpConfig - the RenderPassConfig to use
groups - the groups that should be tested
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickAll

public static void pickAll(java.util.List<? extends GroupNode> groups,
                           Canvas3D canvas,
                           org.jagatoo.input.devices.components.MouseButton button,
                           int x,
                           int y,
                           AllPickListener l,
                           java.lang.Object userObject)
Finds the closest intersection of a given List of NodeGroups with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
groups - the groups that should be tested
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickAll

public static void pickAll(java.util.List<? extends GroupNode> groups,
                           Canvas3D canvas,
                           org.jagatoo.input.devices.components.MouseButton button,
                           int x,
                           int y,
                           AllPickListener l)
Finds the closest intersection of a given List of NodeGroups with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
groups - the groups that should be tested
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult

pickAll

public static void pickAll(GroupNode group,
                           Canvas3D canvas,
                           org.jagatoo.input.devices.components.MouseButton button,
                           int x,
                           int y,
                           AllPickListener l,
                           java.lang.Object userObject)
Finds the closest intersection of a ray and a the nodes in a Group. The ray is specified by screen coordinates. You can use it, if you want to know where your mouse is pointing at.

Parameters:
group - the Branchgroup to intersect with the ray
canvas - the canvas in which the pick is performed
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickAll

public static void pickAll(GroupNode group,
                           Canvas3D canvas,
                           org.jagatoo.input.devices.components.MouseButton button,
                           int x,
                           int y,
                           AllPickListener l)
Finds the closest intersection of a ray and a the nodes in a Group. The ray is specified by screen coordinates. You can use it, if you want to know where your mouse is pointing at.

Parameters:
group - the Branchgroup to intersect with the ray
canvas - the canvas in which the pick is performed
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult

pickNearest

public static void pickNearest(java.util.List<? extends GroupNode> groups,
                               org.openmali.vecmath2.Ray3f pickRay,
                               org.jagatoo.input.devices.components.MouseButton button,
                               NearestPickListener l,
                               java.lang.Object userObject)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at. Don't forget to set the static property Node.setDefaultPickable() to true. If you are using Xith3DEnvironment, it is already done.

Parameters:
groups - the groups that should be tested
pickRay - the pick ray
button - the mouse button, that was clicked
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickNearest

public static void pickNearest(java.util.List<? extends GroupNode> groups,
                               org.openmali.vecmath2.Ray3f pickRay,
                               org.jagatoo.input.devices.components.MouseButton button,
                               NearestPickListener l)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at. Don't forget to set the static property Node.setDefaultPickable() to true. If you are using (Ext)Xith3DEnvironment, it is already done.

Parameters:
groups - the groups that should be tested
pickRay - the pick ray
button - the mouse button, that was clicked
l - the listener to be notified of the PickResult

pickNearest

public static void pickNearest(RenderPassConfig rpConfig,
                               java.util.List<? extends GroupNode> groups,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l,
                               java.lang.Object userObject)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
rpConfig - the RenderPassConfig to use
groups - the groups that should be tested
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickNearest

public static void pickNearest(RenderPassConfig rpConfig,
                               GroupNode group,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l,
                               java.lang.Object userObject)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
rpConfig - the RenderPassConfig to use
group - the Branchgroup to intersect with the ray
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickNearest

public static void pickNearest(RenderPassConfig rpConfig,
                               GroupNode group,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
rpConfig - the RenderPassConfig to use
group - the Branchgroup to intersect with the ray
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult

pickNearest

public static void pickNearest(java.util.List<? extends GroupNode> groups,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l,
                               java.lang.Object userObject)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
groups - the groups that should be tested
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickNearest

public static void pickNearest(java.util.List<? extends GroupNode> groups,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l)
Finds the closest intersection of a given List of GroupNodes with a given ray. You can use it, if you want to know where your mouse is pointing at.

Parameters:
groups - the groups that should be tested
canvas - the canvas to which the coordinates refer
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult

pickNearest

public static void pickNearest(GroupNode group,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l,
                               java.lang.Object userObject)
Finds the closest intersection of a ray and a the nodes in a Group. The ray is specified by screen coordinates. You can use it, if you want to know where your mouse is pointing at.

Parameters:
group - the Branchgroup to intersect with the ray
canvas - the canvas in which the pick is performed
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult
userObject - the userObject to pass to the listener

pickNearest

public static void pickNearest(GroupNode group,
                               Canvas3D canvas,
                               org.jagatoo.input.devices.components.MouseButton button,
                               int x,
                               int y,
                               NearestPickListener l)
Finds the closest intersection of a ray and a the nodes in a Group. The ray is specified by screen coordinates. You can use it, if you want to know where your mouse is pointing at.

Parameters:
group - the Branchgroup to intersect with the ray
canvas - the canvas in which the pick is performed
button - the mouse button, that was clicked
x - the x-(mouse)coordinate (in pixels)
y - the y-(mouse)coordinate (in pixels)
l - the listener to be notified of the PickResult