Class CosmicRuler

java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.CosmicRuler
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IObserver, I3DTextRenderable, ILineRenderable, IRenderable, IStarContainer, IVisibilitySwitch, IPosition

public class CosmicRuler extends SceneGraphNode implements I3DTextRenderable, ILineRenderable, IObserver
Cosmic ruler between two objects
  • Constructor Details

    • CosmicRuler

      public CosmicRuler()
    • CosmicRuler

      public CosmicRuler(String name0, String name1)
  • Method Details

    • getLineWidth

      public float getLineWidth()
      Specified by:
      getLineWidth in interface ILineRenderable
    • render

      public void render(LineRenderSystem renderer, ICamera camera, float alpha)
      Specified by:
      render in interface ILineRenderable
    • render

      public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
      Description copied from interface: I3DTextRenderable
      Renders the text
      Specified by:
      render in interface I3DTextRenderable
      Parameters:
      batch - The sprite batch
      shader - The shader
      sys - The font render system
      rc - The render context
      camera - The camera
    • addToRenderLists

      protected void addToRenderLists(ICamera camera)
      Description copied from class: SceneGraphNode
      Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.
      Overrides:
      addToRenderLists in class SceneGraphNode
    • updateLocalValues

      public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
      Description copied from class: SceneGraphNode
      This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.
      Overrides:
      updateLocalValues in class SceneGraphNode
    • getName0

      public String getName0()
    • setName0

      public void setName0(String name0)
    • getName1

      public String getName1()
    • setName1

      public void setName1(String name1)
    • rulerOk

      public boolean rulerOk()
    • hasAttached

      public boolean hasAttached()
      Returns true if the ruler is attached to at least one object.
      Returns:
      Ture if the ruler is attached.
    • hasObject0

      public boolean hasObject0()
    • hasObject1

      public boolean hasObject1()
    • renderText

      public boolean renderText()
      Description copied from interface: I3DTextRenderable
      Tells whether the text must be rendered or not for this entity
      Specified by:
      renderText in interface I3DTextRenderable
      Returns:
      True if text must be rendered
    • textColour

      public float[] textColour()
      Description copied from interface: I3DTextRenderable
      Returns an array with the text colour in the fashion [r, g, b, a]
      Specified by:
      textColour in interface I3DTextRenderable
      Returns:
      Array with the colour
    • textSize

      public float textSize()
      Description copied from interface: I3DTextRenderable
      Returns the text size
      Specified by:
      textSize in interface I3DTextRenderable
      Returns:
      The text size
    • textScale

      public float textScale()
      Description copied from interface: I3DTextRenderable
      Returns the text scale for the scale varying in the shader
      Specified by:
      textScale in interface I3DTextRenderable
      Returns:
      The scale
    • textPosition

      public void textPosition(ICamera cam, Vector3d out)
      Description copied from interface: I3DTextRenderable
      Sets the position of this text in the out vector
      Specified by:
      textPosition in interface I3DTextRenderable
      out - The out parameter with the result
    • text

      public String text()
      Description copied from interface: I3DTextRenderable
      Returns the text
      Specified by:
      text in interface I3DTextRenderable
      Returns:
      The text
    • textDepthBuffer

      public void textDepthBuffer()
      Description copied from interface: I3DTextRenderable
      Executes the blending for the text
      Specified by:
      textDepthBuffer in interface I3DTextRenderable
    • isLabel

      public boolean isLabel()
      Description copied from interface: I3DTextRenderable
      Is it a label or another kind of text?
      Specified by:
      isLabel in interface I3DTextRenderable
      Returns:
      Whether this is a label
    • getTextOpacity

      public float getTextOpacity()
      Description copied from interface: I3DTextRenderable
      Gets the text opacity
      Specified by:
      getTextOpacity in interface I3DTextRenderable
      Returns:
      Text opacity
    • notify

      public void notify(Events event, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      data - The data associated with this event.
    • getGlPrimitive

      public int getGlPrimitive()
      Specified by:
      getGlPrimitive in interface ILineRenderable