Class 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
      protected Line()
      Simple constructor, only to be called by child.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void hide()
      Set the line invisible on screen.
      protected abstract void hideImpl()
      Set the line invisible in implementation.
      boolean isVisible()  
      void setEndPosition​(float x, float y, float z)
      Set the position of the line last point.
      void setEndPosition​(be.yildizgames.common.geometry.Point3D position)
      Set the position of the line last point.
      void setInitialPosition​(be.yildizgames.common.geometry.Point3D position)
      Set the position of the line first point.
      void setMaterial​(Material newMaterial)
      Change the line material.
      protected abstract void setMaterialImpl​(Material newMaterial)
      Set the new material in implementation.
      void setPositions​(be.yildizgames.common.geometry.Point3D originPosition, be.yildizgames.common.geometry.Point3D endPosition)
      Set the position of the line first and last points.
      void show()
      Set the line visible on screen.
      protected abstract void showImpl()
      Set the line visible in implementation.
      protected abstract void update​(float beginX, float beginY, float beginZ, float endX, float endY, float endZ)
      Update the line in implementation.
    • Constructor Detail

      • Line

        protected Line()
        Simple constructor, only to be called by child.
    • 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:
        true if the line is visible, false otherwise.