|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--nl.kun.Engine3D.TVector3D
|
+--nl.kun.Engine3D.TCoordSys3D
|
+--nl.kun.Engine3D.TEntity3D
|
+--nl.kun.Engine3D.TEntityList3D
This class defines a list of 3D entity's, with it's own coordinate systems. All composite 3D objects are derived from this class.
| Field Summary | |
double |
depth
The depth of this object. |
protected int[] |
index
List with all the ID numbers for the TEntity3D's used in Z sorting |
protected int |
MaxBuf
Number of (for the camera) vissible Entity3D's |
(package private) static int |
MAXOBJECTS
Maximum number of objects in a ObjectList (default 1000) |
java.util.Vector |
ObjectList
Vector object in which TEntity3D's can be stored. |
int |
size
The length of the ObjectList |
| Fields inherited from class nl.kun.Engine3D.TEntity3D |
color,
GlobalCords,
ParentGlobalCords,
Vissible |
| Fields inherited from class nl.kun.Engine3D.TCoordSys3D |
Xaxis,
Yaxis,
Zaxis |
| Fields inherited from class nl.kun.Engine3D.TVector3D |
DBSCIENTIFIC,
DBSTANDARD,
x,
y,
z |
| Constructor Summary | |
TEntityList3D()
Empty constructor of this 3D Entity. |
|
TEntityList3D(double _x,
double _y,
double _z,
double _xax,
double _xay,
double _xaz,
double _yax,
double _yay,
double _yaz,
double _zax,
double _zay,
double _zaz)
Constructor |
|
TEntityList3D(TEntityList3D _EntList)
Copy constructor. |
|
TEntityList3D(TVector3D _posVec,
TVector3D _Xaxis,
TVector3D _Yaxis,
TVector3D _Zaxis)
Constructor. |
|
| Method Summary | |
void |
Append(TEntity3D _ent)
Routine used to append a TEntity3D object to the ObjectList. |
void |
Clear()
Routine to remove all objects from the ObjectList |
double |
Depth(TCamera3D _cam)
This routine prerenders the objects and calculates the distances from the object to the camera (depth). |
void |
Draw(TCamera3D _cam,
Viewport _Viewport)
Draws the vissible parts of this object onto the viewport, as if it where projecting itself on a camera. |
void |
InheritGlobalCords(TCoordSys3D _parent)
Inherits the global coordinates of it's parent, and adjusts it's own global coordinates if the local coordinate system is changed. |
void |
Insert(TEntity3D _ent,
int _pos)
Routine used to insert a TEntity3D object in the ObjectList. |
void |
Remove(int _pos)
Routine used to remove a TEntity3D object from the ObjectList.
|
void |
Remove(TEntity3D _ent)
Routine used to remove a TEntity3D object from the ObjectList.
|
void |
Rotate(TVector3D _PosVec,
TVector3D _DirVec,
double _angle)
Rotates the object around the line determined by the position vector _PosVec and the direction vector _DirVec by
an amount _angle |
void |
Sort(double[] _Zbuffer,
int[] _index,
int l,
int r)
Sort routine that uses FastQuickSort for lists longer than 4, else it uses InsertionSort |
TVector3D |
Translate(double _dx,
double _dy,
double _dz)
Translates the coordinate system of this object. |
TVector3D |
Translate(TVector3D _dr)
Translates the coordinate system of this object. |
| Methods inherited from class nl.kun.Engine3D.TEntity3D |
Vector3D,
Vector3D |
| Methods inherited from class nl.kun.Engine3D.TCoordSys3D |
CoordSys3D,
CoordSys3D,
CoordSys3D,
Global2Local,
Global2Local,
Global2Local,
Local2Global,
Local2Global,
Local2Global,
toString |
| Methods inherited from class nl.kun.Engine3D.TVector3D |
Angle,
Double2String,
Double2String,
Modulus,
Modulus,
Negate,
Negate,
Normalize,
Normalize,
NulVec,
StdXaxis,
StdYaxis,
StdZaxis,
String2Double,
VAdd,
VCrossProduct,
VCrossProduct,
VDotProduct,
Vector3D,
VPerpendicular,
VPerpendicular,
VScalarProduct,
VScalarProduct,
VScalarProduct,
VSubstract,
VSubstract |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public java.util.Vector ObjectList
TEntity3D's can be stored. Can grow and shrink dynamicallypublic double depth
TEntity3D.Depth(TCamera3D)public int size
ObjectListprotected int MaxBuf
Entity3D'sprotected int[] index
TEntity3D's used in Z sortingstatic int MAXOBJECTS
ObjectList (default 1000)| Constructor Detail |
public TEntityList3D(double _x,
double _y,
double _z,
double _xax,
double _xay,
double _xaz,
double _yax,
double _yay,
double _yaz,
double _zax,
double _zay,
double _zaz)
_x - the x-value of the origin vector_y - the y-value of the origin vector_z - the z-value of the origin vector_xax - the x-value of the x-axis vector_xay - the y-value of the x-axis vector_xaz - the z-value of the x-axis vector_yax - the x-value of the y-axis vector_yay - the y-value of the y-axis vector_yaz - the z-value of the y-axis vector_zax - the x-value of the z-axis vector_zay - the y-value of the z-axis vector_zaz - the z-value of the z-axis vector
public TEntityList3D(TVector3D _posVec,
TVector3D _Xaxis,
TVector3D _Yaxis,
TVector3D _Zaxis)
_posVec - The origin vector_Xaxis - The x-axis vector_Yaxis - The y-axis vector_Zaxis - The z-axis vectorpublic TEntityList3D()
public TEntityList3D(TEntityList3D _EntList)
_EntList - Object that needs to be copied into this object.| Method Detail |
public void Append(TEntity3D _ent)
TEntity3D object to the ObjectList._ent - Entity to be appended.public void Remove(TEntity3D _ent)
TEntity3D object from the ObjectList.
Use this routine when you do not know the position in the list._ent - Entity to be removedpublic void Remove(int _pos)
TEntity3D object from the ObjectList.
Use this routine if you do know the position in the list_pos - Position of the Entity in the list.
public void Insert(TEntity3D _ent,
int _pos)
TEntity3D object in the ObjectList._ent - Entity to be inserted_pos - Insertion position.public void Clear()
ObjectList
public void Draw(TCamera3D _cam,
Viewport _Viewport)
_cam - The camera._Viewport - Viewport object. This viewport object handles clipping
and transformation of real world coordinates to screen coordinates.
It does the real drawing on the screen.TCamera3D,
Viewportpublic double Depth(TCamera3D _cam)
TEntityList3D object to sort all TEntity3D's
according to depth._cam - The camera.
public void Sort(double[] _Zbuffer,
int[] _index,
int l,
int r)
_Zbuffer - The list of values to be sorted_index - The index numbers belonging to the values in _Zbuffer. Will be sorted by _Zbufferl - left index in array to start sorting.r - right index in array to start sorting.
public TVector3D Translate(double _dx,
double _dy,
double _dz)
_dx - displacement in x direction_dy - displacement in y direction_dz - displacement in z directionpublic TVector3D Translate(TVector3D _dr)
_dr - Displacement vector.
public void Rotate(TVector3D _PosVec,
TVector3D _DirVec,
double _angle)
_PosVec and the direction vector _DirVec by
an amount _angle_PosVec - Position vector of the line around which should be rotated_DirVec - Direction vector of the line around which should be rotated_angle - Amount of rotation in radians.public void InheritGlobalCords(TCoordSys3D _parent)
_Parent - The parent coordinate system.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||