public class Rotf extends Object
| Modifier and Type | Field and Description |
|---|---|
private static float |
EPSILON |
private float |
q0 |
private float |
q1 |
private float |
q2 |
private float |
q3 |
| Constructor and Description |
|---|
Rotf()
Default constructor initializes to the identity quaternion
|
Rotf(Rotf arg) |
Rotf(Vec3f axis,
float angle)
Axis does not need to be normalized but must not be the zero
vector.
|
Rotf(Vec3f from,
Vec3f to)
Creates a rotation which will rotate vector "from" into vector
"to".
|
| Modifier and Type | Method and Description |
|---|---|
void |
fromMatrix(Mat4f mat)
Turns the upper left 3x3 of the passed matrix into a rotation.
|
float |
get(Vec3f axis)
Returns angle (in radians) and mutates the given vector to be
the axis.
|
void |
init()
Re-initialize this quaternion to be the identity quaternion "e"
(i.e., no rotation)
|
Rotf |
inverse()
Returns inverse of this rotation; creates new rotation
|
void |
invert()
Mutate this quaternion to be its inverse.
|
float |
length()
Length of this quaternion in four-space
|
float |
lengthSquared()
This dotted with this
|
void |
mul(Rotf a,
Rotf b)
Compose two rotations: this = A * B in that order.
|
void |
normalize()
Make this quaternion a unit quaternion again.
|
Vec3f |
rotateVector(Vec3f src)
Rotate a vector by this quaternion, returning newly-allocated result.
|
void |
rotateVector(Vec3f src,
Vec3f dest)
Rotate a vector by this quaternion.
|
void |
set(Rotf arg) |
void |
set(Vec3f axis,
float angle)
Axis does not need to be normalized but must not be the zero
vector.
|
void |
set(Vec3f from,
Vec3f to)
Sets this rotation to that which will rotate vector "from" into
vector "to".
|
private void |
setQ(int i,
float val) |
Rotf |
times(Rotf b)
Returns this * b, in that order; creates new rotation
|
void |
toMatrix(Mat4f mat)
Turns this rotation into a 3x3 rotation matrix.
|
String |
toString() |
boolean |
withinEpsilon(Rotf arg,
float epsilon)
Test for "approximate equality" -- performs componentwise test
to see whether difference between all components is less than
epsilon.
|
private static float EPSILON
private float q0
private float q1
private float q2
private float q3
public Rotf()
public Rotf(Rotf arg)
public Rotf(Vec3f axis, float angle)
public void init()
public boolean withinEpsilon(Rotf arg, float epsilon)
public void set(Vec3f axis, float angle)
public void set(Rotf arg)
public void set(Vec3f from, Vec3f to)
public float get(Vec3f axis)
public Rotf inverse()
public void invert()
public float length()
public float lengthSquared()
public void normalize()
public void mul(Rotf a, Rotf b)
public void toMatrix(Mat4f mat)
public void fromMatrix(Mat4f mat)
gleem.linalg.Mat4f#getRotationpublic void rotateVector(Vec3f src, Vec3f dest)
public Vec3f rotateVector(Vec3f src)
private void setQ(int i,
float val)
Copyright © 2007–2017 Gephi Consortium. All rights reserved.