Package org.joml
Class AxisAngle4d
- java.lang.Object
-
- org.joml.AxisAngle4d
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable
public class AxisAngle4d extends java.lang.Object implements java.io.Externalizable, java.lang.CloneableRepresents a 3D rotation of a given radians about an axis represented as an unit 3D vector.This class uses double-precision components.
- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AxisAngle4d()Create a newAxisAngle4dwith zero rotation about(0, 0, 1).AxisAngle4d(double angle, double x, double y, double z)Create a newAxisAngle4dwith the given values.AxisAngle4d(double angle, Vector3dc v)Create a newAxisAngle4dwith the given values.AxisAngle4d(double angle, Vector3f v)Create a newAxisAngle4dwith the given values.AxisAngle4d(AxisAngle4d a)Create a newAxisAngle4dwith the same values ofa.AxisAngle4d(AxisAngle4f a)Create a newAxisAngle4dwith the same values ofa.AxisAngle4d(Quaterniondc q)Create a newAxisAngle4dfrom the givenQuaterniondc.AxisAngle4d(Quaternionfc q)Create a newAxisAngle4dfrom the givenQuaternionfc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()booleanequals(java.lang.Object obj)AxisAngle4dget(AxisAngle4d dest)Set the givenAxisAngle4dto thisAxisAngle4d.AxisAngle4fget(AxisAngle4f dest)Set the givenAxisAngle4fto thisAxisAngle4d.Matrix3dget(Matrix3d m)Set the givenMatrix3dto a rotation transformation equivalent to thisAxisAngle4d.Matrix3fget(Matrix3f m)Set the givenMatrix3fto a rotation transformation equivalent to thisAxisAngle4d.Matrix4dget(Matrix4d m)Set the givenMatrix4dto a rotation transformation equivalent to thisAxisAngle4d.Matrix4fget(Matrix4f m)Set the givenMatrix4fto a rotation transformation equivalent to thisAxisAngle4d.Quaterniondget(Quaterniond q)Set the givenQuaterniondto be equivalent to thisAxisAngle4drotation.Quaternionfget(Quaternionf q)Set the givenQuaternionfto be equivalent to thisAxisAngle4drotation.inthashCode()AxisAngle4dnormalize()Normalize the axis vector.voidreadExternal(java.io.ObjectInput in)AxisAngle4drotate(double ang)Increase the rotation angle by the given amount.AxisAngle4dset(double angle, double x, double y, double z)Set thisAxisAngle4dto the given values.AxisAngle4dset(double angle, Vector3dc v)Set thisAxisAngle4dto the given values.AxisAngle4dset(double angle, Vector3f v)Set thisAxisAngle4dto the given values.AxisAngle4dset(AxisAngle4d a)Set thisAxisAngle4dto the values ofa.AxisAngle4dset(AxisAngle4f a)Set thisAxisAngle4dto the values ofa.AxisAngle4dset(Matrix3dc m)Set thisAxisAngle4dto be equivalent to the rotation of the givenMatrix3dc.AxisAngle4dset(Matrix3fc m)Set thisAxisAngle4dto be equivalent to the rotation of the givenMatrix3fc.AxisAngle4dset(Matrix4dc m)Set thisAxisAngle4dto be equivalent to the rotational component of the givenMatrix4dc.AxisAngle4dset(Matrix4fc m)Set thisAxisAngle4dto be equivalent to the rotational component of the givenMatrix4fc.AxisAngle4dset(Matrix4x3fc m)Set thisAxisAngle4dto be equivalent to the rotational component of the givenMatrix4x3fc.AxisAngle4dset(Quaterniondc q)Set thisAxisAngle4dto be equivalent to the givenQuaterniondc.AxisAngle4dset(Quaternionfc q)Set thisAxisAngle4dto be equivalent to the givenQuaternionfc.java.lang.StringtoString()Return a string representation of thisAxisAngle4d.java.lang.StringtoString(java.text.NumberFormat formatter)Return a string representation of thisAxisAngle4dby formatting the components with the givenNumberFormat.Vector3dtransform(Vector3d v)Transform the given vector by the rotation transformation described by thisAxisAngle4d.Vector3dtransform(Vector3dc v, Vector3d dest)Transform the given vector by the rotation transformation described by thisAxisAngle4dand store the result indest.Vector3ftransform(Vector3f v)Transform the given vector by the rotation transformation described by thisAxisAngle4d.Vector3ftransform(Vector3fc v, Vector3f dest)Transform the given vector by the rotation transformation described by thisAxisAngle4dand store the result indest.Vector4dtransform(Vector4d v)Transform the given vector by the rotation transformation described by thisAxisAngle4d.Vector4dtransform(Vector4dc v, Vector4d dest)Transform the given vector by the rotation transformation described by thisAxisAngle4dand store the result indest.voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Constructor Detail
-
AxisAngle4d
public AxisAngle4d()
Create a newAxisAngle4dwith zero rotation about(0, 0, 1).
-
AxisAngle4d
public AxisAngle4d(AxisAngle4d a)
Create a newAxisAngle4dwith the same values ofa.- Parameters:
a- the AngleAxis4d to copy the values from
-
AxisAngle4d
public AxisAngle4d(AxisAngle4f a)
Create a newAxisAngle4dwith the same values ofa.- Parameters:
a- the AngleAxis4f to copy the values from
-
AxisAngle4d
public AxisAngle4d(Quaternionfc q)
- Parameters:
q- the quaternion from which to create the new AngleAxis4f
-
AxisAngle4d
public AxisAngle4d(Quaterniondc q)
- Parameters:
q- the quaternion from which to create the new AngleAxis4d
-
AxisAngle4d
public AxisAngle4d(double angle, double x, double y, double z)Create a newAxisAngle4dwith the given values.- Parameters:
angle- the angle in radiansx- the x-coordinate of the rotation axisy- the y-coordinate of the rotation axisz- the z-coordinate of the rotation axis
-
AxisAngle4d
public AxisAngle4d(double angle, Vector3dc v)Create a newAxisAngle4dwith the given values.- Parameters:
angle- the angle in radiansv- the rotation axis as aVector3dc
-
AxisAngle4d
public AxisAngle4d(double angle, Vector3f v)Create a newAxisAngle4dwith the given values.- Parameters:
angle- the angle in radiansv- the rotation axis as aVector3f
-
-
Method Detail
-
set
public AxisAngle4d set(AxisAngle4d a)
Set thisAxisAngle4dto the values ofa.- Parameters:
a- the AngleAxis4f to copy the values from- Returns:
- this
-
set
public AxisAngle4d set(AxisAngle4f a)
Set thisAxisAngle4dto the values ofa.- Parameters:
a- the AngleAxis4f to copy the values from- Returns:
- this
-
set
public AxisAngle4d set(double angle, double x, double y, double z)
Set thisAxisAngle4dto the given values.- Parameters:
angle- the angle in radiansx- the x-coordinate of the rotation axisy- the y-coordinate of the rotation axisz- the z-coordinate of the rotation axis- Returns:
- this
-
set
public AxisAngle4d set(double angle, Vector3dc v)
Set thisAxisAngle4dto the given values.- Parameters:
angle- the angle in radiansv- the rotation axis as aVector3dc- Returns:
- this
-
set
public AxisAngle4d set(double angle, Vector3f v)
Set thisAxisAngle4dto the given values.- Parameters:
angle- the angle in radiansv- the rotation axis as aVector3f- Returns:
- this
-
set
public AxisAngle4d set(Quaternionfc q)
Set thisAxisAngle4dto be equivalent to the givenQuaternionfc.- Parameters:
q- the quaternion to set this AngleAxis4d from- Returns:
- this
-
set
public AxisAngle4d set(Quaterniondc q)
Set thisAxisAngle4dto be equivalent to the givenQuaterniondc.- Parameters:
q- the quaternion to set this AngleAxis4d from- Returns:
- this
-
set
public AxisAngle4d set(Matrix3fc m)
Set thisAxisAngle4dto be equivalent to the rotation of the givenMatrix3fc.Reference: http://www.euclideanspace.com
- Parameters:
m- the Matrix3fc to set this AngleAxis4d from- Returns:
- this
-
set
public AxisAngle4d set(Matrix3dc m)
Set thisAxisAngle4dto be equivalent to the rotation of the givenMatrix3dc.Reference: http://www.euclideanspace.com
- Parameters:
m- the Matrix3dc to set this AngleAxis4d from- Returns:
- this
-
set
public AxisAngle4d set(Matrix4fc m)
Set thisAxisAngle4dto be equivalent to the rotational component of the givenMatrix4fc.Reference: http://www.euclideanspace.com
- Parameters:
m- the Matrix4fc to set this AngleAxis4d from- Returns:
- this
-
set
public AxisAngle4d set(Matrix4x3fc m)
Set thisAxisAngle4dto be equivalent to the rotational component of the givenMatrix4x3fc.Reference: http://www.euclideanspace.com
- Parameters:
m- the Matrix4x3fc to set this AngleAxis4d from- Returns:
- this
-
set
public AxisAngle4d set(Matrix4dc m)
Set thisAxisAngle4dto be equivalent to the rotational component of the givenMatrix4dc.Reference: http://www.euclideanspace.com
- Parameters:
m- the Matrix4dc to set this AngleAxis4d from- Returns:
- this
-
get
public Quaternionf get(Quaternionf q)
Set the givenQuaternionfto be equivalent to thisAxisAngle4drotation.- Parameters:
q- the quaternion to set- Returns:
- q
- See Also:
Quaternionf.set(AxisAngle4d)
-
get
public Quaterniond get(Quaterniond q)
Set the givenQuaterniondto be equivalent to thisAxisAngle4drotation.- Parameters:
q- the quaternion to set- Returns:
- q
- See Also:
Quaterniond.set(AxisAngle4d)
-
get
public Matrix4f get(Matrix4f m)
Set the givenMatrix4fto a rotation transformation equivalent to thisAxisAngle4d.- Parameters:
m- the matrix to set- Returns:
- m
- See Also:
Matrix4f.set(AxisAngle4d)
-
get
public Matrix3f get(Matrix3f m)
Set the givenMatrix3fto a rotation transformation equivalent to thisAxisAngle4d.- Parameters:
m- the matrix to set- Returns:
- m
- See Also:
Matrix3f.set(AxisAngle4d)
-
get
public Matrix4d get(Matrix4d m)
Set the givenMatrix4dto a rotation transformation equivalent to thisAxisAngle4d.- Parameters:
m- the matrix to set- Returns:
- m
- See Also:
Matrix4f.set(AxisAngle4d)
-
get
public Matrix3d get(Matrix3d m)
Set the givenMatrix3dto a rotation transformation equivalent to thisAxisAngle4d.- Parameters:
m- the matrix to set- Returns:
- m
- See Also:
Matrix3f.set(AxisAngle4d)
-
get
public AxisAngle4d get(AxisAngle4d dest)
Set the givenAxisAngle4dto thisAxisAngle4d.- Parameters:
dest- will hold the result- Returns:
- dest
-
get
public AxisAngle4f get(AxisAngle4f dest)
Set the givenAxisAngle4fto thisAxisAngle4d.- Parameters:
dest- will hold the result- Returns:
- dest
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
normalize
public AxisAngle4d normalize()
Normalize the axis vector.- Returns:
- this
-
rotate
public AxisAngle4d rotate(double ang)
Increase the rotation angle by the given amount.This method also takes care of wrapping around.
- Parameters:
ang- the angle increase- Returns:
- this
-
transform
public Vector3d transform(Vector3d v)
Transform the given vector by the rotation transformation described by thisAxisAngle4d.- Parameters:
v- the vector to transform- Returns:
- v
-
transform
public Vector3d transform(Vector3dc v, Vector3d dest)
Transform the given vector by the rotation transformation described by thisAxisAngle4dand store the result indest.- Parameters:
v- the vector to transformdest- will hold the result- Returns:
- dest
-
transform
public Vector3f transform(Vector3f v)
Transform the given vector by the rotation transformation described by thisAxisAngle4d.- Parameters:
v- the vector to transform- Returns:
- v
-
transform
public Vector3f transform(Vector3fc v, Vector3f dest)
Transform the given vector by the rotation transformation described by thisAxisAngle4dand store the result indest.- Parameters:
v- the vector to transformdest- will hold the result- Returns:
- dest
-
transform
public Vector4d transform(Vector4d v)
Transform the given vector by the rotation transformation described by thisAxisAngle4d.- Parameters:
v- the vector to transform- Returns:
- v
-
transform
public Vector4d transform(Vector4dc v, Vector4d dest)
Transform the given vector by the rotation transformation described by thisAxisAngle4dand store the result indest.- Parameters:
v- the vector to transformdest- will hold the result- Returns:
- dest
-
toString
public java.lang.String toString()
Return a string representation of thisAxisAngle4d.This method creates a new
DecimalFormaton every invocation with the format string "0.000E0;-".- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation
-
toString
public java.lang.String toString(java.text.NumberFormat formatter)
Return a string representation of thisAxisAngle4dby formatting the components with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the vector components with- Returns:
- the string representation
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-