Class ForceProviderStandard

java.lang.Object
com.hypixel.hytale.server.core.modules.physics.util.ForceProviderStandard
All Implemented Interfaces:
ForceProvider
Direct Known Subclasses:
ForceProviderEntity

public abstract class ForceProviderStandard extends Object implements ForceProvider
Base class for computing most common forces like drag and gravity for a body.
Since:
2020-03-05
  • Field Details

  • Constructor Details

    • ForceProviderStandard

      public ForceProviderStandard()
  • Method Details

    • getMass

      public abstract double getMass(double volume)
    • getVolume

      public abstract double getVolume()
    • getDensity

      public abstract double getDensity()
    • getProjectedArea

      public abstract double getProjectedArea(PhysicsBodyState bodyState, double speed)
    • getFrictionCoefficient

      public abstract double getFrictionCoefficient()
    • getForceProviderStandardState

      public abstract ForceProviderStandardState getForceProviderStandardState()
    • update

      public void update(@Nonnull PhysicsBodyState bodyState, @Nonnull ForceAccumulator accumulator, boolean onGround)
      Description copied from interface: ForceProvider
      Compute one or multiple forces acting on a physics body and add them to accumulator.
      Specified by:
      update in interface ForceProvider
      Parameters:
      bodyState - Current position and velocity of body
      accumulator - Accumulator to add forces to
      onGround - Whether body is on ground currently
    • clipForce

      public void clipForce(@Nonnull org.joml.Vector3d value, @Nonnull org.joml.Vector3d threshold)
      Clip component values of a vector against signed component values of a threshold vector
      Parameters:
      value - The source vector to be clipped componentwise
      threshold - The threshold values vector. Values are signed