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 technology.sola.ecs.Entity autoSizeColliderToSprite(technology.sola.ecs.Entity entity, AssetLoader<SpriteSheet> spriteSheetAssetLoader)
      Auto sizes an Entity's ColliderComponent using its SpriteComponent. This replaces the initial collider using the sprite's dimensions once it has been loaded. If the initial collider is a circle then additional offset will be added to the collider if the sprite's dimensions are not equal.
      Parameters:
      entity - the Entity
      spriteSheetAssetLoader - the AssetLoader for SpriteSheet
      Returns:
      the entity