Aviatrix3D
2.1.0

org.j3d.aviatrix3d.picking
Class PickRequest

java.lang.Object
  extended by org.j3d.aviatrix3d.picking.PickRequest

public class PickRequest
extends java.lang.Object

Used to represent a picking request to the system.

To pick within the scene graph, the user fills out the fields of this class and then calls the appropriate pick method on the node or group that is the picking root. A pick consists of the geometry type, information about that geometry (origin, extents, radius etc) and then whether to only pick a single object, multiple objects and whether to sort them.

Version:
$Revision: 1.3 $
Author:
Justin Couch

Field Summary
 float additionalData
          When the geometry type is a cone, This is the spread angle in radians.
 float[] destination
          The ending location or the direction vector, depending on the geometry type requested.
static int FIND_ALL
          Find anything that is pickable, regardless of the mask set on the geometry.
static int FIND_COLLIDABLES
          Find anything that is defined as being collidable.
static int FIND_GENERAL
          Find any general pickable node type.
static int FIND_PROXIMITY
          Define the picking as being an object that is near something.
static int FIND_VISIBLES
          Define the picking as being an object that is visible.
 java.lang.Object foundPaths
          The picked data is placed here.
 boolean generateVWorldMatrix
          If this flag is set to true, generate the local to virtual world matrix for the picked result.
 float[] origin
          The starting location of the picking request
static int PICK_BOX
          Pick using a box.
static int PICK_CONE
          Pick using an infinite cone.
static int PICK_CONE_SEGMENT
          Pick using a length of cone.
static int PICK_CYLINDER
          Pick using an infinite cylinder.
static int PICK_CYLINDER_SEGMENT
          Pick using a length of cylinder.
static int PICK_FRUSTUM
          Pick the geometry that is in the given view frustum.
static int PICK_LINE_SEGMENT
          Pick using a segment of a line.
static int PICK_POINT
          Pick using a point location.
static int PICK_RAY
          Pick using a ray location.
static int PICK_SPHERE
          Pick using a sphere.
 int pickCount
          The number of valid picks that were found in this request.
 int pickGeometryType
          What type of geometry intersection testing should be performed?
 int pickSortType
          How the return data be sorted.
 int pickType
          What sort of thing should we be picking for.
static int SORT_ALL
          Pick all objects that intersect, but don't sort them
static int SORT_ANY
          Pick anything that matches - most likely the first one it comes across
static int SORT_CLOSEST
          Pick only the closest object.
static int SORT_ORDERED
          Pick all objects and sort by closest order.
 boolean useGeometry
          When the picking geometry is line or segment based, should the pick action be against the bounds or the actual geometry?
 
Constructor Summary
PickRequest()
          Create a new instance of this class with all values set to their defaults.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIND_ALL

public static final int FIND_ALL
Find anything that is pickable, regardless of the mask set on the geometry. This is set to 0xFFFFFFFF

See Also:
Constant Field Values

FIND_GENERAL

public static final int FIND_GENERAL
Find any general pickable node type. THis is the generic catch-all picking mask that would be used in the majority of scene graphs. This has a value of 0x1.

See Also:
Constant Field Values

FIND_COLLIDABLES

public static final int FIND_COLLIDABLES
Find anything that is defined as being collidable. Collidable is useful for doing stuff like terrain following. This flag has a value of 0x2.

See Also:
Constant Field Values

FIND_VISIBLES

public static final int FIND_VISIBLES
Define the picking as being an object that is visible. Typically this will be combined with the Frustum pick type. This flag has a value of 0x4.

See Also:
Constant Field Values

FIND_PROXIMITY

public static final int FIND_PROXIMITY
Define the picking as being an object that is near something. Typically this will be used for implementing a user-defined proximity sensor for triggering different types of behaviours, LODs etc. This flag has a value of 0x8.

See Also:
Constant Field Values

PICK_POINT

public static final int PICK_POINT
Pick using a point location. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively. Only origin is used as input and it describes the point's location in world space.

See Also:
Constant Field Values

PICK_RAY

public static final int PICK_RAY
Pick using a ray location. All sort types that are valid and are calculated relative to the origin. The ray uses origin as the start point and destination is the direction vector.

See Also:
Constant Field Values

PICK_LINE_SEGMENT

public static final int PICK_LINE_SEGMENT
Pick using a segment of a line. All sort types that are valid and are calculated relative to the origin. The segments uses origin as the start point and destination is the end point.

