public final class Ray extends ValueType implements IEquatable<Ray>
Modifier and Type | Field and Description |
---|---|
Vector3 |
Direction
Unit vector specifying the direction the Ray is pointing.
|
Vector3 |
Position
Specifies the starting point of the Ray.
|
Constructor and Description |
---|
Ray()
Creates a new instance of Ray.
|
Ray(Vector3 position,
Vector3 direction)
Creates a new instance of Ray.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Determines whether two instances of Ray are equal.
|
boolean |
Equals(Ray other)
Determines whether the specified Ray is equal to the current Ray.
|
int |
hashCode()
Gets the hash code for this instance.
|
java.lang.Float |
Intersects(BoundingBox box)
Checks whether the Ray intersects a specified BoundingBox.
|
void |
Intersects(BoundingBox box,
java.lang.Float result)
Checks whether the current Ray intersects a BoundingBox.
|
java.lang.Float |
Intersects(BoundingSphere sphere)
Checks whether the Ray intersects a specified BoundingSphere.
|
void |
Intersects(BoundingSphere sphere,
java.lang.Float result)
Checks whether the current Ray intersects a BoundingSphere.
|
java.lang.Float |
Intersects(Plane plane)
Determines whether this Ray intersects a specified Plane.
|
void |
Intersects(Plane plane,
java.lang.Float result)
Determines whether this Ray intersects a specified Plane.
|
java.lang.String |
toString()
Returns a String that represents the current Ray.
|
public Vector3 Position
public Vector3 Direction
public Ray(Vector3 position, Vector3 direction)
position
- The starting point of the Ray.direction
- Unit vector describing the direction of the Ray.public Ray()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The Object to compare with the current Ray.public boolean Equals(Ray other)
Equals
in interface IEquatable<Ray>
other
- The Ray to compare with the current Ray.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Float Intersects(BoundingBox box)
box
- The BoundingBox to check for intersection with the Ray.public java.lang.Float Intersects(BoundingSphere sphere)
sphere
- The BoundingSphere to check for intersection with the Ray.public java.lang.Float Intersects(Plane plane)
plane
- The Plane with which to calculate this Ray's intersection.public void Intersects(BoundingBox box, java.lang.Float result)
box
- The BoundingBox to check for intersection with.result
- [OutAttribute] Distance at which the ray intersects the BoundingBox or null if there is no intersection.public void Intersects(BoundingSphere sphere, java.lang.Float result)
sphere
- The BoundingSphere to check for intersection with.result
- [OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.public void Intersects(Plane plane, java.lang.Float result)
plane
- The Plane with which to calculate this Ray's intersection.result
- [OutAttribute] The distance at which this Ray intersects the specified Plane, or null if there is no intersection.public java.lang.String toString()
toString
in class java.lang.Object