Class MathsHelper

java.lang.Object
com.petrolpark.util.MathsHelper

public class MathsHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final net.minecraft.core.Vec3i
    add(net.minecraft.core.Vec3i vec1, net.minecraft.core.Vec3i vec2)
     
    static final double
    angleBetween(net.minecraft.world.phys.Vec3 vec1, net.minecraft.world.phys.Vec3 vec2, net.minecraft.world.phys.Vec3 plane)
    The directional angle in degrees between two vectors, between 0 and 360.
    static final double
    azimuth(net.minecraft.world.phys.Vec3 vec)
     
    static final int
    clampInt(long value)
     
    static final net.minecraft.world.phys.AABB
    expandToInclude(net.minecraft.world.phys.AABB box, net.minecraft.core.BlockPos pos)
     
    static final net.minecraft.world.phys.AABB
    expandToInclude(net.minecraft.world.phys.AABB box, net.minecraft.world.phys.Vec3 point)
     
    static final int
    exponentiate(int base, int exponent)
     
    static final int
    floorLog(int x, int base)
     
    static final double
    floorMod(double value, double modulus)
     
    static final float
    floorMod(float value, float modulus)
     
    static final Comparator<net.minecraft.world.phys.Vec3>
    getClosest(net.minecraft.world.phys.Vec3 targetVector)
     
    static final double
    inclination(net.minecraft.world.phys.Vec3 vec)
     
    static final long
    properWhole(org.apache.commons.math3.fraction.BigFraction fraction)
     
    static final int
    properWholeInt(org.apache.commons.math3.fraction.BigFraction fraction)
     
    static final net.minecraft.world.phys.Vec3
    rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 rotationAxis, double angle)
     
    static final double
    volume(net.minecraft.world.phys.AABB box)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MathsHelper

      public MathsHelper()
  • Method Details

    • floorLog

      public static final int floorLog(int x, int base)
    • exponentiate

      public static final int exponentiate(int base, int exponent)
    • floorMod

      public static final double floorMod(double value, double modulus)
    • floorMod

      public static final float floorMod(float value, float modulus)
    • angleBetween

      public static final double angleBetween(net.minecraft.world.phys.Vec3 vec1, net.minecraft.world.phys.Vec3 vec2, net.minecraft.world.phys.Vec3 plane)
      The directional angle in degrees between two vectors, between 0 and 360.
      Parameters:
      vec1 -
      vec2 -
      plane - The approximate vector around which vec1 was rotated to get vec2
    • rotate

      public static final net.minecraft.world.phys.Vec3 rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 rotationAxis, double angle)
      Parameters:
      vec - The vector to rotate
      rotationAxis - The vector about which to rotate the first vector
      angle - The angle in degrees through which to rotate the first vector around the second
    • add

      public static final net.minecraft.core.Vec3i add(net.minecraft.core.Vec3i vec1, net.minecraft.core.Vec3i vec2)
    • getClosest

      public static final Comparator<net.minecraft.world.phys.Vec3> getClosest(net.minecraft.world.phys.Vec3 targetVector)
    • azimuth

      public static final double azimuth(net.minecraft.world.phys.Vec3 vec)
    • inclination

      public static final double inclination(net.minecraft.world.phys.Vec3 vec)
    • expandToInclude

      public static final net.minecraft.world.phys.AABB expandToInclude(net.minecraft.world.phys.AABB box, net.minecraft.world.phys.Vec3 point)
    • expandToInclude

      public static final net.minecraft.world.phys.AABB expandToInclude(net.minecraft.world.phys.AABB box, net.minecraft.core.BlockPos pos)
    • volume

      public static final double volume(net.minecraft.world.phys.AABB box)
    • clampInt

      public static final int clampInt(long value)
    • properWhole

      public static final long properWhole(org.apache.commons.math3.fraction.BigFraction fraction)
    • properWholeInt

      public static final int properWholeInt(org.apache.commons.math3.fraction.BigFraction fraction)