Spec-Zone.ru › OpenJavaFX 8
javafx.scene.input

Class PickResult

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 Summary

    Fields
    Modifier and Type Field and Description
    static int FACE_UNDEFINED
    An undefined face.
  • Constructor Summary

    Constructors
    Constructor and 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 Summary

    All MethodsInstance MethodsConcrete Methods
    Modifier and Type Method and Description
    double getIntersectedDistance()
    Returns the intersected distance between camera position and the intersected point.
    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.
    Node getIntersectedNode()
    Returns the intersected node.
    Point3D getIntersectedNormal()
    Return the intersected normal of the picked 3d shape.
    Point3D getIntersectedPoint()
    Returns the intersected point in local coordinate of the picked Node.
    Point2D getIntersectedTexCoord()
    Return the intersected texture coordinates of the picked 3d shape.
    String toString()
    • Methods inherited from class java.lang.Object

      clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Detail

    • FACE_UNDEFINED

      public static final int FACE_UNDEFINED
      An 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 Detail

    • PickResult

      public PickResult(Node node,
                        Point3D point,
                        double distance,
                        int face,
                        Point2D texCoord)
      Creates a new instance of PickResult.

      Parameters:

      node - The intersected node

    • PickResult

      public PickResult(Node node,
                        Point3D point,
                        double distance,
                        int face,
                        Point3D normal,
                        Point2D texCoord)
      Creates a new instance of PickResult.

      Parameters:

      node - The intersected node

      Since:

      JavaFX 8u40

    • PickResult

      public PickResult(Node node,
                        Point3D point,
                        double distance)
      Creates 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

    • PickResult

      public PickResult(EventTarget target,
                        double sceneX,
                        double sceneY)
      Creates 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)

  • Method Detail

    • getIntersectedNode

      public final Node getIntersectedNode()
      Returns 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

    • getIntersectedPoint

      public final Point3D getIntersectedPoint()
      Returns 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

    • getIntersectedDistance

      public final double getIntersectedDistance()
      Returns the intersected distance between camera position and the intersected point.

      Returns:

      the distance from camera to the intersection

    • getIntersectedFace

      public 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

    • getIntersectedNormal

      public final Point3D getIntersectedNormal()
      Return 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

    • getIntersectedTexCoord

      public final Point2D getIntersectedTexCoord()
      Return 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

    • toString

      public String toString()

      Overrides:

      toString in class Object

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API