Class GraphUpdater

java.lang.Object
com.badlogic.ashley.core.EntitySystem
com.badlogic.ashley.systems.IteratingSystem
gaiasky.scene.system.update.AbstractUpdateSystem
gaiasky.scene.system.update.GraphUpdater
All Implemented Interfaces:
EntityUpdater

public class GraphUpdater extends AbstractUpdateSystem
  • Field Summary

    Fields inherited from class com.badlogic.ashley.core.EntitySystem

    priority
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphUpdater(com.badlogic.ashley.core.Family family, int priority, ITimeFrameProvider time)
    Instantiates a system that will iterate over the entities described by the Family.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected float
     
    protected long
     
    boolean
    mustUpdateLoc(com.badlogic.ashley.core.Entity entity, GraphNode graph)
    This function quickly discards locations when the Locations component type is off or when the solid angle of the parent is too small.
    boolean
    mustUpdatePerimeter(com.badlogic.ashley.core.Entity entity, GraphNode graph)
    This function quickly discards perimeters when the Countries component type is off.
    void
    printTree(com.badlogic.ashley.core.Entity entity, String tab, int level, AtomicInteger count)
     
    protected void
    processEntity(com.badlogic.ashley.core.Entity entity, float deltaTime)
     
    void
     
    void
    update(com.badlogic.ashley.core.Entity entity, ITimeFrameProvider time, Vector3b parentTranslation, float opacity)
     
    void
    updateEntity(com.badlogic.ashley.core.Entity entity, float deltaTime)
    Updates the entity.
    void
    updatePositionDefault(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
    General method to update the position of an entity.
    void
    updatePositionLocationMark(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
     
    void
    updateShapeObject(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
    Method to update the position of a shape object.
    void
    updateSpacecraft(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
    Method to update the position of a spacecraft.

    Methods inherited from class com.badlogic.ashley.systems.IteratingSystem

    addedToEngine, getEntities, getFamily, removedFromEngine, update

    Methods inherited from class com.badlogic.ashley.core.EntitySystem

    checkProcessing, getEngine, setProcessing

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface gaiasky.scene.system.update.EntityUpdater

    getFamily
  • Constructor Details

    • GraphUpdater

      public GraphUpdater(com.badlogic.ashley.core.Family family, int priority, ITimeFrameProvider time)
      Instantiates a system that will iterate over the entities described by the Family.
      Parameters:
      family - The family of entities iterated over in this System. In this case, it should be just one (GraphRoot.
  • Method Details

    • setCamera

      public void setCamera(ICamera camera)
    • processEntity

      protected void processEntity(com.badlogic.ashley.core.Entity entity, float deltaTime)
      Specified by:
      processEntity in class com.badlogic.ashley.systems.IteratingSystem
    • updateEntity

      public void updateEntity(com.badlogic.ashley.core.Entity entity, float deltaTime)
      Description copied from interface: EntityUpdater
      Updates the entity.
      Parameters:
      entity - The entity to update.
      deltaTime - The delta time since last frame.
    • printTree

      public void printTree(com.badlogic.ashley.core.Entity entity, String tab, int level, AtomicInteger count)
    • update

      public void update(com.badlogic.ashley.core.Entity entity, ITimeFrameProvider time, Vector3b parentTranslation, float opacity)
    • getVisibilityOpacityFactor

      protected float getVisibilityOpacityFactor(Base base)
    • msSinceStateChange

      protected long msSinceStateChange(Base base)
    • mustUpdatePerimeter

      public boolean mustUpdatePerimeter(com.badlogic.ashley.core.Entity entity, GraphNode graph)
      This function quickly discards perimeters when the Countries component type is off.
      Parameters:
      entity - The entity.
      graph - The graph component.
      Returns:
      Whether the perimeter must be processed.
    • mustUpdateLoc

      public boolean mustUpdateLoc(com.badlogic.ashley.core.Entity entity, GraphNode graph)
      This function quickly discards locations when the Locations component type is off or when the solid angle of the parent is too small.
      Parameters:
      entity - The entity.
      graph - The graph component.
      Returns:
      Whether the perimeter must be processed.
    • updatePositionDefault

      public void updatePositionDefault(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
      General method to update the position of an entity.
      Parameters:
      entity - The entity to update.
      body - The body component.
      graph - The graph component.
    • updatePositionLocationMark

      public void updatePositionLocationMark(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
    • updateShapeObject

      public void updateShapeObject(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
      Method to update the position of a shape object.
      Parameters:
      entity - The entity to update.
      body - The body component.
      graph - The graph component.
    • updateSpacecraft

      public void updateSpacecraft(com.badlogic.ashley.core.Entity entity, Body body, GraphNode graph)
      Method to update the position of a spacecraft.
      Parameters:
      entity - The entity to update.
      body - The body component.
      graph - The graph component.