Package arc.math.geom
Class Ray
java.lang.Object
arc.math.geom.Ray
Encapsulates a ray having a starting position and a unit length direction.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncpy()
boolean
getEndPoint
(Vec3 out, float distance) Returns the endpoint given the distance.int
hashCode()
set
(float x, float y, float z, float dx, float dy, float dz) Sets this ray from the given starting position and direction.Sets the starting position and direction from the given raySets the starting position and the direction of this ray.toString()
-
Field Details
-
origin
-
direction
-
-
Constructor Details
-
Ray
public Ray() -
Ray
Constructor, sets the starting position of the ray and the direction.- Parameters:
origin
- The starting positiondirection
- The direction
-
-
Method Details
-
cpy
- Returns:
- a copy of this ray.
-
getEndPoint
Returns the endpoint given the distance. This is calculated as startpoint + distance * direction.- Parameters:
out
- The vector to set to the resultdistance
- The distance from the end point to the start point.- Returns:
- The out param
-
set
Sets the starting position and the direction of this ray.- Parameters:
origin
- The starting positiondirection
- The direction- Returns:
- this ray for chaining
-
set
Sets this ray from the given starting position and direction.- Parameters:
x
- The x-component of the starting positiony
- The y-component of the starting positionz
- The z-component of the starting positiondx
- The x-component of the directiondy
- The y-component of the directiondz
- The z-component of the direction- Returns:
- this ray for chaining
-
set
Sets the starting position and direction from the given ray- Parameters:
ray
- The ray- Returns:
- This ray for chaining
-
toString
-
equals
-
hashCode
public int hashCode()
-