|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmr3d.debug.ErrorHandling
mr3d.lang.TriangleBased3DObject
Representation of a 3D object as a composition of a number
of Triangle3D objects.
| Field Summary | |
int |
firstPAI
Stores where in the PointArrayTable the object
points can be found. |
int |
lastPAI
Stores where in the PointArrayTable the object
points can be found. |
(package private) java.util.Vector |
planes
Vector containing all triangles of the 3D object. |
private boolean |
recalculate
Internal boolean to avoid uneccessary recalculations. |
(package private) Vector3D |
rotVector
Keeps track of the objects movements in respects of translation or rotation. |
(package private) Vector3D |
scaleVector
Skale factor of the object. |
(package private) Vector3D |
transVector
Keeps track of the objects movements in respects of translation or rotation. |
private boolean |
visibilityBit
Visibility bit. |
| Fields inherited from class mr3d.debug.ErrorHandling |
|
| Fields inherited from interface mr3d.debug.Debugable |
ERROR_INT, ERROR_STRING |
| Constructor Summary | |
TriangleBased3DObject()
Creates a new TriangleBased3DObject |
|
| Method Summary | |
void |
addPlane(Triangle3D newTriangle)
Adds a new plane (triangle) to the plane vector. |
Triangle3D |
getPlane(int index)
Returns the triangle object at the specified index in the planes field. |
boolean |
isVisible()
Determines if the object is visible or not. |
void |
move(int x,
int y,
int z)
Moves the object for the specified values in each direction. |
void |
move(Vector3D relcoords)
Moves the object for the specified values in each direction. |
void |
moveNulltoReferencePoint(Vector3D referencePointCoords)
Moves the object coordinate systems null point to the point specified in the vector referencePointCoords.
|
void |
moveTo(int x,
int y,
int z)
Moves the objects to the specified coordinates in the way that the object coordinate null point is in the specified world-coordinate position. |
void |
moveTo(Vector3D newPos)
Moves the objects to the specified coordinates. |
Vector3D |
objectPosition()
Returns the object position in world coordinates. |
void |
recalculate()
recalculates the position of all points and all plane normals of the object according to the current rotation and rotation settings. |
void |
redefine(Vector3D refpoint,
Vector3D transvec,
Vector3D rotvec)
Moves the obejct in the object coordinate system. |
void |
reset()
Resets the object to its initial values. |
void |
rotate(int x,
int y,
int z)
Rotates the object about the center of the object coordinate system relatively to its current positon. |
void |
rotate(Vector3D relcoords)
Rotates the object about the center of the object coordinate system. |
void |
rotateAround(Vector3D rotationPointCoords,
Vector3D rotationAngles)
Rotates the object around a point other than the object coordinate null point. |
void |
rotateTo(int x,
int y,
int z)
Rotates the object about the center of the object coordinate system to the specified angles. |
void |
rotateTo(Vector3D absVector)
Rotates the object about the center of the object coordinate system to the specified angles. |
Vector3D |
rotVector()
Returns the rotation vector of the object.. |
void |
scale(int x,
int y,
int z)
Sets the scalation of the object. |
void |
setVisibility(boolean toggleVis)
Affects the visibilty of the object. |
int |
size()
Returns the triangles in the planes field. |
void |
toConsole()
Prints the contents of the object to the Java console. |
void |
toConsole(java.lang.String msgString)
Prints the contents of the object to the Java console together with an information string. |
void |
transform(Matrix transMat)
Transforms the points objects. |
| Methods inherited from class mr3d.debug.ErrorHandling |
getErrMsg, notifyError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int firstPAI
PointArrayTable the object
points can be found.
public int lastPAI
PointArrayTable the object
points can be found.
java.util.Vector planes
private boolean recalculate
Vector3D rotVector
Vector3D scaleVector
Vector3D transVector
private boolean visibilityBit
true the object is visible,
if false object is invisible.
| Constructor Detail |
public TriangleBased3DObject()
TriangleBased3DObject
| Method Detail |
public void addPlane(Triangle3D newTriangle)
newTriangle - the triangle object to be added to the
plane vectorpublic Triangle3D getPlane(int index)
index - index of the plane in the object vector
public boolean isVisible()
true if the object is visible,
false if object is invisible.
public void move(int x,
int y,
int z)
x - move for specified number of units into the
direction of the x-axisy - move for specified number of units into the
direction of the y-axisz - move for specified number of units into the
direction of the z-axispublic void move(Vector3D relcoords)
relcoords - move the objects for the coordinates specifiedpublic void moveNulltoReferencePoint(Vector3D referencePointCoords)
referencePointCoords.
Those coordinates are specifications in the current object
coordinate system.
referencePointCoords - object coordinates of new reference point
public void moveTo(int x,
int y,
int z)
x - x-coordinate of the destination pointy - y-coordinate of the destination pointz - z-coordinate of the destination pointpublic void moveTo(Vector3D newPos)
newPos - contains the coordinates of the destination pointpublic Vector3D objectPosition()
public void recalculate()
public void redefine(Vector3D refpoint,
Vector3D transvec,
Vector3D rotvec)
refpoint - the new reference point (center of rotation)
in object coordinatestransvec - changes object position relative to its
current positionrotvec - changes the object rotation relative to its
current rotationpublic void reset()
public void rotate(int x,
int y,
int z)
x - angle for rotation about the x-axisy - angle for rotation about the y-axisz - angle for rotation about the z-axispublic void rotate(Vector3D relcoords)
relcoords - contains the angles of the object rotation
public void rotateAround(Vector3D rotationPointCoords,
Vector3D rotationAngles)
rotationPointCoords - coordinates of center of rotationrotationAngles - angles the object should be rotated
public void rotateTo(int x,
int y,
int z)
x - angle for rotation about the x-axisy - angle for rotation about the y-axisz - angle for rotation about the z-axispublic void rotateTo(Vector3D absVector)
absVector - angles for rotation about the x-, y-
and z-axis in a 3d-vectorpublic Vector3D rotVector()
public void scale(int x,
int y,
int z)
x - scalation in x-directiony - scalation in x-directionz - scalation in x-directionpublic void setVisibility(boolean toggleVis)
toggleVis - true for visibility and
false for invisibilitypublic int size()
public void toConsole()
Debugable
toConsole in interface Debugablepublic void toConsole(java.lang.String msgString)
Debugable
toConsole in interface Debugablepublic void transform(Matrix transMat)
transform in interface TransformabletransMat - transformation matrix
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||