Package gaiasky.util.math
Class Rayd
java.lang.Object
gaiasky.util.math.Rayd
- All Implemented Interfaces:
Serializable
Encapsulates a Rayd having a starting position and a unit length direction.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncpy()
boolean
getEndPoint
(float distance) Deprecated.getEndPoint
(Vector3d out, float distance) Returns the endpoint given the distance.int
hashCode()
Multiplies the Rayd by the given matrix.set
(float x, float y, float z, float dx, float dy, float dz) Sets this Rayd from the given starting position and direction.Sets the starting position and direction from the given RaydSets the starting position and the direction of this Rayd.toString()
-
Field Details
-
origin
-
direction
-
-
Constructor Details
-
Rayd
Constructor, sets the starting position of the Rayd and the direction.- Parameters:
origin
- The starting positiondirection
- The direction
-
-
Method Details
-
cpy
- Returns:
- a copy of this Rayd.
-
getEndPoint
Deprecated.UsegetEndPoint(Vector3d, float)
instead. Returns the endpoint given the distance. This is calculated as startpoint + distance * direction.- Parameters:
distance
- The distance from the end point to the start point.- Returns:
- The end point
-
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
-
mul
Multiplies the Rayd by the given matrix. Use this to transform a Rayd into another coordinate system.- Parameters:
matrix
- The matrix- Returns:
- This Rayd for chaining.
-
toString
-
set
Sets the starting position and the direction of this Rayd.- Parameters:
origin
- The starting positiondirection
- The direction- Returns:
- this Rayd for chaining
-
set
Sets this Rayd 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 Rayd for chaining
-
set
Sets the starting position and direction from the given Rayd- Parameters:
Rayd
- The Rayd- Returns:
- This Rayd for chaining
-
equals
-
hashCode
public int hashCode()
-
getEndPoint(Vector3d, float)
instead.