Package org.joml
Class Rayd
- java.lang.Object
-
- org.joml.Rayd
-
- All Implemented Interfaces:
Externalizable,Serializable
public class Rayd extends Object implements Externalizable
Represents a ray with a given origin and direction using double-precision floating-point numbers.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description doubledXThe x coordinate of the ray's direction.doubledYThe y coordinate of the ray's direction.doubledZThe z coordinate of the ray's direction.doubleoXThe x coordinate of the ray's origin.doubleoYThe y coordinate of the ray's origin.doubleoZThe z coordinate of the ray's origin.
-
Constructor Summary
Constructors Constructor Description Rayd()Create a newRaydwith origin(0, 0, 0)and no direction.Rayd(double oX, double oY, double oZ, double dX, double dY, double dZ)Create a newRaydwith the given origin and direction.Rayd(Rayd source)Create a newRaydas a copy of the givensource.Rayd(Vector3dc origin, Vector3dc direction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()voidreadExternal(ObjectInput in)StringtoString()Return a string representation of this ray.StringtoString(NumberFormat formatter)Return a string representation of this ray by formatting the vector components with the givenNumberFormat.voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
oX
public double oX
The x coordinate of the ray's origin.
-
oY
public double oY
The y coordinate of the ray's origin.
-
oZ
public double oZ
The z coordinate of the ray's origin.
-
dX
public double dX
The x coordinate of the ray's direction.
-
dY
public double dY
The y coordinate of the ray's direction.
-
dZ
public double dZ
The z coordinate of the ray's direction.
-
-
Constructor Detail
-
Rayd
public Rayd()
Create a newRaydwith origin(0, 0, 0)and no direction.
-
Rayd
public Rayd(Rayd source)
Create a newRaydas a copy of the givensource.- Parameters:
source- theRaydto copy from
-
Rayd
public Rayd(Vector3dc origin, Vector3dc direction)
- Parameters:
origin- the origin of the raydirection- the direction of the ray
-
Rayd
public Rayd(double oX, double oY, double oZ, double dX, double dY, double dZ)Create a newRaydwith the given origin and direction.- Parameters:
oX- the x coordinate of the ray's originoY- the y coordinate of the ray's originoZ- the z coordinate of the ray's origindX- the x coordinate of the ray's directiondY- the y coordinate of the ray's directiondZ- the z coordinate of the ray's direction
-
-
Method Detail
-
toString
public String toString()
Return a string representation of this ray.This method creates a new
DecimalFormaton every invocation with the format string "0.000E0;-".
-
toString
public String toString(NumberFormat formatter)
Return a string representation of this ray by formatting the vector components with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the vector components with- Returns:
- the string representation
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-