Class AbstractOctreeWrapper

java.lang.Object
gaiasky.scenegraph.SceneGraphNode
gaiasky.scenegraph.FadeNode
gaiasky.scenegraph.octreewrapper.AbstractOctreeWrapper
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IStarContainer, IVisibilitySwitch, IPosition, Iterable<OctreeNode>
Direct Known Subclasses:
OctreeWrapper

public abstract class AbstractOctreeWrapper extends FadeNode implements Iterable<OctreeNode>
Abstract Octree wrapper with the common parts of the regular Octree wrapper and the concurrent one
  • Field Details

    • root

      public OctreeNode root
    • roulette

      protected List<SceneGraphNode> roulette
      Roulette list with the objects to process
    • parenthood

      public Map<SceneGraphNode,​OctreeNode> parenthood
    • lastNumberObjects

      protected int lastNumberObjects
      The number of objects added to render in the last frame
    • copy

      protected boolean copy
      Is this just a copy?
  • Constructor Details

    • AbstractOctreeWrapper

      protected AbstractOctreeWrapper()
    • AbstractOctreeWrapper

      protected AbstractOctreeWrapper(String parentName, OctreeNode root)
  • Method Details

    • initialize

      public void initialize()
      An octree wrapper has as 'scene graph children' all the elements contained in the octree, even though it acts as a hub that decides which are processed and which are not.
      Overrides:
      initialize in class SceneGraphNode
    • containsObject

      public boolean containsObject(SceneGraphNode object)
    • add

      public void add(List<SceneGraphNode> children, OctreeNode octant)
    • add

      public void add(SceneGraphNode child, OctreeNode octant)
    • removeParenthood

      public void removeParenthood(SceneGraphNode child)
    • updateLocal

      public void updateLocal(ITimeFrameProvider time, ICamera camera)
      Description copied from class: SceneGraphNode
      Updates the transform matrix with the transformations that will apply to the children and the local transform matrix with the transformations that will apply only to this object.
      Overrides:
      updateLocal in class FadeNode
    • updateOctreeObjects

      protected abstract void updateOctreeObjects(ITimeFrameProvider time, Vector3b parentTransform, ICamera camera)
      Runs the update on all the observed and selected octree objects.
      Parameters:
      time -
      parentTransform -
      camera -
    • addToRenderLists

      public void addToRenderLists(ICamera camera, OctreeNode octant)
    • iterator

      public Iterator<OctreeNode> iterator()
      Specified by:
      iterator in interface Iterable<OctreeNode>
    • getStarCount

      public int getStarCount()
      Specified by:
      getStarCount in interface IStarContainer
      Overrides:
      getStarCount in class SceneGraphNode
    • highlight

      public void highlight(boolean hl, float[] color, boolean allVisible)
      Description copied from class: FadeNode
      Highlight using a plain color
      Overrides:
      highlight in class FadeNode
      Parameters:
      hl - Whether to highlight
      color - The plain color
      allVisible - All visible
    • highlight

      public void highlight(boolean hl, int cmi, IAttribute cma, double cmmin, double cmmax, boolean allVisible)
      Description copied from class: FadeNode
      Highlight using a colormap
      Overrides:
      highlight in class FadeNode
      Parameters:
      hl - Whether to highlight
      cmi - Color map index
      cma - Color map attribute
      cmmin - Min mapping value
      cmmax - Max mapping value
    • getSimpleCopy

      public <T extends SceneGraphNode> T getSimpleCopy()
      Gets a copy of this object but does not copy its parent or children
      Overrides:
      getSimpleCopy in class SceneGraphNode
      Returns:
      The copied object
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class SceneGraphNode