// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.modules.physics.util;

import javax.annotation.Nonnull;

public class PhysicsBodyStateUpdaterMidpoint extends PhysicsBodyStateUpdater
{
    @Override
    public void update(@Nonnull final PhysicsBodyState before, @Nonnull final PhysicsBodyState after, final double mass, final double dt, final boolean onGround, @Nonnull final ForceProvider[] forceProvider) {
        final double halfTime = 0.5 * dt;
        this.computeAcceleration(before, onGround, forceProvider, mass, halfTime);
        this.updateVelocity(before, after, halfTime);
        PhysicsBodyStateUpdater.updatePositionBeforeVelocity(before, after, halfTime);
        this.computeAcceleration(after, onGround, forceProvider, mass, dt);
        this.updateAndClampVelocity(before, after, dt);
        PhysicsBodyStateUpdater.updatePositionAfterVelocity(before, after, dt);
    }
}
