Class ImpulseCollisionResolutionSystem

java.lang.Object
technology.sola.ecs.EcsSystem
technology.sola.engine.physics.system.ImpulseCollisionResolutionSystem

@NullMarked public class ImpulseCollisionResolutionSystem extends technology.sola.ecs.EcsSystem
ImpulseCollisionResolutionSystem is an EcsSystem that responds to CollisionEvents applying an impulse to resolve collisions so that they will no longer overlap.
  • Field Details

  • Constructor Details

    • ImpulseCollisionResolutionSystem

      public ImpulseCollisionResolutionSystem(EventHub eventHub)
      Creates an instance with recommended settings.
      Parameters:
      eventHub - the EventHub instance
    • ImpulseCollisionResolutionSystem

      public ImpulseCollisionResolutionSystem(EventHub eventHub, int iterations)
      Creates an instance with custom iterations and recommended penetrationSlack and linearProjectionPercentage settings.
      Parameters:
      eventHub - the EventHub instance
      iterations - number of impulse resolution calculation iterations, larger is more accurate (1-20 is recommended)
    • ImpulseCollisionResolutionSystem

      public ImpulseCollisionResolutionSystem(EventHub eventHub, int iterations, float penetrationSlack, float linearProjectionPercentage)
      Creates an instance with custom settings.
      Parameters:
      eventHub - the EventHub instance
      iterations - number of impulse resolution calculation iterations, larger is more accurate (1-20 is recommended)
      penetrationSlack - smaller number is more accurate but causes more jittering (0.01-0.1 recommended)
      linearProjectionPercentage - how much positional correction to apply, small value allows objects to penetrate more with less jittering (0.2-0.8 recommended)
  • Method Details

    • update

      public void update(technology.sola.ecs.World world, float deltaTime)
      Specified by:
      update in class technology.sola.ecs.EcsSystem
    • getOrder

      public int getOrder()
      Overrides:
      getOrder in class technology.sola.ecs.EcsSystem