- java.lang.Object
-
- be.yildizgames.module.graphic.misc.Line
-
public abstract class Line extends Object
A 3D line is a line drawn between 2 points.- Author:
- Grégory Van den Borre
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLine()Simple constructor, only to be called by child.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidhide()Set the line invisible on screen.protected abstract voidhideImpl()Set the line invisible in implementation.booleanisVisible()voidsetEndPosition(float x, float y, float z)Set the position of the line last point.voidsetEndPosition(be.yildizgames.common.geometry.Point3D position)Set the position of the line last point.voidsetInitialPosition(be.yildizgames.common.geometry.Point3D position)Set the position of the line first point.voidsetMaterial(Material newMaterial)Change the line material.protected abstract voidsetMaterialImpl(Material newMaterial)Set the new material in implementation.voidsetPositions(be.yildizgames.common.geometry.Point3D originPosition, be.yildizgames.common.geometry.Point3D endPosition)Set the position of the line first and last points.voidshow()Set the line visible on screen.protected abstract voidshowImpl()Set the line visible in implementation.protected abstract voidupdate(float beginX, float beginY, float beginZ, float endX, float endY, float endZ)Update the line in implementation.
-
-
-
Method Detail
-
setInitialPosition
public final void setInitialPosition(be.yildizgames.common.geometry.Point3D position)
Set the position of the line first point.- Parameters:
position- First point coordinates.
-
setEndPosition
public final void setEndPosition(be.yildizgames.common.geometry.Point3D position)
Set the position of the line last point.- Parameters:
position- Last point coordinates.
-
setEndPosition
public final void setEndPosition(float x, float y, float z)Set the position of the line last point.- Parameters:
x- Last point X coordinate.y- Last point Y coordinate.z- Last point Z coordinate.
-
setPositions
public final void setPositions(be.yildizgames.common.geometry.Point3D originPosition, be.yildizgames.common.geometry.Point3D endPosition)Set the position of the line first and last points.- Parameters:
originPosition- First point coordinates, copy, modifying from outside wont affect the line.endPosition- Last point coordinates, copy, modifying from outside wont affect the line.
-
show
public final void show()
Set the line visible on screen.
-
hide
public final void hide()
Set the line invisible on screen.
-
setMaterial
public final void setMaterial(Material newMaterial)
Change the line material.- Parameters:
newMaterial- New Material to affect to the line.
-
update
protected abstract void update(float beginX, float beginY, float beginZ, float endX, float endY, float endZ)Update the line in implementation.- Parameters:
beginX- First point X coordinate.beginY- First point Y coordinate.beginZ- First point Z coordinate.endX- Last point X coordinate.endY- Last point Y coordinate.endZ- Last point Z coordinate.
-
hideImpl
protected abstract void hideImpl()
Set the line invisible in implementation.
-
showImpl
protected abstract void showImpl()
Set the line visible in implementation.
-
setMaterialImpl
protected abstract void setMaterialImpl(Material newMaterial)
Set the new material in implementation.- Parameters:
newMaterial- New material to affect.
-
isVisible
public final boolean isVisible()
- Returns:
trueif the line is visible,falseotherwise.
-
-