|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mascotcapsule.micro3d.v3.AffineTrans
This class handles 3D affine transformation matrices. It allows the setting of various transformation matrices that signify activities such as rotating an object. The elements of the matrices are expressed so that the value 1.0 amounts to 4096 units. Each element is a 32-bit signed integer value. Operations take place within the int (32 bit) range. If an overflow that exceeds the int width occurs during a mathematical operation, the operational results will be considered undefined.
Field Summary | |
int |
m00
Row 1 column 1 element. |
int |
m01
Row 1 column 2 element. |
int |
m02
Row 1 column 3 element. |
int |
m03
Row 1 column 4 element. |
int |
m10
Row 2 column 1 element. |
int |
m11
Row 2 column 2 element. |
int |
m12
Row 2 column 3 element. |
int |
m13
Row 2 column 4 element. |
int |
m20
Row 3 column 1 element. |
int |
m21
Row 3 column 2 element. |
int |
m22
Row 3 column 3 element. |
int |
m23
Row 3 column 4 element. |
Constructor Summary | |
AffineTrans()
Creates a matrix in which all elements are 0. |
|
AffineTrans(AffineTrans a)
Creates a copy of the other matrices. |
|
AffineTrans(int[] a)
Creates a matrix by specifying the values of all elements. |
|
AffineTrans(int[][] a)
Creates a matrix by specifying the values of all elements. |
|
AffineTrans(int[] a,
int offset)
Creates a matrix by specifying the values of all elements. |
|
AffineTrans(int m00,
int m01,
int m02,
int m03,
int m10,
int m11,
int m12,
int m13,
int m20,
int m21,
int m22,
int m23)
Creates a matrix by specifying the values of all elements. |
Method Summary | |
void |
get(int[] a)
Gets the values of all elements. |
void |
get(int[] a,
int offset)
Gets the values of all elements. |
void |
lookAt(Vector3D pos,
Vector3D look,
Vector3D up)
Sets the matrix elements so that they become the transformations for the viewing position coordinates. |
void |
mul(AffineTrans a)
Calculates the product (this ?~ a) of the transformation matrix. |
void |
mul(AffineTrans a1,
AffineTrans a2)
Calculates the product (a1 ?~ a2) of the transformation matrix. |
void |
multiply(AffineTrans a)
Deprecated. Method to be eliminated in the near future. |
void |
multiply(AffineTrans a1,
AffineTrans a2)
Deprecated. Method to be eliminated in the near future. |
void |
rotationV(Vector3D v,
int r)
Deprecated. Method to be eliminated in the near future. |
void |
rotationX(int r)
In a right-hand coordinate system, enter the matrix elements so that the rotation transformation is centered on the x axis. |
void |
rotationY(int r)
In a right-hand coordinate system, enter the matrix elements so that the rotation transformation is centered on the y axis. |
void |
rotationZ(int r)
In a right-hand coordinate system, enter the matrix elements so that the rotation transformation is centered on the z axis. |
void |
set(AffineTrans a)
Copies the content of the other matrices. |
void |
set(int[] a)
Sets the value of all elements. |
void |
set(int[][] a)
Sets the values of all elements. |
void |
set(int[] a,
int offset)
Enters the values of all elements. |
void |
set(int m00,
int m01,
int m02,
int m03,
int m10,
int m11,
int m12,
int m13,
int m20,
int m21,
int m22,
int m23)
Sets the values of all elements. |
void |
setIdentity()
Enters the matrix element so that it becomes an identity transformation. |
void |
setRotation(Vector3D v,
int r)
In a right-hand coordinate system, enter the matrix element settings so that there is rotational transformation that is centered on the specified vector. |
void |
setRotationX(int r)
Deprecated. Method to be eliminated in the near future. |
void |
setRotationY(int r)
Deprecated. Method to be eliminated in the near future. |
void |
setRotationZ(int r)
Deprecated. Method to be eliminated in the near future. |
void |
setViewTrans(Vector3D pos,
Vector3D look,
Vector3D up)
Deprecated. Method to be eliminated in the near future. |
Vector3D |
transform(Vector3D v)
Transforms vectors indicating the point coordinates using this transformation matrix and uses the vectors showing the results as the return values. |
Vector3D |
transPoint(Vector3D v)
Deprecated. Method to be eliminated in the near future. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int m00
public int m01
public int m02
public int m03
public int m10
public int m11
public int m12
public int m13
public int m20
public int m21
public int m22
public int m23
Constructor Detail |
public AffineTrans()
public AffineTrans(int m00, int m01, int m02, int m03, int m10, int m11, int m12, int m13, int m20, int m21, int m22, int m23)
public AffineTrans(AffineTrans a)
a
- The matrix that was copied
java.lang.NullPointerException
- When the argument a is null.public AffineTrans(int[][] a)
a
- 2-dimensional array
java.lang.NullPointerException
- When argument a is null. When one of the elements of a[] is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public AffineTrans(int[] a)
a
- 1-dimensional array
java.lang.NullPointerException
- When argument a is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public AffineTrans(int[] a, int offset)
a
- 1-dimensional arrayoffset
- Start position
java.lang.NullPointerException
- When argument a is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.Method Detail |
public final void setRotationX(int r)
setRotationX(int)
public final void setRotationY(int r)
setRotationY(int)
public final void setRotationZ(int r)
setRotationZ(int)
public final void setIdentity()
public final void get(int[] a)
a
- 1-dimensional array
java.lang.NullPointerException
- When argument a is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public final void get(int[] a, int offset)
a
- 1-dimensional arrayoffset
- Start position
java.lang.NullPointerException
- When argument a is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public final void set(int[] a, int offset)
a
- 1-dimensional arrayoffset
- Start position
java.lang.NullPointerException
- When argument a is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public final void set(int m00, int m01, int m02, int m03, int m10, int m11, int m12, int m13, int m20, int m21, int m22, int m23)
public final void set(AffineTrans a)
a
- Matrix that was copied
java.lang.NullPointerException
- When a is null.public final void set(int[][] a)
a
- 2idimensional array
java.lang.NullPointerException
- When argument a is null. When any element of a[] is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public final void set(int[] a)
a
- 1-dimensional array
java.lang.NullPointerException
- When argument a is null.
java.lang.IllegalArgumentException
- When the number of elements is insufficient.public final Vector3D transPoint(Vector3D v)
transform(com.mascotcapsule.micro3d.v3.Vector3D)
public final Vector3D transform(Vector3D v)
v
- Point vector
java.lang.NullPointerException
- When the number of elements is null.public final void rotationX(int r)
r
- Angle of rotatio. Specifies 4096 divisions of a circle (2*PI is equivalent to 4096).public final void rotationY(int r)
r
- Angle of rotation. Specifies 4096 divisions of a circle (2*PI is equivalent to 4096).public final void rotationZ(int r)
r
- Angle of rotation. Specifies 4096 divisions of a circle (2*PI equivalent to 4096).public final void multiply(AffineTrans a)
mul(AffineTrans)
public final void mul(AffineTrans a)
a
- Matrix
java.lang.NullPointerException
- When argument a is null.public final void multiply(AffineTrans a1, AffineTrans a2)
mul(AffineTrans,AffineTrans)
public final void mul(AffineTrans a1, AffineTrans a2)
a1
- Matrix 1a2
- Matrix 2
java.lang.NullPointerException
- When argument a1 or a2 is null.public final void rotationV(Vector3D v, int r)
setRotation(com.mascotcapsule.micro3d.v3.Vector3D, int)
public final void setRotation(Vector3D v, int r)
v
- Vector
java.lang.NullPointerException
- When the argument is null.public final void setViewTrans(Vector3D pos, Vector3D look, Vector3D up)
lookAt(com.mascotcapsule.micro3d.v3.Vector3D, com.mascotcapsule.micro3d.v3.Vector3D, com.mascotcapsule.micro3d.v3.Vector3D)
public final void lookAt(Vector3D pos, Vector3D look, Vector3D up)
pos
- View position vectorlook
- Reference point vectorup
- Up vector
java.lang.NullPointerException
- When one of the arguments is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |