public class PickResultChooser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
closed |
private double |
distance |
private boolean |
empty |
private int |
face |
private Node |
node |
private Point3D |
normal |
private Point3D |
point |
private Point2D |
texCoord |
Constructor and Description |
---|
PickResultChooser() |
Modifier and Type | Method and Description |
---|---|
static Point3D |
computePoint(PickRay ray,
double distance)
Helper method for computing intersected point.
|
double |
getIntersectedDistance()
Returns the intersected distance between camera position and the picked Node
|
int |
getIntersectedFace()
Returns the intersected face of the picked Node
|
Node |
getIntersectedNode()
Returns the intersected Node
|
Point3D |
getIntersectedNormal()
Return the intersected normal in local coordinate of the picked Node
|
Point3D |
getIntersectedPoint()
Return the intersected point in local coordinate of the picked Node
|
Point2D |
getIntersectedTexCoord()
Return the intersected texture coordinates of the picked Node
return new Point2D presenting the intersected TexCoord
|
boolean |
isClosed()
Returns true if this chooser has been closed.
|
boolean |
isCloser(double distance)
Returns true if the given distance is smaller than the distance stored
in this instance.
|
boolean |
isEmpty()
Returns true if there is no intersection stored in this instance.
|
boolean |
offer(Node node,
double distance,
int face,
Point3D point,
Point2D texCoord)
Offers an intersection.
|
boolean |
offer(Node node,
double distance,
Point3D point)
Offers an intersection with a non-Shape3D object.
|
boolean |
offerSubScenePickResult(SubScene subScene,
PickResult pickResult,
double distance)
Offers an intersection found inside a SubScene.
|
private boolean |
processOffer(Node node,
Node depthTestNode,
double distance,
Point3D point,
int face,
Point3D normal,
Point2D texCoord)
Process an offered intersection.
|
PickResult |
toPickResult()
Converts the current content of this instance to the unmodifiable
PickResult.
|
private double distance
private Node node
private int face
private Point3D point
private Point3D normal
private Point2D texCoord
private boolean empty
private boolean closed
public static Point3D computePoint(PickRay ray, double distance)
ray
- Pick ray used for pickingdistance
- Distance measured in ray direction magnitudespublic PickResult toPickResult()
public boolean isCloser(double distance)
distance
- The distance to comparepublic boolean isEmpty()
public boolean isClosed()
close()
public boolean offer(Node node, double distance, int face, Point3D point, Point2D texCoord)
node
- The intersected nodedistance
- The intersected distance measured in pickRay direction magnitudesface
- The intersected facepoint
- The intersection pointtexCoord
- The intersected texture coordinatespublic boolean offer(Node node, double distance, Point3D point)
node
- The intersected nodedistance
- The intersected distance measured in pickRay direction magnitudespoint
- The intersection pointpublic boolean offerSubScenePickResult(SubScene subScene, PickResult pickResult, double distance)
subScene
- SubScene where the result was pickedpickResult
- Picking result from the subScenedistance
- distance from the camera to the intersection point
with the subScene planeprivate boolean processOffer(Node node, Node depthTestNode, double distance, Point3D point, int face, Point3D normal, Point2D texCoord)
node
- The intersected nodedepthTestNode
- The node whose depthTest is considered. When
processing subScene pick result we need to consider the inner
picked node but subScene's depth testdistance
- The intersected distance measured in pickRay direction magnitudespoint
- The intersection pointface
- The intersected facenormal
- The intersected normaltexCoord
- The intersected texture coordinatesoffer(javafx.scene.Node, double, int, javafx.geometry.Point3D, javafx.geometry.Point2D)
,
offer(javafx.scene.Node, double, javafx.geometry.Point3D)
public final Node getIntersectedNode()
public final double getIntersectedDistance()
public final int getIntersectedFace()
public final Point3D getIntersectedPoint()
public final Point3D getIntersectedNormal()
public final Point2D getIntersectedTexCoord()