Package org.joml
Class Spheref
- java.lang.Object
-
- org.joml.Spheref
-
- All Implemented Interfaces:
Externalizable,Serializable
public class Spheref extends Object implements Externalizable
Represents a 3D sphere.- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
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 sphere.StringtoString(NumberFormat formatter)Return a string representation of this sphere by formatting the components with the givenNumberFormat.Sphereftranslate(float x, float y, float z)Translatethisby the vector(x, y, z).Sphereftranslate(float x, float y, float z, Spheref dest)Translatethisby the vector(x, y, z)and store the result indest.Sphereftranslate(Vector3fc xyz)Translatethisby the given vectorxyz.Sphereftranslate(Vector3fc xyz, Spheref dest)Translatethisby the given vectorxyzand store the result indest.voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
Spheref
public Spheref()
-
Spheref
public Spheref(Spheref source)
Create a newSpherefas a copy of the givensource.- Parameters:
source- theSpherefto copy from
-
Spheref
public Spheref(Vector3fc c, float r)
- Parameters:
c- the center position of the spherer- the radius of the sphere
-
Spheref
public Spheref(float x, float y, float z, float r)- Parameters:
x- the x coordinate of the sphere's centery- the y coordinate of the sphere's centerz- the z coordinate of the sphere's centerr- the radius of the sphere
-
-
Method Detail
-
translate
public Spheref translate(Vector3fc xyz)
Translatethisby the given vectorxyz.- Parameters:
xyz- the vector to translate by- Returns:
- this
-
translate
public Spheref translate(Vector3fc xyz, Spheref dest)
Translatethisby the given vectorxyzand store the result indest.- Parameters:
xyz- the vector to translate bydest- will hold the result- Returns:
- dest
-
translate
public Spheref translate(float x, float y, float z)
Translatethisby the vector(x, y, z).- Parameters:
x- the x coordinate to translate byy- the y coordinate to translate byz- the z coordinate to translate by- Returns:
- this
-
translate
public Spheref translate(float x, float y, float z, Spheref dest)
Translatethisby the vector(x, y, z)and store the result indest.- Parameters:
x- the x coordinate to translate byy- the y coordinate to translate byz- the z coordinate to translate bydest- will hold the result- Returns:
- dest
-
toString
public String toString()
Return a string representation of this sphere.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 sphere by formatting the components with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the 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
-
-