Class PhysicsBodyStateUpdaterMidpoint

java.lang.Object
com.hypixel.hytale.server.core.modules.physics.util.PhysicsBodyStateUpdater
com.hypixel.hytale.server.core.modules.physics.util.PhysicsBodyStateUpdaterMidpoint

public class PhysicsBodyStateUpdaterMidpoint extends PhysicsBodyStateUpdater
PhysicsBodyStateUpdater using midpoint method (modified Euler) for integration.

This one is O(dt^2). See https://en.wikipedia.org/wiki/Midpoint_method.

Since:
2020-03-08
  • Constructor Details

    • PhysicsBodyStateUpdaterMidpoint

      public PhysicsBodyStateUpdaterMidpoint()
  • Method Details

    • update

      public void update(@Nonnull PhysicsBodyState before, @Nonnull PhysicsBodyState after, double mass, double dt, boolean onGround, @Nonnull ForceProvider[] forceProvider)
      Description copied from class: PhysicsBodyStateUpdater
      Compute new position and velocity for a body over a time interval.
      Overrides:
      update in class PhysicsBodyStateUpdater
      Parameters:
      before - Provided position and velocity at start of interval
      after - Resulting position and velocity at end of interval
      mass - Mass of body
      dt - Time step/interval
      onGround - Whether body is on ground
      forceProvider - Array of force provider used to compute forces applied to body