APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.geom

public Class PickRay

extends Object
Class Inheritance
Imports
com.sun.javafx.geom.transform.Affine3D, .BaseTransform, .NoninvertibleTransformException

A ray used for picking.

Field Summary

Modifier and TypeField and Description
private Vec3d
pack-priv static final double
private static final double
private double
private double
private Vec3d

Constructor Summary

AccessConstructor and Description
public
public
PickRay(Vec3d origin, Vec3d direction, double nearClip, double farClip)

public
PickRay(double x, double y, double z, double nearClip, double farClip)

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean
almostZero(double a)

public static PickRay
computeParallelPickRay(double x, double y, double viewHeight, Affine3D cameraTransform, double nearClip, double farClip, PickRay pickRay)

public static PickRay
computePerspectivePickRay(double x, double y, boolean fixedEye, double viewWidth, double viewHeight, double fieldOfViewRadians, boolean verticalFieldOfView, Affine3D cameraTransform, double nearClip, double farClip, PickRay pickRay)

public PickRay
copy()

public double
public Vec3d
public Vec3d
public double
public double
public Vec3d
public Vec3d
public void
private static boolean
isNonZero(double v)

public PickRay
project(BaseTransform inversetx, boolean perspective, Vec3d tmpvec, Point2D ret)

public Point2D
projectToZeroPlane(BaseTransform
the inverse of the model transform into which the ray is to be projected
inversetx
,
boolean
true if the projection is happening in perspective
perspective
,
Vec3d
a temporary Vec3d object for internal use (may be null)
tmpvec
,
Point2D
a Point2D object for storing the return value, or null if a new object should be returned.
ret
)

Project the ray through the specified (inverted) transform and onto the Z=0 plane of the resulting coordinate system.

public final void
set(Vec3d origin, Vec3d direction, double nearClip, double farClip)

public final void
set(double x, double y, double z, double nearClip, double farClip)

public void
setDirection(Vec3d
the direction vector
direction
)

Sets the direction vector of the pick ray.

public void
setDirection(double
the direction X magnitude
x
,
double
the direction Y magnitude
y
,
double
the direction Z magnitude
z
)

Sets the direction of the pick ray.

public void
setOrigin(Vec3d
the origin (in world coordinates).
origin
)

Sets the origin of the pick ray in world coordinates.

public void
setOrigin(double
the origin X coordinate
x
,
double
the origin Y coordinate
y
,
double
the origin Z coordinate
z
)

Sets the origin of the pick ray in world coordinates.

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

directionback to summary
private Vec3d direction
EPSback to summary
pack-priv static final double EPS
EPSILON_ABSOLUTEback to summary
private static final double EPSILON_ABSOLUTE
farClipback to summary
private double farClip
nearClipback to summary
private double nearClip
originback to summary
private Vec3d origin

Constructor Detail

PickRayback to summary
public PickRay()
PickRayback to summary
public PickRay(Vec3d origin, Vec3d direction, double nearClip, double farClip)
PickRayback to summary
public PickRay(double x, double y, double z, double nearClip, double farClip)

Method Detail

almostZeroback to summary
pack-priv static boolean almostZero(double a)
computeParallelPickRayback to summary
public static PickRay computeParallelPickRay(double x, double y, double viewHeight, Affine3D cameraTransform, double nearClip, double farClip, PickRay pickRay)
computePerspectivePickRayback to summary
public static PickRay computePerspectivePickRay(double x, double y, boolean fixedEye, double viewWidth, double viewHeight, double fieldOfViewRadians, boolean verticalFieldOfView, Affine3D cameraTransform, double nearClip, double farClip, PickRay pickRay)
copyback to summary
public PickRay copy()
distanceback to summary
public double distance(Vec3d iPnt)
getDirectionback to summary
public Vec3d getDirection(Vec3d rv)
getDirectionNoCloneback to summary
public Vec3d getDirectionNoClone()
getFarClipback to summary
public double getFarClip()
getNearClipback to summary
public double getNearClip()
getOriginback to summary
public Vec3d getOrigin(Vec3d rv)
getOriginNoCloneback to summary
public Vec3d getOriginNoClone()
inverseTransformback to summary
public void inverseTransform(BaseTransform t) throws NoninvertibleTransformException
isNonZeroback to summary
private static boolean isNonZero(double v)
projectback to summary
public PickRay project(BaseTransform inversetx, boolean perspective, Vec3d tmpvec, Point2D ret)
projectToZeroPlaneback to summary
public Point2D projectToZeroPlane(BaseTransform inversetx, boolean perspective, Vec3d tmpvec, Point2D ret)

Project the ray through the specified (inverted) transform and onto the Z=0 plane of the resulting coordinate system. If a perspective projection is being used then only a point that projects forward from the eye to the plane will be returned, otherwise a null will be returned to indicate that the projection is behind the eye.

Parameters
inversetx:BaseTransform

the inverse of the model transform into which the ray is to be projected

perspective:boolean

true if the projection is happening in perspective

tmpvec:Vec3d

a temporary Vec3d object for internal use (may be null)

ret:Point2D

a Point2D object for storing the return value, or null if a new object should be returned.

setback to summary
public final void set(Vec3d origin, Vec3d direction, double nearClip, double farClip)
setback to summary
public final void set(double x, double y, double z, double nearClip, double farClip)
setDirectionback to summary
public void setDirection(Vec3d direction)

Sets the direction vector of the pick ray. This vector need not be normalized.

Parameters
direction:Vec3d

the direction vector

setDirectionback to summary
public void setDirection(double x, double y, double z)

Sets the direction of the pick ray. The vector need not be normalized.

Parameters
x:double

the direction X magnitude

y:double

the direction Y magnitude

z:double

the direction Z magnitude

setOriginback to summary
public void setOrigin(Vec3d origin)

Sets the origin of the pick ray in world coordinates.

Parameters
origin:Vec3d

the origin (in world coordinates).

setOriginback to summary
public void setOrigin(double x, double y, double z)

Sets the origin of the pick ray in world coordinates.

Parameters
x:double

the origin X coordinate

y:double

the origin Y coordinate

z:double

the origin Z coordinate

setPickRayback to summary
public void setPickRay(PickRay other)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
transformback to summary
public void transform(BaseTransform t)