public class CTransform3D extends Object implements Externalizable
Modifier and Type | Field and Description |
---|---|
double |
m00
The m00 element of the matrix.
|
double |
m01
The m01 element of the matrix.
|
double |
m02
The m02 element of the matrix.
|
double |
m03
The m03 element of the matrix.
|
double |
m10
The m10 element of the matrix.
|
double |
m11
The m11 element of the matrix.
|
double |
m12
The m12 element of the matrix.
|
double |
m13
The m13 element of the matrix.
|
double |
m20
The m20 element of the matrix.
|
double |
m21
The m21 element of the matrix.
|
double |
m22
The m22 element of the matrix.
|
double |
m23
The m23 element of the matrix.
|
double |
m30
The m30 element of the matrix.
|
double |
m31
The m31 element of the matrix.
|
double |
m32
The m32 element of the matrix.
|
double |
m33
The m33 element of the matrix.
|
Constructor and Description |
---|
CTransform3D()
Constructs an identity transformation.
|
CTransform3D(CTransform3D t)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
determinant()
Computes the determinant of the matrix.
|
double |
determinant2D()
Computes the determinant of the 2D matrix.
|
double[] |
getEuler()
Gets the Euler angles from the rotation transformation.
|
double |
getScale()
Gets the scale factor.
|
void |
invert()
Inverts the matrix.
|
boolean |
is3d()
Tests whether the transformation is 3D.
|
void |
mul(CTransform3D b)
Multiplies by another matrix.
|
void |
read16doubles(ObjectInput in)
Reads the 4x4 matrix components as double precision floating point
numbers.
|
void |
read16floats(ObjectInput in)
Reads the 4x4 matrix components as single precision floating point
numbers.
|
void |
readExternal(ObjectInput in)
Deserializes a transformation matrix.
|
void |
set(CTransform3D t)
Copy.
|
void |
setEuler(double psi,
double theta,
double phi)
Sets the rotational component using the Euler angles provided.
|
void |
setIdentity()
Makes identity transformation.
|
void |
setRotation(double nx,
double ny,
double nz,
double phi)
Sets the rotation components.
|
void |
setRotationCenter(DPoint3 o)
Sets the rotation center.
|
void |
setScale(double scale)
Sets the scale factor.
|
void |
setTranslation(double x0,
double y0,
double z0)
|
void |
setTranslation(DPoint3 p)
|
void |
setZero()
Sets all components to zero.
|
String |
toString()
Gets a string representation of the matrix.
|
void |
transform(DPoint3 p)
Transforms a point.
|
void |
write16doubles(ObjectOutput out)
Writes the 4x4 matrix components as double precision floating point
numbers.
|
void |
write16floats(ObjectOutput out)
Writes the 4x4 matrix components as single precision floating point
numbers.
|
void |
writeExternal(ObjectOutput out)
Serializes a transformation matrix.
|
public transient double m00
public transient double m01
public transient double m02
public transient double m03
public transient double m10
public transient double m11
public transient double m12
public transient double m13
public transient double m20
public transient double m21
public transient double m22
public transient double m23
public transient double m30
public transient double m31
public transient double m32
public transient double m33
public CTransform3D(CTransform3D t)
t
- the transformation to copypublic CTransform3D()
public void set(CTransform3D t)
t
- target transformationpublic final void setZero()
public final void setIdentity()
public final double[] getEuler()
public final void setEuler(double psi, double theta, double phi)
psi
- rotation angle about X axistheta
- rotation angle about Y axisphi
- rotation angle about Z axispublic final double getScale()
public final void setScale(double scale)
scale
- the scalepublic final double determinant()
public final double determinant2D()
public final void setRotation(double nx, double ny, double nz, double phi)
nx
- normal vector xny
- normal vector ynz
- normal vector zphi
- anglepublic final void setRotationCenter(DPoint3 o)
setRotation
(order is important!) if a point other than the origin is meant to be
the rotation center. It sets the translation vector in the fourth
column (m03
, m13
and m23
)
in such a way that point o
will be the center of rotation
specified by the upper left 3x3 components.o
- the centerpublic final void setTranslation(DPoint3 p)
p
- the translationpublic final void setTranslation(double x0, double y0, double z0)
x0
- x translationy0
- y translationz0
- z translationpublic final void transform(DPoint3 p)
p
- the pointpublic final void mul(CTransform3D b)
b
- the other matrixpublic boolean is3d()
public final void invert()
public String toString()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the object output streamIOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
in
- the object input streamIOException
public final void write16doubles(ObjectOutput out) throws IOException
out
- the object output streamIOException
public final void read16doubles(ObjectInput in) throws IOException
in
- the object input streamIOException
public final void write16floats(ObjectOutput out) throws IOException
out
- the object output streamIOException
public final void read16floats(ObjectInput in) throws IOException
in
- the object input streamIOException