|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.sgl.TraversalContext
edu.mines.jtk.sgl.TransformContext
edu.mines.jtk.sgl.PickContext
public class PickContext
A transform context for picking.
A pick context has a pick segment, which is a line segment in a local coordinate system. During a pick traversal of the scene graph, nodes compute points of intersection, if any, between their geometry and the pick segment. For efficiency, only nodes with bounding spheres that intersect the pick segment will perform intersection computations.
The pick segment in a pick context has two endpoints. One endpoint lies on the near clipping plane, with specified pixel (x,y) coordinates and pixel z coordinate 0.0. This endpoint is called the near endpoint of the pick segment. The far endpoint lies on the far clipping plane. It has the same specified pixel (x,y) coordinates as the near endpoint, but has pixel z coordinate 1.0. With these pick segment endpoints, only geometry between the near and far clipping planes can be picked.
| Constructor Summary | |
|---|---|
PickContext(java.awt.event.MouseEvent event)
Constructs a pick context for the specified mouse event. |
|
| Method Summary | |
|---|---|
void |
addResult(Point3 point)
Adds a pick result with specified pick point to this context. |
PickResult |
getClosest()
Gets the pick result closest to the origin of the pick segment. |
java.awt.event.MouseEvent |
getMouseEvent()
Gets the mouse event for which this context was constructed. |
Segment |
getPickSegment()
Gets the pick segment for this context. |
void |
popLocalToWorld()
Restores the most recently saved (pushed) local-to-world transform. |
void |
pushLocalToWorld(Matrix44 transform)
Saves the local-to-world transform before appending a transform. |
boolean |
segmentIntersectsSphereOf(Node node)
Determines whether the pick segment intersects the bounding sphere of the specified node. |
| Methods inherited from class edu.mines.jtk.sgl.TransformContext |
|---|
getCubeToLocal, getCubeToPixel, getCubeToView, getCubeToWorld, getLocalToCube, getLocalToPixel, getLocalToView, getLocalToWorld, getPixelToCube, getPixelToLocal, getPixelToView, getPixelToWorld, getView, getViewCanvas, getViewToCube, getViewToLocal, getViewToPixel, getViewToWorld, getWorld, getWorldToCube, getWorldToLocal, getWorldToPixel, getWorldToView |
| Methods inherited from class edu.mines.jtk.sgl.TraversalContext |
|---|
countNodes, getNode, getNode, getNodes, popNode, pushNode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PickContext(java.awt.event.MouseEvent event)
event - the mouse event.| Method Detail |
|---|
public java.awt.event.MouseEvent getMouseEvent()
public Segment getPickSegment()
public boolean segmentIntersectsSphereOf(Node node)
node - the node with a bounding sphere.
public void addResult(Point3 point)
point - the pick point, in local coordinates.public PickResult getClosest()
public void pushLocalToWorld(Matrix44 transform)
pushLocalToWorld in class TransformContexttransform - the transform to append.public void popLocalToWorld()
popLocalToWorld in class TransformContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||