public final class TransformDp
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
| Constructor and Description |
|---|
TransformDp()
Instantiates an identity transform: no translation, no rotation, and no
scaling.
|
TransformDp(TransformDp original)
Instantiates a copy of the specified transform.
|
TransformDp(Vec3d translate,
Quatd rotate)
Instantiates a coordinate transform without scaling.
|
TransformDp(Vec3d translate,
Quatd rotate,
Vec3d scale)
Instantiates a coordinate transform with scaling.
|
| Modifier and Type | Method and Description |
|---|---|
TransformDp |
combineWithParent(TransformDp parent)
Combines with the argument and returns the (modified) current instance.
|
boolean |
equals(java.lang.Object otherObject)
Tests for exact equality with the argument, distinguishing -0 from 0.
|
Quatd |
getRotation()
Accesses the rotation component.
|
Vec3d |
getScale()
Accesses the scaling component.
|
Vec3d |
getTranslation()
Accesses the translation component.
|
int |
hashCode()
Returns a hash code.
|
TransformDp |
loadIdentity()
Sets the current instance to the identity transform: translation=(0,0,0)
scaling=(1,1,1) rotation=(0,0,0,1).
|
TransformDp |
set(TransformDp original)
Copies all 3 components from the argument.
|
TransformDp |
set(Vec3d translate,
Quatd rotate,
Vec3d scale)
Sets all 3 components to the specified values.
|
TransformDp |
setRotation(Quatd rotate)
Sets the rotation component to the argument.
|
TransformDp |
setScale(double factor)
Sets all components of the scaling component to the argument.
|
TransformDp |
setScale(Vec3d scale)
Sets the scaling component to the argument.
|
TransformDp |
setTranslation(Vec3d translate)
Sets the translation component to the argument.
|
java.lang.String |
toString()
Returns a string representation of the transform, which is unaffected.
|
Vec3d |
transformInverseVector(Vec3d in,
Vec3d storeResult)
Applies the inverse transform to the specified coordinates and returns
the result in
storeResult. |
Vec3d |
transformVector(Vec3d in,
Vec3d storeResult)
Transforms the specified coordinates and returns the result in
storeResult. |
public static final java.util.logging.Logger logger
public TransformDp()
public TransformDp(Vec3d translate, Quatd rotate)
translate - the desired translation (not null, unaffected)rotate - the desired rotation (not null, unaffected)public TransformDp(Vec3d translate, Quatd rotate, Vec3d scale)
translate - the desired translation (not null, unaffected)rotate - the desired rotation (not null, unaffected)scale - the desired scaling (not null, unaffected)public TransformDp(TransformDp original)
original - the instance to copy (not null, unaffected)public TransformDp combineWithParent(TransformDp parent)
It IS NOT safe for this and parent to be the same object.
parent - the parent transform (not null, unaffected unless it's
this)public Quatd getRotation()
public Vec3d getScale()
public Vec3d getTranslation()
public TransformDp loadIdentity()
public TransformDp set(TransformDp original)
original - the TransformDp to copy (not null, unaffected)public TransformDp set(Vec3d translate, Quatd rotate, Vec3d scale)
translate - the desired translation (not null, unaffected)rotate - the desired rotation (not null, unaffected)scale - the desired scaling (not null, unaffected)public TransformDp setRotation(Quatd rotate)
rotate - the desired rotation value (not null, unaffected)public TransformDp setScale(double factor)
factor - the desired scale factorpublic TransformDp setScale(Vec3d scale)
scale - the desired scaling (not null, unaffected)public TransformDp setTranslation(Vec3d translate)
translate - the desired translation (not null, unaffected)public Vec3d transformInverseVector(Vec3d in, Vec3d storeResult)
storeResult. If the storeResult is null, a
new Vec3d is created to hold the value. Either way, the current instance
is unaffected, unless storeResult is its translation or scaling.
It IS safe for in and storeResult to be the same object.
in - the coordinates to transform (not null, unaffected unless it's
storeResult)storeResult - storage for the result (modified if not null)storeResult or a new
Vec3d)public Vec3d transformVector(Vec3d in, Vec3d storeResult)
storeResult. If the storeResult is null, a new Vec3d is
created to hold the value. Either way, the current instance is
unaffected, unless storeResult is its scaling component or its
translation component.
It IS safe for in and storeResult to be the same object.
in - the coordinates to transform (not null, unaffected unless it's
storeResult)storeResult - storage for the result (modified if not null)storeResult or a new
Vec3d)public boolean equals(java.lang.Object otherObject)
otherObject is null, false is returned. Either way, the current
instance is unaffected.equals in class java.lang.ObjectotherObject - the object to compare (may be null, unaffected)this and otherObject have identical
values, otherwise falsepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
TransformDp[ 0.0, 0.0, 0.0] [ 0.0, 0.0, 0.0, 1.0] [ 1.0 , 1.0, 1.0]
toString in class java.lang.Object