Package com.petrolpark.util
Class MathsHelper
java.lang.Object
com.petrolpark.util.MathsHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final net.minecraft.core.Vec3iadd(net.minecraft.core.Vec3i vec1, net.minecraft.core.Vec3i vec2) static final doubleangleBetween(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 doubleazimuth(net.minecraft.world.phys.Vec3 vec) static final intclampInt(long value) static final net.minecraft.world.phys.AABBexpandToInclude(net.minecraft.world.phys.AABB box, net.minecraft.core.BlockPos pos) static final net.minecraft.world.phys.AABBexpandToInclude(net.minecraft.world.phys.AABB box, net.minecraft.world.phys.Vec3 point) static final intexponentiate(int base, int exponent) static final intfloorLog(int x, int base) static final doublefloorMod(double value, double modulus) static final floatfloorMod(float value, float modulus) static final Comparator<net.minecraft.world.phys.Vec3> getClosest(net.minecraft.world.phys.Vec3 targetVector) static final doubleinclination(net.minecraft.world.phys.Vec3 vec) static final longproperWhole(org.apache.commons.math3.fraction.BigFraction fraction) static final intproperWholeInt(org.apache.commons.math3.fraction.BigFraction fraction) static final net.minecraft.world.phys.Vec3rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 rotationAxis, double angle) static final doublevolume(net.minecraft.world.phys.AABB box)
-
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 whichvec1was rotated to getvec2
-
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 rotaterotationAxis- The vector about which to rotate the first vectorangle- 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)
-