classpublicPriority 3
PhysicsBodyStateUpdaterMidpoint
com.hypixel.hytale.server.core.modules.physics.util.PhysicsBodyStateUpdaterMidpoint
extends PhysicsBodyStateUpdater
0
Methods
0
Public Methods
0
Fields
1
Constructors
Constructors
public
PhysicsBodyStateUpdaterMidpoint()Inheritance
Parent
Current
Interface
Child
Use mouse wheel to zoom, drag to pan. Click nodes to navigate.
Source Code
package com.hypixel.hytale.server.core.modules.physics.util;
import javax.annotation.Nonnull;
public class PhysicsBodyStateUpdaterMidpoint extends PhysicsBodyStateUpdater {
public PhysicsBodyStateUpdaterMidpoint() {
}
@Override
public void update(
@Nonnull PhysicsBodyState before, @Nonnull PhysicsBodyState after, double mass, double dt, boolean onGround, @Nonnull ForceProvider[] forceProvider
) {
double halfTime = 0.5 * dt;
this.computeAcceleration(before, onGround, forceProvider, mass, halfTime);
this.updateVelocity(before, after, halfTime);
updatePositionBeforeVelocity(before, after, halfTime);
this.computeAcceleration(after, onGround, forceProvider, mass, dt);
this.updateAndClampVelocity(before, after, dt);
updatePositionAfterVelocity(before, after, dt);
}
}