nl.kun.Engine3D
Class TLine2D
java.lang.Object
|
+--nl.kun.Engine3D.TVector3D
|
+--nl.kun.Engine3D.TCoordSys3D
|
+--nl.kun.Engine3D.TEntity3D
|
+--nl.kun.Engine3D.TLine2D
- public class TLine2D
- extends TEntity3D
This class defines a line at z=0. It is an object optimized to be
positioned on the x-y plane at z=0. The projections on the camera are thus faster for this
object.
Constructor Summary |
TLine2D()
Empty constructor. |
TLine2D(double _x1,
double _y1,
double _x2,
double _y2,
java.awt.Color _cl)
Constructor. |
Method Summary |
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. |
double |
Length()
Length of this line |
TLine2D |
Line2D(double _x1,
double _y1,
double _x2,
double _y2)
A routines that does the same as a constructor, only the object is not newed.
|
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 |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
TLine2D
public TLine2D(double _x1,
double _y1,
double _x2,
double _y2,
java.awt.Color _cl)
- Constructor.
- Parameters:
_x1
- the x position of the first point of the 2D line_y1
- the y position of the first point of the 2D line_x2
- the x position of the second point of the 2D line_y2
- the y position of the second point of the 2D line_cl
- the color of the line.
TLine2D
public TLine2D()
- Empty constructor. Defines a black line starting at (0,0,0) ending at (1,0,0)
Line2D
public TLine2D Line2D(double _x1,
double _y1,
double _x2,
double _y2)
- A routines that does the same as a constructor, only the object is not newed.
Can be used to change the contents of the object without constructing it again.
- Parameters:
_x1
- the x position of the first point of the 2D line_y1
- the y position of the first point of the 2D line_x2
- the x position of the second point of the 2D line_y2
- the y position of the second point of the 2D line
Depth
public double Depth(TCamera3D _cam)
- Description copied from class: TEntity3D
- This routine prerenders the objects and calculates the distances from the object to the camera (depth).
If more than one 3D object is inside this object, it returns the average depth. This depth can be used by a
a parent
TEntityList3D
object to sort all TEntity3D
's
according to depth.
- Overrides:
- Depth in class TEntity3D
- Tags copied from class: TEntity3D
- Parameters:
_cam
- The camera.
Draw
public void Draw(TCamera3D _cam,
Viewport _Viewport)
- Description copied from class: TEntity3D
- Draws the vissible parts of this object onto the viewport, as if it where projecting itself on a camera.
- Overrides:
- Draw in class TEntity3D
- Tags copied from class: TEntity3D
- Parameters:
_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.- See Also:
TCamera3D
,
Viewport
Length
public double Length()
- Length of this line
InheritGlobalCords
public void InheritGlobalCords(TCoordSys3D _Parent)
- Description copied from class: TEntity3D
- Inherits the global coordinates of it's parent, and adjusts it's own global coordinates if the local coordinate system is changed.
- Overrides:
- InheritGlobalCords in class TEntity3D
- Tags copied from class: TEntity3D
- Parameters:
_Parent
- The parent coordinate system.