java.lang.Object
com.marginallyclever.convenience.Ray
-
Constructor Details
-
Ray
public Ray() -
Ray
-
Ray
public Ray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction) CallsRay(Point3d, Vector3d, double)
with the maximum ray distance. -
Ray
public Ray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, double maxDistance) - Parameters:
origin
- the camera position.direction
- unit length venctor from camera through viewport and into scene.maxDistance
- the limit to test for ray intersections.
-
-
Method Details
-
getPoint
public javax.vecmath.Vector3d getPoint(double t) - Returns:
- start + direction * t
-
getOrigin
public javax.vecmath.Point3d getOrigin() -
getDirection
public javax.vecmath.Vector3d getDirection() -
getWo
public javax.vecmath.Vector3d getWo()- Returns:
- the negated direction vector (pointing back toward the origin).
-
getMaxDistance
public double getMaxDistance() -
transform
Set this ray to be a copy of another ray. this = matrix.transform(from)- Parameters:
matrix
- the local transformfrom
- the ray to copy
-
getInverseDirection
public javax.vecmath.Vector3d getInverseDirection()
-