|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface which represents a Picker and provides required methods.
Field Summary | |
static int |
MATRIX
|
static int |
NORMAL
|
static int |
POINT
|
static int |
POLYGON_INDEX
|
Method Summary | |
float[] |
getFromPoint()
Returns a reference to the world-space "from" point used in the last pick. |
Node[] |
getPath()
Returns the last path given to this Picker using setPath(). |
float[] |
getPickInfo(int which)
Gets any info that was requested (prior to performing the pick) by setting flags in setPickInfo . |
Node[] |
getPickPath()
Returns path to the last picked node. |
int |
getPixelX()
Returns x location of last pixel used to pick. |
int |
getPixelY()
Returns y location of last pixel used to pick. |
boolean |
getProjectedBounds(Node[] pathToNode,
boolean fineGrain,
float[] bounds)
Projects the bounding box of the node at the end of pathToNode to screen space. |
boolean |
getProjectedBoundsByNode(Node node,
boolean fineGrain,
float[] bounds)
Just like getProjectedBounds(), except that only a single node is provided as argument instead of a path. |
boolean |
getProjectedPixel(Node[] pathToNode,
float[] localSpaceCoord,
float[] pixel)
Projects a point in the scene back out onto the picture plane and returns the corresponding pixel value. |
boolean |
getProjectedPixelByNode(Node node,
float[] localSpaceCoord,
float[] pixel)
Just like getProjectedPixel(), except that only a single node is provided as argument instead of a path. |
Node |
getScene()
Returns the root of the scene being used for picks. |
float[] |
getToPoint()
Returns a reference the "to" point used in the last pick. |
void |
getWorldRay(int x,
int y,
float[] from,
float[] to)
Calculates the worldspace ray from the currently bound viewpoint through the given pixel. |
boolean |
isPickPixelBased()
Returns whether the last pick was done based on a pixel location or a pair of 3D from/to coordinates. |
boolean |
pickAny(int x,
int y)
Given a pixel coordinate assumed to be in the viewer's window, returns a boolean stating whether any geometry in the scene was intersected by the ray from the eyepoint through the pixel. |
boolean |
pickAnyFromTo(float[] from,
float[] to)
Given a ray described as going from the 'from' point and towards the 'to' point, returns a boolean stating whether any geometry in the scene was intersected by the ray. |
Node[] |
pickClosest(int x,
int y)
Given a pixel coordinate assumed to be in the viewer's window, constructs a ray from the location of the viewer's currently bound Viewpoint, then intersects. |
Node[] |
pickClosestFromTo(float[] from,
float[] to)
Given a ray described as going from the 'from' point and towards the 'to' point, intersects that ray. |
void |
setPath(Node[] path)
Establishes a new path for the picker to usre for ray intersection. |
void |
setPickInfo(int which,
boolean doCalculation)
Tells the Picker which information it needs to collect as it traverses the scene graph in order to Pick. |
void |
setScene(Node root)
Establishes a new scene graph for the picker to use for ray intersection. |
boolean |
wasPicked(Node node)
After performing a pick, this returns true if the given node was on the path to the pick. |
Field Detail |
public static final int POINT
public static final int NORMAL
public static final int MATRIX
public static final int POLYGON_INDEX
Method Detail |
public void setPickInfo(int which, boolean doCalculation)
which
- the flag indicating which info the user is specifying (POINT, NORMAL, or MATRIX)doCalculation
- whether this Picker should collect which
's infopublic void setScene(Node root)
root
- the root of the scene to pickpublic Node getScene()
public void setPath(Node[] path)
path
- the path to the subgraph to pickpublic Node[] getPath()
public boolean pickAny(int x, int y)
x
- the pixel's x coordinatey
- the pixel's y coordinatepublic boolean pickAnyFromTo(float[] from, float[] to)
from
- the from point of the given rayto
- the to point of the given raypublic Node[] pickClosest(int x, int y)
x
- the pixel's x coordinatey
- the pixel's y coordinatepublic Node[] pickClosestFromTo(float[] from, float[] to)
from
- the from point of the given rayto
- the to point of the given raypublic boolean wasPicked(Node node)
node
- the node to look for on the pick pathpublic float[] getPickInfo(int which) throws Shout3DException
setPickInfo
. Must be called after the
pick has been performed.
Note: Normal is undefined for lines and points.which
- the info to receivepublic Node[] getPickPath()
public boolean isPickPixelBased()
public int getPixelX()
public int getPixelY()
public float[] getFromPoint()
public float[] getToPoint()
public void getWorldRay(int x, int y, float[] from, float[] to)
x
- the x pixel locationy
- the y pixel locationfrom
- the from point of the calculated rayto
- the to point of the calculated raypublic boolean getProjectedPixel(Node[] pathToNode, float[] localSpaceCoord, float[] pixel)
pathToNode
- the path to the node in whose space the localSpaceCoord is expressed.localSpaceCoord
- the coordinate to be projectedpixel
- the projected 2D screenspace pointpublic boolean getProjectedPixelByNode(Node node, float[] localSpaceCoord, float[] pixel)
node
- the node in whose space the localSpaceCoord is expressed.localSpaceCoord
- the coordinate to be projectedpixel
- the projected 2D screenspace pointpublic boolean getProjectedBounds(Node[] pathToNode, boolean fineGrain, float[] bounds)
pathToNode
- the path to the node whose bounds are sought.fineGrain
- whether the bounds should be based on finegrain calculations.bounds
- the calculated bounds of the node.public boolean getProjectedBoundsByNode(Node node, boolean fineGrain, float[] bounds)
node
- the node whose bounds are sought.fineGrain
- whether the bounds should be based on finegrain calculations.bounds
- the calculated bounds of the node.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |