java.lang.Object
com.marginallyclever.convenience.Ray
Ray
is a starting point and a direction.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.vecmath.Vector3d
double
javax.vecmath.Point3d
javax.vecmath.Vector3d
getPoint
(double t) void
setDirection
(javax.vecmath.Vector3d direction) void
setMaxDistance
(double maxDistance) void
setOrigin
(javax.vecmath.Point3d origin) void
Set this ray to be a copy of another ray.
-
Constructor Details
-
Ray
public Ray() -
Ray
public Ray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction) -
Ray
public Ray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, double maxDistance) -
Ray
-
-
Method Details
-
setDirection
- Parameters:
direction
- the direction of this ray. cannot be a zero vector.- Throws:
IllegalArgumentException
- if direction is too small
-
getDirection
public javax.vecmath.Vector3d getDirection() -
setOrigin
public void setOrigin(javax.vecmath.Point3d origin) -
getOrigin
public javax.vecmath.Point3d getOrigin() -
setMaxDistance
public void setMaxDistance(double maxDistance) -
getMaxDistance
public double getMaxDistance() -
getPoint
public javax.vecmath.Vector3d getPoint(double t) - Returns:
- start + direction * t
-
transform
Set this ray to be a copy of another ray. this = matrix.transform(from)- Parameters:
matrix
- the local transformfrom
- the ray to copy
-