Class EntityPart

java.lang.Object
me.arcademadness.omni_dungeon.components.EntityPart
All Implemented Interfaces:
Iterable<EntityPart>

public class EntityPart extends Object implements Iterable<EntityPart>
Represents a visual and physical component of an Entity.

Each EntityPart may have a parent (for hierarchical transforms) and children (for multi-part entities such as spiders). If no parent is defined, the part’s position is relative to the Entity’s Location.

  • Constructor Details

    • EntityPart

      public EntityPart(Entity owner)
    • EntityPart

      public EntityPart(Entity owner, @Nullable @Nullable Visual visual)
    • EntityPart

      public EntityPart(Entity owner, @Nullable @Nullable Visual visual, com.badlogic.gdx.math.Rectangle collider)
  • Method Details

    • setParent

      public void setParent(@Nullable @Nullable EntityPart parent)
    • addChild

      public void addChild(EntityPart child)
    • removeChild

      public void removeChild(EntityPart child)
    • getChildren

      public List<EntityPart> getChildren()
    • setLocalPosition

      public void setLocalPosition(float x, float y)
    • getLocalPosition

      public com.badlogic.gdx.math.Vector2 getLocalPosition()
    • setRotation

      public void setRotation(float rotation)
    • getRotation

      public float getRotation()
    • getWorldRotation

      public float getWorldRotation()
    • getWorldX

      public float getWorldX()
    • getWorldY

      public float getWorldY()
    • getTileX

      public float getTileX()
    • getTileY

      public float getTileY()
    • getVisual

      @Nullable public @Nullable Visual getVisual()
    • setVisual

      public void setVisual(@Nullable @Nullable Visual visual)
    • getCollider

      @Nullable public @Nullable com.badlogic.gdx.math.Rectangle getCollider()
    • getColliderCenter

      @Nullable public @Nullable com.badlogic.gdx.math.Vector2 getColliderCenter()
    • setCollider

      public void setCollider(@Nullable @Nullable com.badlogic.gdx.math.Rectangle collider)
    • getOwner

      public Entity getOwner()
    • getParent

      @Nullable public @Nullable EntityPart getParent()
    • forEachPart

      public void forEachPart(Consumer<EntityPart> action)
    • iterator

      public Iterator<EntityPart> iterator()
      Specified by:
      iterator in interface Iterable<EntityPart>