Interface ColliderShape<T extends Shape>

Type Parameters:
T - the type of Shape
All Known Implementing Classes:
ColliderShapeAABB, ColliderShapeCircle, ColliderShapeTriangle

@NullMarked public interface ColliderShape<T extends Shape>
ColliderShape contains methods and data needed for geometric Shapes for collision calculations.
  • Method Details

    • type

      ColliderType type()
      Gets the ColliderType of this collider.
      Returns:
      the ColliderType of this collider
    • getBoundingBox

      Rectangle getBoundingBox(TransformComponent transformComponent, float offsetX, float offsetY)
      Returns the bounding box for this ColliderShape.
      Parameters:
      transformComponent - the TransformComponent of the entity
      offsetX - the x offset of the collider
      offsetY - the y offset of the collider
      Returns:
      the bounding box
    • getShape

      T getShape(TransformComponent transformComponent, float offsetX, float offsetY)
      Gets the geometric Shape for this collider shape.
      Parameters:
      transformComponent - the TransformComponent for the Entity
      offsetX - the x offset off the collider
      offsetY - the y offset of the collider
      Returns:
      the geometric Shape
    • debugRender

      void debugRender(Renderer renderer, TransformComponent transformComponent, float offsetX, float offsetY)
      Renders debug information for the collider shape.
      Parameters:
      renderer - the Renderer
      transformComponent - the Entity's TransformComponent
      offsetX - the collider shape x-axis offset
      offsetY - the collider shape y-axis offset