Class KeyframesPathObject

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, I3DTextRenderable, IGPUVertsRenderable, ILineRenderable, IPointRenderable, IRenderable, IStarContainer, IVisibilitySwitch, IPosition

public class KeyframesPathObject extends VertsObject implements I3DTextRenderable, ILineRenderable, IPointRenderable
  • Field Details

    • keyframes

      public com.badlogic.gdx.utils.Array<Keyframe> keyframes
      Keyframe objects
    • selected

      public Keyframe selected
      Selected keyframe
    • highlighted

      public Keyframe highlighted
      Highlighted keyframe
    • path

      public VertsObject path
      The actual path
    • segments

      public VertsObject segments
      The segments joining the knots
    • knots

      public VertsObject knots
      The knots, or keyframe positions
    • knotsSeam

      public VertsObject knotsSeam
      Knots which are also seams
    • selectedKnot

      public VertsObject selectedKnot
      Selected knot
    • highlightedKnot

      public VertsObject highlightedKnot
      Highlighted knot
    • orientations

      public com.badlogic.gdx.utils.Array<VertsObject> orientations
      Contains pairs of {direction, up} representing the orientation at each knot
  • Constructor Details

    • KeyframesPathObject

      public KeyframesPathObject()
  • Method Details

    • initialize

      public void initialize()
      Overrides:
      initialize in class SceneGraphNode
    • setKeyframes

      public void setKeyframes(com.badlogic.gdx.utils.Array<Keyframe> keyframes)
    • refreshData

      public void refreshData()
      Refreshes the positions and orientations from the keyframes
    • refreshOrientations

      public void refreshOrientations()
      Refreshes the orientations from the keyframes
    • refreshSingleVector

      public void refreshSingleVector(VertsObject vo, Vector3d pos, Vector3d vec)
    • resamplePath

      public void resamplePath()
    • setPathKnots

      public void setPathKnots(double[] kts, double[] dirs, double[] ups, boolean[] seams)
    • addKnot

      public void addKnot(Vector3d knot, Vector3d dir, Vector3d up, boolean seam)
    • update

      public void update(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera, float opacity)
      Overrides:
      update in class SceneGraphNode
    • select

      public IFocus select(int screenX, int screenY, int minPixDist, NaturalCamera camera)
    • checkClickDistance

      protected boolean checkClickDistance(int screenX, int screenY, com.badlogic.gdx.math.Vector3 pos, NaturalCamera camera, com.badlogic.gdx.graphics.PerspectiveCamera pcamera, double pixelSize)
    • highlight

      public void highlight(Keyframe kf)
    • unhighlight

      public void unhighlight(Keyframe kf)
    • unhighlight

      public void unhighlight()
    • select

      public void select(Keyframe kf)
    • unselect

      public void unselect()
    • isSelected

      public boolean isSelected()
    • moveSelection

      public boolean moveSelection(int screenX, int screenY, NaturalCamera camera)
    • rotateAroundDir

      public boolean rotateAroundDir(double dx, double dy, NaturalCamera camera)
    • rotateAroundUp

      public boolean rotateAroundUp(double dx, double dy, NaturalCamera camera)
    • rotateAroundCrs

      public boolean rotateAroundCrs(double dx, double dy, NaturalCamera 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 VertsObject
    • clear

      public void clear()
      Description copied from class: VertsObject
      Clears the data from this object, both in RAM and VRAM
      Overrides:
      clear in class VertsObject
    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class VertsObject
    • clearOrientations

      public void clearOrientations()
    • 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
    • render

      public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera)
      Label render
      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
    • 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
    • textColour

      public float[] textColour(Keyframe kf)
    • 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
    • getTextPosition

      public void getTextPosition(ICamera cam, Vector3d out, Keyframe kf)
    • text

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

      public String getText(Keyframe kf)
    • 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
    • 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(PointRenderSystem renderer, ICamera camera, float alpha)
      Specified by:
      render in interface IPointRenderable
    • getGlPrimitive

      public int getGlPrimitive()
      Specified by:
      getGlPrimitive in interface IGPUVertsRenderable
      Specified by:
      getGlPrimitive in interface ILineRenderable
      Overrides:
      getGlPrimitive in class VertsObject