java.lang.Object
javafx.scene.input.PickResult
public class PickResult extends Object
A container object that contains the result of a pick event
- Since:
- JavaFX 8.0
- 
Field SummaryFields Modifier and Type Field Description static intFACE_UNDEFINEDAn undefined face.
- 
Constructor SummaryConstructors Constructor Description PickResult(EventTarget target, double sceneX, double sceneY)Creates a pick result for a 2D case where no additional information is needed.PickResult(Node node, Point3D point, double distance)Creates a new instance of PickResult for a non-3d-shape target.PickResult(Node node, Point3D point, double distance, int face, Point2D texCoord)Creates a new instance of PickResult.PickResult(Node node, Point3D point, double distance, int face, Point3D normal, Point2D texCoord)Creates a new instance of PickResult.
- 
Method SummaryModifier and Type Method Description doublegetIntersectedDistance()Returns the intersected distance between camera position and the intersected point.intgetIntersectedFace()Returns the intersected face of the picked Node, FACE_UNDEFINED if the node doesn't have user-specified faces or was picked on bounds.NodegetIntersectedNode()Returns the intersected node.Point3DgetIntersectedNormal()Return the intersected normal of the picked 3d shape.Point3DgetIntersectedPoint()Returns the intersected point in local coordinate of the picked Node.Point2DgetIntersectedTexCoord()Return the intersected texture coordinates of the picked 3d shape.
- 
Field Details- 
FACE_UNDEFINEDpublic static final int FACE_UNDEFINEDAn undefined face. This value is used for the intersected face if the picked node has no user-specified faces.- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
PickResultCreates a new instance of PickResult.- Parameters:
- node- The intersected node
- point- The intersected point in local coordinate of the picked Node
- distance- The intersected distance between camera position and the picked Node
- face- The intersected face of the picked Node
- texCoord- The intersected texture coordinates of the picked Node
 
- 
PickResultpublic PickResult(Node node, Point3D point, double distance, int face, Point3D normal, Point2D texCoord)Creates a new instance of PickResult.- Parameters:
- node- The intersected node
- point- The intersected point in local coordinate of the picked Node
- distance- The intersected distance between camera position and the picked Node
- face- The intersected face of the picked Node
- texCoord- The intersected texture coordinates of the picked Node
- normal- The intersected normal of the picked Node
- Since:
- JavaFX 8u40
 
- 
PickResultCreates a new instance of PickResult for a non-3d-shape target. Sets face to FACE_UNDEFINED and texCoord to null.- Parameters:
- node- The intersected node
- point- The intersected point in local coordinate of the picked Node
- distance- The intersected distance between camera position and the picked Node
 
- 
PickResultCreates a pick result for a 2D case where no additional information is needed. Converts the given scene coordinates to the target's local coordinate space and stores the value as the intersected point. Sets intersected node to the given target, distance to 1.0, face to FACE_UNDEFINED and texCoord to null.- Parameters:
- target- The picked target (null in case of a Scene)
- sceneX- The scene X coordinate
- sceneY- The scene Y coordinate
 
 
- 
- 
Method Details- 
getIntersectedNodeReturns the intersected node. Returns null if there was no intersection with any node and the scene was picked.- Returns:
- the picked node or null if no node was picked
 
- 
getIntersectedPointReturns the intersected point in local coordinate of the picked Node. If no node was picked, it returns the intersected point with the projection plane.- Returns:
- new Point3D presenting the intersected point
 
- 
getIntersectedDistancepublic final double getIntersectedDistance()Returns the intersected distance between camera position and the intersected point.- Returns:
- the distance from camera to the intersection
 
- 
getIntersectedFacepublic final int getIntersectedFace()Returns the intersected face of the picked Node, FACE_UNDEFINED if the node doesn't have user-specified faces or was picked on bounds.- Returns:
- the picked face
 
- 
getIntersectedNormalReturn the intersected normal of the picked 3d shape. If the picked target is not Shape3D or has pickOnBounds==true, it returns null.- Returns:
- a new Point3D presenting the intersected normal
- Since:
- JavaFX 8u40
 
- 
getIntersectedTexCoordReturn the intersected texture coordinates of the picked 3d shape. If the picked target is not Shape3D or has pickOnBounds==true, it returns null.- Returns:
- a new Point2D presenting the intersected TexCoord
 
 
-