java.lang.Object
technology.sola.engine.physics.utils.ColliderUtils
ColliderUtils is a collection of utility methods for configuring
ColliderComponent
.-
Method Summary
Modifier and TypeMethodDescriptionstatic technology.sola.ecs.Entity
autoSizeColliderToSprite
(technology.sola.ecs.Entity entity, AssetLoader<SpriteSheet> spriteSheetAssetLoader)
-
Method Details
-
autoSizeColliderToSprite
public static technology.sola.ecs.Entity autoSizeColliderToSprite(technology.sola.ecs.Entity entity, AssetLoader<SpriteSheet> spriteSheetAssetLoader) Auto sizes anEntity
'sColliderComponent
using itsSpriteComponent
. 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
- theEntity
spriteSheetAssetLoader
- theAssetLoader
forSpriteSheet
- Returns:
- the entity
-