Package org.joml
Class Rayf
- java.lang.Object
-
- org.joml.Rayf
-
- All Implemented Interfaces:
Externalizable,Serializable
public class Rayf extends Object implements Externalizable
Represents a ray with a given origin and direction using single-precision floating-point numbers.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description floatdXThe x coordinate of the ray's direction.floatdYThe y coordinate of the ray's direction.floatdZThe z coordinate of the ray's direction.floatoXThe x coordinate of the ray's origin.floatoYThe y coordinate of the ray's origin.floatoZThe z coordinate of the ray's origin.
-
Constructor Summary
Constructors Constructor Description Rayf()Create a newRayfwith origin(0, 0, 0)and no direction.Rayf(float oX, float oY, float oZ, float dX, float dY, float dZ)Create a newRayfwith the given origin and direction.Rayf(Rayf source)Create a newRayfas a copy of the givensource.Rayf(Vector3fc origin, Vector3fc 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 float oX
The x coordinate of the ray's origin.
-
oY
public float oY
The y coordinate of the ray's origin.
-
oZ
public float oZ
The z coordinate of the ray's origin.
-
dX
public float dX
The x coordinate of the ray's direction.
-
dY
public float dY
The y coordinate of the ray's direction.
-
dZ
public float dZ
The z coordinate of the ray's direction.
-
-
Constructor Detail
-
Rayf
public Rayf()
Create a newRayfwith origin(0, 0, 0)and no direction.
-
Rayf
public Rayf(Rayf source)
Create a newRayfas a copy of the givensource.- Parameters:
source- theRayfto copy from
-
Rayf
public Rayf(Vector3fc origin, Vector3fc direction)
- Parameters:
origin- the origin of the raydirection- the direction of the ray
-
Rayf
public Rayf(float oX, float oY, float oZ, float dX, float dY, float dZ)Create a newRayfwith 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
-
-