Class ColliderUtils

java.lang.Object
technology.sola.engine.physics.utils.ColliderUtils

@NullMarked public class ColliderUtils extends Object
ColliderUtils is a collection of utility methods for configuring ColliderComponent.
  • Method Details

    • autoSizeColliderToSprite

      public static void autoSizeColliderToSprite(technology.sola.ecs.Entity entity, SpriteSheet spriteSheet)
      Auto sizes an Entity's ColliderComponent using its SpriteComponent. This replaces the initial collider using the sprite's dimensions. If the initial collider is a ColliderShapeCircle then additional offset will be added to the collider if the sprite's dimensions are not equal.
      Parameters:
      entity - the Entity
      spriteSheet - the SpriteSheet