Modifier and Type | Field and Description |
---|---|
Vector |
direction
The ray's unit direction vector.
|
Vector |
origin
The ray's point of origin.
|
Constructor and Description |
---|
Ray2()
Creates an empty (invalid) ray.
|
Ray2(Ray2 other)
Copy constructor.
|
Ray2(Vector origin,
Vector direction)
Creates a ray with the values contained in the supplied origin point and unit direction
vector.
|
Modifier and Type | Method and Description |
---|---|
IVector |
direction()
Returns a reference to the ray's unit direction vector.
|
boolean |
getIntersection(IVector center,
double radius,
Vector result)
Finds the intersection between the ray and a circle with the given center and radius.
|
boolean |
getIntersection(IVector start,
IVector end,
double radius,
Vector result)
Finds the intersection between the ray and a capsule with the given start point, end point,
and radius.
|
boolean |
getIntersection(IVector start,
IVector end,
Vector result)
Finds the intersection between the ray and a line segment with the given start and end
points.
|
Vector |
getNearestPoint(IVector point,
Vector result)
Computes the nearest point on the Ray to the supplied point.
|
boolean |
intersects(IVector pt)
Determines whether the ray intersects the specified point.
|
IVector |
origin()
Returns a reference to the ray's point of origin.
|
Ray2 |
set(IRay2 other)
Copies the parameters of another ray.
|
Ray2 |
set(IVector origin,
IVector direction)
Sets the ray parameters to the values contained in the supplied vectors.
|
String |
toString() |
Ray2 |
transform(Transform transform)
Transforms this ray.
|
Ray2 |
transform(Transform transform,
Ray2 result)
Transforms this ray, placing the result in the object provided.
|
Ray2 |
transformLocal(Transform transform)
Transforms this ray in-place.
|
public final Vector origin
public final Vector direction
public Ray2(Vector origin, Vector direction)
public Ray2(Ray2 other)
public Ray2()
public Ray2 set(IRay2 other)
public Ray2 set(IVector origin, IVector direction)
public Ray2 transformLocal(Transform transform)
public IVector origin()
IRay2
public IVector direction()
IRay2
public Ray2 transform(Transform transform)
IRay2
public Ray2 transform(Transform transform, Ray2 result)
IRay2
public boolean intersects(IVector pt)
IRay2
intersects
in interface IRay2
public boolean getIntersection(IVector start, IVector end, Vector result)
IRay2
getIntersection
in interface IRay2
public boolean getIntersection(IVector start, IVector end, double radius, Vector result)
IRay2
getIntersection
in interface IRay2
public boolean getIntersection(IVector center, double radius, Vector result)
IRay2
getIntersection
in interface IRay2
public Vector getNearestPoint(IVector point, Vector result)
IRay2
getNearestPoint
in interface IRay2
result
for chaining.Copyright © 2017. All rights reserved.