Package org.joml
Class LineSegmentf
- java.lang.Object
-
- org.joml.LineSegmentf
-
- All Implemented Interfaces:
Externalizable,Serializable
public class LineSegmentf extends Object implements Externalizable
Represents an undirected line segment between two points.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description floataXThe x coordinate of the first point.floataYThe y coordinate of the first point.floataZThe z coordinate of the first point.floatbXThe x coordinate of the second point.floatbYThe y coordinate of the second point.floatbZThe z coordinate of the second point.
-
Constructor Summary
Constructors Constructor Description LineSegmentf()Create a newLineSegmentfof zero length on the point(0, 0, 0).LineSegmentf(float aX, float aY, float aZ, float bX, float bY, float bZ)Create a newLineSegmentfbetween the two points.LineSegmentf(LineSegmentf source)Create a newLineSegmentfas a copy of the givensource.LineSegmentf(Vector3fc a, Vector3fc b)Create a newLineSegmentfbetween the given two points.
-
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 line segment.StringtoString(NumberFormat formatter)Return a string representation of this line segment by formatting the vector components with the givenNumberFormat.voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
aX
public float aX
The x coordinate of the first point.
-
aY
public float aY
The y coordinate of the first point.
-
aZ
public float aZ
The z coordinate of the first point.
-
bX
public float bX
The x coordinate of the second point.
-
bY
public float bY
The y coordinate of the second point.
-
bZ
public float bZ
The z coordinate of the second point.
-
-
Constructor Detail
-
LineSegmentf
public LineSegmentf()
Create a newLineSegmentfof zero length on the point(0, 0, 0).
-
LineSegmentf
public LineSegmentf(LineSegmentf source)
Create a newLineSegmentfas a copy of the givensource.- Parameters:
source- theLineSegmentfto copy from
-
LineSegmentf
public LineSegmentf(Vector3fc a, Vector3fc b)
Create a newLineSegmentfbetween the given two points.- Parameters:
a- the first pointb- the second point
-
LineSegmentf
public LineSegmentf(float aX, float aY, float aZ, float bX, float bY, float bZ)Create a newLineSegmentfbetween the two points.- Parameters:
aX- the x coordinate of the first pointaY- the y coordinate of the first pointaZ- the z coordinate of the first pointbX- the x coordinate of the second pointbY- the y coordinate of the second pointbZ- the z coordinate of the second point
-
-
Method Detail
-
toString
public String toString()
Return a string representation of this line segment.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 line segment 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
-
-