Class GraphNode

java.lang.Object
gaiasky.scene.component.GraphNode
All Implemented Interfaces:
com.badlogic.ashley.core.Component, ICopy

public class GraphNode extends Object implements com.badlogic.ashley.core.Component, ICopy
  • Field Details

    • positionUpdaterConsumer

      public Consumers.Consumer3<GraphUpdater,com.badlogic.ashley.core.Entity,GraphNode> positionUpdaterConsumer
      Reference to the method to update the position of this object.
    • mustUpdateFunction

      public Functions.Function3<GraphUpdater,com.badlogic.ashley.core.Entity,GraphNode,Boolean> mustUpdateFunction
      Reference to the function that returns whether this object must be updated.
    • parentName

      public String parentName
      The first name of the parent object.
    • parent

      public com.badlogic.ashley.core.Entity parent
      The parent entity.
    • children

      public com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> children
      List of children entities.
    • translation

      public Vector3b translation
      Cumulative translation object. In contrast with the position, which contains the position relative to the parent, this contains the absolute position in the internal reference system.
    • localTransform

      public com.badlogic.gdx.math.Matrix4 localTransform
      Local transform matrix. Contains the transform matrix and the transformations that will be applied to this object and not to its children.
    • orientation

      public Matrix4d orientation
      This transform stores only the orientation of the object. For example in planets, it stores their orientation with respect to their equatorial plane, but not other transformations applied to the object such as the size or the rotation angle at the time.
    • numChildren

      public int numChildren
      The total number of descendants under this node.
  • Constructor Details

    • GraphNode

      public GraphNode()
  • Method Details

    • setParent

      public void setParent(String parentName)
      Sets the name of the parent.
      Parameters:
      parentName - The parent name.
    • getSceneGraphDepth

      public int getSceneGraphDepth()
    • initChildren

      public void initChildren(int size)
    • addChild

      public final void addChild(com.badlogic.ashley.core.Entity me, com.badlogic.ashley.core.Entity child, boolean updateAncestorCount, int numChildren)
      Adds a child to the given node and updates the number of children in this entity and in all ancestors.
      Parameters:
      me - The current entity that owns this graph node.
      child - The child entity to add.
      updateAncestorCount - Whether to update the ancestors number of children.
      numChildren - The number of children this will hold.
    • removeChild

      public final void removeChild(com.badlogic.ashley.core.Entity child, boolean updateAncestorCount)
      Removes the given child from this node, if it exists.
      Parameters:
      child - The child node to remove.
      updateAncestorCount - Whether to update the ancestors number of children.
    • getRoot

      public com.badlogic.ashley.core.Entity getRoot(com.badlogic.ashley.core.Entity me)
    • getCopy

      public com.badlogic.ashley.core.Component getCopy(com.badlogic.ashley.core.Engine engine)
      Specified by:
      getCopy in interface ICopy
    • getChildByName

      public com.badlogic.ashley.core.Entity getChildByName(String name)