de.grogra.vecmath.geom
public abstract class TransformableVolume extends VolumeBase
m00 to m22 and t0 to t2,
the transformation is computed by
t represents the location of the
object origin in world coordinates.
This representation has been chosen instead of
an instance of Matrix4d for memory and speed
(faster instantiation) reasons. After modification of
matrix components and other geometric parameters declared
by subclasses, invalidate() has to be invoked.| Modifier and Type | Field and Description |
|---|---|
protected double |
m00
00-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m01
01-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m02
02-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m10
10-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m11
11-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m12
12-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m20
20-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m21
21-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
m22
22-component of the rotation matrix from
world coordinates to object coordinates.
|
protected double |
t0
0-component of the translation
from object coordinates to world coordinates.
|
protected double |
t1
1-component of the translation
from object coordinates to world coordinates.
|
protected double |
t2
2-component of the translation
from object coordinates to world coordinates.
|
| Constructor and Description |
|---|
TransformableVolume() |
| Modifier and Type | Method and Description |
|---|---|
void |
getDiscExtent(double z,
double radius,
Tuple3d min,
Tuple3d max) |
void |
getDiscsExtent(double z1,
double radius1,
double z2,
double radius2,
Tuple3d min,
Tuple3d max) |
double |
getFrobeniusNorm()
Returns the Frobenius norm of the upper 3x3 values of the
world-to-object transformation, i.e., the square root of
m00 * m00 + ... + m22 * m22. |
Matrix3d |
getObjectToWorldRotationScale()
Computes the rotational component of the transformation
from local object coordinates to global world coordinates.
|
void |
getTransformation(Matrix3d rot,
Tuple3d trans)
gets the transformation from world to
object coordinates to the specified matrix
and vector:
o = rot * (w - trans) |
void |
invalidate()
Invalidates cached information about this volume.
|
void |
invTransformPoint(Tuple3d in,
Tuple3d out)
Transforms the point
in, specified in local
object coordinates, to out in global world
coordinates. |
void |
scale(double sx,
double sy,
double sz)
Multiplies the current world-to-object transformation
from left by a scaling matrix.
|
void |
setTransformation(Matrix3d rot,
Tuple3d trans)
Sets the transformation from world to
object coordinates to the specified matrix
and vector:
o = rot * (w - trans) |
void |
setTransformation(Tuple3d origin,
Tuple3d axis)
Sets the transformation from world to object coordinates to an
orthonormal transformation which transforms the
origin point to (0,0,0) and
the normalized axis vector
to (0,0,1). |
void |
transformPoint(Tuple3d in,
Tuple3d out)
Transforms the point
in, specified in global
world coordinates, to out in local object
coordinates. |
void |
transformTranspose(Tuple3d in,
Tuple3d out)
Multiplies the vector
in by the transpose of the upper
3x3 values of the world-to-object transformation and stores
the result in out. |
void |
transformVector(Tuple3d in,
Tuple3d out)
Transforms the direction
in, specified in global
world coordinates, to out in local object
coordinates. |
void |
translate(double dx,
double dy,
double dz)
Multiplies the current world-to-object transformation
from right by a translation matrix using the negated
values.
|
addConvexIntersections, getId, operator$and, operator$com, operator$or, operator$sub, setIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitboxContainsBoundary, computeIntersections, computeNormal, computeTangents, computeUV, contains, getExtentprotected double m00
protected double m01
protected double m02
protected double m10
protected double m11
protected double m12
protected double m20
protected double m21
protected double m22
protected double t0
protected double t1
protected double t2
public void getDiscsExtent(double z1,
double radius1,
double z2,
double radius2,
Tuple3d min,
Tuple3d max)
public double getFrobeniusNorm()
m00 * m00 + ... + m22 * m22. Note that the length
of a vector in object coordinates is less than or equal to the
length of this vector in world coordinates multplied by the
Frobenius norm of the transformation.public Matrix3d getObjectToWorldRotationScale()
public void getTransformation(Matrix3d rot, Tuple3d trans)
o = rot * (w - trans)rot - rotational component is stored in rottrans - translational component is stored in transpublic void invalidate()
public void invTransformPoint(Tuple3d in, Tuple3d out)
in, specified in local
object coordinates, to out in global world
coordinates. in and out may be the
same instance.in - point in object coordinatesout - point in world coordinatespublic void scale(double sx,
double sy,
double sz)
sx - scaling factor in x-directionsy - scaling factor in y-directionsz - scaling factor in z-directionpublic void setTransformation(Matrix3d rot, Tuple3d trans)
o = rot * (w - trans)rot - rotational component of new transformationtrans - translational component of new transformationpublic void setTransformation(Tuple3d origin, Tuple3d axis)
origin point to (0,0,0) and
the normalized axis vector
to (0,0,1).origin - origin in world coordinatesaxis - axis (local z-direction) in world coordinatespublic void transformPoint(Tuple3d in, Tuple3d out)
in, specified in global
world coordinates, to out in local object
coordinates. in and out may be the
same instance.in - point in world coordinatesout - point in object coordinatespublic void transformTranspose(Tuple3d in, Tuple3d out)
in by the transpose of the upper
3x3 values of the world-to-object transformation and stores
the result in out. This can be used to transform
normal vectors from object coordinates to world coordinates.
in and out may be the same instance.in - direction in world coordinatesout - direction in object coordinatespublic void transformVector(Tuple3d in, Tuple3d out)
in, specified in global
world coordinates, to out in local object
coordinates. in and out may be the
same instance.in - direction in world coordinatesout - direction in object coordinatespublic void translate(double dx,
double dy,
double dz)
dx - translation in x-directiondy - translation in y-directiondz - translation in z-direction