Class MathsHelper

java.lang.Object
petrolpark.mc.library.util.MathsHelper

public class MathsHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.world.phys.Vec3
     
  • 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 net.minecraft.core.Direction.Axis
    getSecondaryAxis(net.minecraft.core.Direction.Axis primaryAxis, boolean secondaryAxisIsFirst)
     
    static final net.minecraft.core.Direction.Axis
    getTertiaryAxis(net.minecraft.core.Direction.Axis primaryAxis, boolean secondaryAxisIsFirst)
     
    static final double
    inclination(net.minecraft.world.phys.Vec3 vec)
     
    static final boolean
    isSecondaryAxis(net.minecraft.core.Direction.Axis primaryAxis, net.minecraft.core.Direction.Axis axis)
     
    static final boolean
    isTertiaryAxis(net.minecraft.core.Direction.Axis primaryAxis, net.minecraft.core.Direction.Axis axis)
     
    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
  • Field Details

    • VOXEL_BLOCK_CENTER

      public static final net.minecraft.world.phys.Vec3 VOXEL_BLOCK_CENTER
  • 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)
    • getSecondaryAxis

      public static final net.minecraft.core.Direction.Axis getSecondaryAxis(net.minecraft.core.Direction.Axis primaryAxis, boolean secondaryAxisIsFirst)
    • getTertiaryAxis

      public static final net.minecraft.core.Direction.Axis getTertiaryAxis(net.minecraft.core.Direction.Axis primaryAxis, boolean secondaryAxisIsFirst)
    • isSecondaryAxis

      public static final boolean isSecondaryAxis(net.minecraft.core.Direction.Axis primaryAxis, net.minecraft.core.Direction.Axis axis)
    • isTertiaryAxis

      public static final boolean isTertiaryAxis(net.minecraft.core.Direction.Axis primaryAxis, net.minecraft.core.Direction.Axis axis)