See Also:
Constant Field Values

PICK_CYLINDER

public static final int PICK_CYLINDER
Pick using an infinite cylinder. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively.

origin and destination represent the centers of the two end points of the cylinder. additionalData represents the radius of the cylinder.

See Also:
Constant Field Values

PICK_CYLINDER_SEGMENT

public static final int PICK_CYLINDER_SEGMENT
Pick using a length of cylinder. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively.

origin and destination represent the centers of the two end points of the cylinder. additionalData represents the radius of the cylinder.

See Also:
Constant Field Values

PICK_CONE

public static final int PICK_CONE
Pick using an infinite cone. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively.

origin represents the location of the point of the cone and destination is the vector representing the axis. The cone is infinite in length, with additionalData representing the spread angle of the cone

See Also:
Constant Field Values

PICK_CONE_SEGMENT

public static final int PICK_CONE_SEGMENT
Pick using a length of cone. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively.

origin represents the location of the point of the cone and destination is the vector representing the axis. The cone is infinite in length, with additionalData representing the spread angle of the cone

See Also:
Constant Field Values

PICK_BOX

public static final int PICK_BOX
Pick using a box. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively.

origin represents the minimum extents of the box while destination represents the maximum extents.

See Also:
Constant Field Values

PICK_SPHERE

public static final int PICK_SPHERE
Pick using a sphere. The only sort types that are valid are ANY or ALL. ORDERED and CLOSEST are treated as ALL and ANY respectively.

origin is used as the center of the sphere and it describes the location world space. additionalData is used to specify the radius of the sphere.

See Also:
Constant Field Values

PICK_FRUSTUM

public static final int PICK_FRUSTUM
Pick the geometry that is in the given view frustum. When using this pick type, the end user should re-allocate the origin variable to be 24 units in length and place the equations for the 6 bounding planes in the array in the order: right, left, bottom, top, near, far.

A positive pick is any bounding volume or geometry that is explicitly not completely out of the frustum. So long as part of the geometry falls within the frustum, it is considered a successful find.

See Also:
Constant Field Values

SORT_ALL

public static final int SORT_ALL
Pick all objects that intersect, but don't sort them

See Also:
Constant Field Values

SORT_ANY

public static final int SORT_ANY
Pick anything that matches - most likely the first one it comes across

See Also:
Constant Field Values

SORT_ORDERED

public static final int SORT_ORDERED
Pick all objects and sort by closest order. See individual pick geometry type for further details as this may not be supported always.

See Also:
Constant Field Values

SORT_CLOSEST

public static final int SORT_CLOSEST
Pick only the closest object. See individual pick geometry type for further details as this may not be supported always.

See Also:
Constant Field Values

pickType

public int pickType
What sort of thing should we be picking for. This should be set to one or more of the mask flags that have been bitwise OR'd together. Leaving this at the default value of 0 means nothing would be picked - not a particularly useful setting my Dear Watson.


pickGeometryType

public int pickGeometryType
What type of geometry intersection testing should be performed?


useGeometry

public boolean useGeometry
When the picking geometry is line or segment based, should the pick action be against the bounds or the actual geometry?


pickSortType

public int pickSortType
How the return data be sorted. Must be one of the SORT_X types.


origin

public float[] origin
The starting location of the picking request


destination

public float[] destination
The ending location or the direction vector, depending on the geometry type requested.


additionalData

public float additionalData
When the geometry type is a cone, This is the spread angle in radians. When the geometry type is a cylinder, this is the radius of the cylinder. For any other pick type, this is ignored.


foundPaths

public java.lang.Object foundPaths
The picked data is placed here. The user may optionally provide the data here and the picking routines will update the values. If no data is provided, then the picking system will create a new instance for the user. For single picks (closest, any) then this object will be an instance of SceneGraphPath. For multiple picks (sorted, all) then this will be an ArrayList instance and will contain all of the scene graph paths that were found.


pickCount

public int pickCount
The number of valid picks that were found in this request.


generateVWorldMatrix

public boolean generateVWorldMatrix
If this flag is set to true, generate the local to virtual world matrix for the picked result. This flag is set to true by default.

Constructor Detail

PickRequest

public PickRequest()
Create a new instance of this class with all values set to their defaults. No pick geometry type or sort type is specified.


Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org