Contents
Class PhysicsBodyStateUpdaterMidpoint
java.lang.Object
com.hypixel.hytale.server.core.modules.physics.util.PhysicsBodyStateUpdater
com.hypixel.hytale.server.core.modules.physics.util.PhysicsBodyStateUpdaterMidpoint
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidupdate(PhysicsBodyState before, PhysicsBodyState after, double mass, double dt, boolean onGround, ForceProvider[] forceProvider) Compute new position and velocity for a body over a time interval.
-
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:PhysicsBodyStateUpdaterCompute new position and velocity for a body over a time interval.- Overrides:
updatein classPhysicsBodyStateUpdater- Parameters:
before- Provided position and velocity at start of intervalafter- Resulting position and velocity at end of intervalmass- Mass of bodydt- Time step/intervalonGround- Whether body is on groundforceProvider- Array of force provider used to compute forces applied to body
-