|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metaio.sdk.jni.Rotation
public class Rotation
This class contains some basic operations on rotations in the 3D space. Basic conversions to different representations of an rotation are also implemented
Constructor Summary | |
---|---|
Rotation()
Initialized with no rotation |
|
Rotation(float[] rotationMatrix)
|
|
Rotation(float x,
float y,
float z)
|
|
Rotation(long cPtr,
boolean cMemoryOwn)
|
|
Rotation(Rotation rotation)
|
|
Rotation(Vector3d eulerAngle)
|
|
Rotation(Vector4d quaternion)
|
Method Summary | |
---|---|
void |
delete()
|
float |
getAngleToRotation(Rotation rotation)
If they are similar this angle should be small |
Vector4d |
getAxisAngle()
Vector4d representing an axis angle. |
static long |
getCPtr(Rotation obj)
|
Vector3d |
getEulerAngleDegrees()
Vector3d representing an Euler angle. |
Vector3d |
getEulerAngleRadians()
Vector3d representing an Euler angle. |
Vector4d |
getQuaternion()
Vector4d representing a quaternion. |
void |
getRotationMatrix(float[] rotationMatrix)
|
Rotation |
interpolateRotation(Rotation rotation,
float weight)
|
Rotation |
inverse()
This inverse corresponds to a rotation in the opposite direction rotation*rotation. inverse() == rotation.setNoRotation()The inverse of the rotation |
boolean |
isEqual(Rotation rotation)
|
Rotation |
multiply(Rotation factor)
|
Vector3d |
rotatePoint(Vector3d point)
|
void |
setFromAxisAngle(Vector4d axisAngle)
|
void |
setFromEulerAngleDegrees(Vector3d eulerAngleDegree)
|
void |
setFromEulerAngleRadians(Vector3d eulerAngleRadians)
|
void |
setFromModelviewMatrix(float[] modelviewMatrix)
|
void |
setFromQuaternion(Vector4d quaternion)
|
void |
setFromRotationMatrix(float[] rotationMatrix)
|
void |
setNoRotation()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Rotation(long cPtr, boolean cMemoryOwn)
public Rotation()
public Rotation(Rotation rotation)
rotation
- This rotation will be used for initializationpublic Rotation(float[] rotationMatrix)
rotationMatrix
- Rotation matrix (3x3) array row majorpublic Rotation(Vector4d quaternion)
quaternion
- rotation as quaternionpublic Rotation(Vector3d eulerAngle)
eulerAngle
- rotation as euler angles in radianspublic Rotation(float x, float y, float z)
x
- Euler angle (radians) around x-axisy
- Euler angle (radians) around y-axisz
- Euler angle (radians) around z-axisMethod Detail |
---|
public static long getCPtr(Rotation obj)
public void delete()
public Rotation multiply(Rotation factor)
public boolean isEqual(Rotation rotation)
rotation
- The rotation that should be compared with.
true if equal, false otherwisepublic void setFromRotationMatrix(float[] rotationMatrix)
rotationMatrix
- Rotation matrix (3x3) array row majorpublic void getRotationMatrix(float[] rotationMatrix)
rotationMatrix
- Rotation matrix (3x3) array row majorpublic void setFromModelviewMatrix(float[] modelviewMatrix)
modelviewMatrix
- Modelview matrix (4x4) array row majorpublic void setFromQuaternion(Vector4d quaternion)
quaternion
- Quaternion. Imaginary part: quaternion.x, quaternion.y, quaternion.z
Real part: quaternion.wpublic Vector4d getQuaternion()
public void setFromAxisAngle(Vector4d axisAngle)
axisAngle
- Axis angle. Rotation axis (length == 1): axisAngle.x, axisAngle.y, axisAngle.z Rotation right handed: axisAngle.w in radianspublic Vector4d getAxisAngle()
public void setFromEulerAngleRadians(Vector3d eulerAngleRadians)
eulerAngleRadians
- Euler angle. Rotation order: x-axis, y-axis, z-axis in radianspublic Vector3d getEulerAngleRadians()
public void setFromEulerAngleDegrees(Vector3d eulerAngleDegree)
eulerAngleDegree
- Euler angle. Rotation order: x-axis, y-axis, z-axis in degreespublic Vector3d getEulerAngleDegrees()
public Vector3d rotatePoint(Vector3d point)
point
- 3D point
The rotated pointpublic void setNoRotation()
public Rotation inverse()
public float getAngleToRotation(Rotation rotation)
rotation
- Input rotation
Angle difference in radians. Always >= 0public Rotation interpolateRotation(Rotation rotation, float weight)
rotation
- The input rotation, that will be interpolatedweight
- of the input rotation. weight == 0: Returns this rotation weight == 1:
Returns the input rotation weight[0;1]: Returns interpolated rotation
Interpolated rotation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |