Package org.joml
Class AxisAngle4d
java.lang.Object
org.joml.AxisAngle4d
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
Represents 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:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a newAxisAngle4d
with zero rotation about(0, 0, 1)
.AxisAngle4d
(double angle, double x, double y, double z) Create a newAxisAngle4d
with the given values.AxisAngle4d
(double angle, Vector3dc v) Create a newAxisAngle4d
with the given values.AxisAngle4d
(double angle, Vector3f v) Create a newAxisAngle4d
with the given values.Create a newAxisAngle4d
with the same values ofa
.Create a newAxisAngle4d
with the same values ofa
.Create a newAxisAngle4d
from the givenQuaterniondc
.Create a newAxisAngle4d
from the givenQuaternionfc
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
get
(AxisAngle4d dest) Set the givenAxisAngle4d
to thisAxisAngle4d
.get
(AxisAngle4f dest) Set the givenAxisAngle4f
to thisAxisAngle4d
.Set the givenMatrix3d
to a rotation transformation equivalent to thisAxisAngle4d
.Set the givenMatrix3f
to a rotation transformation equivalent to thisAxisAngle4d
.Set the givenMatrix4d
to a rotation transformation equivalent to thisAxisAngle4d
.Set the givenMatrix4f
to a rotation transformation equivalent to thisAxisAngle4d
.get
(Quaterniond q) Set the givenQuaterniond
to be equivalent to thisAxisAngle4d
rotation.get
(Quaternionf q) Set the givenQuaternionf
to be equivalent to thisAxisAngle4d
rotation.int
hashCode()
Normalize the axis vector.void
rotate
(double ang) Increase the rotation angle by the given amount.set
(double angle, double x, double y, double z) Set thisAxisAngle4d
to the given values.Set thisAxisAngle4d
to the given values.Set thisAxisAngle4d
to the given values.set
(AxisAngle4d a) Set thisAxisAngle4d
to the values ofa
.set
(AxisAngle4f a) Set thisAxisAngle4d
to the values ofa
.Set thisAxisAngle4d
to be equivalent to the rotation of the givenMatrix3dc
.Set thisAxisAngle4d
to be equivalent to the rotation of the givenMatrix3fc
.Set thisAxisAngle4d
to be equivalent to the rotational component of the givenMatrix4dc
.Set thisAxisAngle4d
to be equivalent to the rotational component of the givenMatrix4fc
.set
(Matrix4x3fc m) Set thisAxisAngle4d
to be equivalent to the rotational component of the givenMatrix4x3fc
.set
(Quaterniondc q) Set thisAxisAngle4d
to be equivalent to the givenQuaterniondc
.set
(Quaternionfc q) Set thisAxisAngle4d
to be equivalent to the givenQuaternionfc
.toString()
Return a string representation of thisAxisAngle4d
.toString
(NumberFormat formatter) Return a string representation of thisAxisAngle4d
by formatting the components with the givenNumberFormat
.Transform the given vector by the rotation transformation described by thisAxisAngle4d
.Transform the given vector by the rotation transformation described by thisAxisAngle4d
and store the result indest
.Transform the given vector by the rotation transformation described by thisAxisAngle4d
.Transform the given vector by the rotation transformation described by thisAxisAngle4d
and store the result indest
.Transform the given vector by the rotation transformation described by thisAxisAngle4d
.Transform the given vector by the rotation transformation described by thisAxisAngle4d
and store the result indest
.void
-
Field Details
-
angle
public double angleThe angle in radians. -
x
public double xThe x-component of the rotation axis. -
y
public double yThe y-component of the rotation axis. -
z
public double zThe z-component of the rotation axis.
-
-
Constructor Details
-
AxisAngle4d
public AxisAngle4d()Create a newAxisAngle4d
with zero rotation about(0, 0, 1)
. -
AxisAngle4d
Create a newAxisAngle4d
with the same values ofa
.- Parameters:
a
- the AngleAxis4d to copy the values from
-
AxisAngle4d
Create a newAxisAngle4d
with the same values ofa
.- Parameters:
a
- the AngleAxis4f to copy the values from
-
AxisAngle4d
- Parameters:
q
- the quaternion from which to create the new AngleAxis4f
-
AxisAngle4d
- Parameters:
q
- the quaternion from which to create the new AngleAxis4d
-
AxisAngle4d
public AxisAngle4d(double angle, double x, double y, double z) Create a newAxisAngle4d
with 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
Create a newAxisAngle4d
with the given values.- Parameters:
angle
- the angle in radiansv
- the rotation axis as aVector3dc
-
AxisAngle4d
Create a newAxisAngle4d
with the given values.- Parameters:
angle
- the angle in radiansv
- the rotation axis as aVector3f
-
-
Method Details
-
set
Set thisAxisAngle4d
to the values ofa
.- Parameters:
a
- the AngleAxis4f to copy the values from- Returns:
- this
-
set
Set thisAxisAngle4d
to the values ofa
.- Parameters:
a
- the AngleAxis4f to copy the values from- Returns:
- this
-
set
Set thisAxisAngle4d
to 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
Set thisAxisAngle4d
to the given values.- Parameters:
angle
- the angle in radiansv
- the rotation axis as aVector3dc
- Returns:
- this
-
set
Set thisAxisAngle4d
to the given values.- Parameters:
angle
- the angle in radiansv
- the rotation axis as aVector3f
- Returns:
- this
-
set
Set thisAxisAngle4d
to be equivalent to the givenQuaternionfc
.- Parameters:
q
- the quaternion to set this AngleAxis4d from- Returns:
- this
-
set
Set thisAxisAngle4d
to be equivalent to the givenQuaterniondc
.- Parameters:
q
- the quaternion to set this AngleAxis4d from- Returns:
- this
-
set
Set thisAxisAngle4d
to 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
Set thisAxisAngle4d
to 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
Set thisAxisAngle4d
to 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
Set thisAxisAngle4d
to 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
Set thisAxisAngle4d
to 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
Set the givenQuaternionf
to be equivalent to thisAxisAngle4d
rotation.- Parameters:
q
- the quaternion to set- Returns:
- q
- See Also:
-
get
Set the givenQuaterniond
to be equivalent to thisAxisAngle4d
rotation.- Parameters:
q
- the quaternion to set- Returns:
- q
- See Also:
-
get
Set the givenMatrix4f
to a rotation transformation equivalent to thisAxisAngle4d
.- Parameters:
m
- the matrix to set- Returns:
- m
- See Also:
-
get
Set the givenMatrix3f
to a rotation transformation equivalent to thisAxisAngle4d
.- Parameters:
m
- the matrix to set- Returns:
- m
- See Also:
-
get
Set the givenMatrix4d
to a rotation transformation equivalent to thisAxisAngle4d
.- Parameters:
m
- the matrix to set- Returns:
- m
- See Also:
-
get
Set the givenMatrix3d
to a rotation transformation equivalent to thisAxisAngle4d
.- Parameters:
m
- the matrix to set- Returns:
- m
- See Also:
-
get
Set the givenAxisAngle4d
to thisAxisAngle4d
.- Parameters:
dest
- will hold the result- Returns:
- dest
-
get
Set the givenAxisAngle4f
to thisAxisAngle4d
.- Parameters:
dest
- will hold the result- Returns:
- dest
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
normalize
Normalize the axis vector.- Returns:
- this
-
rotate
Increase the rotation angle by the given amount.This method also takes care of wrapping around.
- Parameters:
ang
- the angle increase- Returns:
- this
-
transform
Transform the given vector by the rotation transformation described by thisAxisAngle4d
.- Parameters:
v
- the vector to transform- Returns:
- v
-
transform
Transform the given vector by the rotation transformation described by thisAxisAngle4d
and store the result indest
.- Parameters:
v
- the vector to transformdest
- will hold the result- Returns:
- dest
-
transform
Transform the given vector by the rotation transformation described by thisAxisAngle4d
.- Parameters:
v
- the vector to transform- Returns:
- v
-
transform
Transform the given vector by the rotation transformation described by thisAxisAngle4d
and store the result indest
.- Parameters:
v
- the vector to transformdest
- will hold the result- Returns:
- dest
-
transform
Transform the given vector by the rotation transformation described by thisAxisAngle4d
.- Parameters:
v
- the vector to transform- Returns:
- v
-
transform
Transform the given vector by the rotation transformation described by thisAxisAngle4d
and store the result indest
.- Parameters:
v
- the vector to transformdest
- will hold the result- Returns:
- dest
-
toString
Return a string representation of thisAxisAngle4d
.This method creates a new
DecimalFormat
on every invocation with the format string "0.000E0;-
". -
toString
Return a string representation of thisAxisAngle4d
by formatting the components with the givenNumberFormat
.- Parameters:
formatter
- theNumberFormat
used to format the vector components with- Returns:
- the string representation
-
hashCode
public int hashCode() -
equals
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-