Class PhysicsBodyStateUpdaterRK4

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

public class PhysicsBodyStateUpdaterRK4 extends PhysicsBodyStateUpdater
PhysicsBodyStateUpdater using Runge-Kutta method for integration.

This one is O(dt^4). See https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods.

Since:
2020-03-06
  • Constructor Details

    • PhysicsBodyStateUpdaterRK4

      public PhysicsBodyStateUpdaterRK4()
  • 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