Package info.u_team.u_team_core.util
Klasse MathUtil
java.lang.Object
info.u_team.u_team_core.util.MathUtil
Utility methods for math
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic final recordWrapper around theRandomSourcefor normalRandominstances -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final net.minecraft.util.RandomSourceStatic random instance if random numbers without specific seed are desired. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic floatgetPlaneDistance(int x1, int z1, int x2, int z2) Returns the distance between x1, z1 and x2, z2static doublerandomNumberInRange(double min, double max) Returns a pseudo random number in range of min and max (inclusive).static floatrandomNumberInRange(float min, float max) Returns a pseudo random number in range of min and max (inclusive).static intrandomNumberInRange(int min, int max) Returns a pseudo random number in range of min and max (inclusive).static doublerandomNumberInRange(net.minecraft.util.RandomSource random, double min, double max) Returns a pseudo random number in range of min and max (inclusive).static floatrandomNumberInRange(net.minecraft.util.RandomSource random, float min, float max) Returns a pseudo random number in range of min and max (inclusive).static intrandomNumberInRange(net.minecraft.util.RandomSource random, int min, int max) Returns a pseudo random number in range of min and max (inclusive).static net.minecraft.world.phys.Vec3rotateVectorAroundYCC(net.minecraft.world.phys.Vec3 vec, double angle) Rotate a vector counter clock wise around the y axis.static net.minecraft.world.phys.Vec3rotateVectorCC(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 axis, double angle) Rotate a vector counter clock wise around an axis.static doublevalueInRange(double min, double max, double value) Returns a value between min and maxstatic floatvalueInRange(float min, float max, float value) Returns a value between min and maxstatic intvalueInRange(int min, int max, int value) Returns a value between min and maxstatic longvalueInRange(long min, long max, long value) Returns a value between min and max
-
Felddetails
-
RANDOM
public static final net.minecraft.util.RandomSource RANDOMStatic random instance if random numbers without specific seed are desired.
-
-
Konstruktordetails
-
MathUtil
public MathUtil()
-
-
Methodendetails
-
rotateVectorAroundYCC
public static net.minecraft.world.phys.Vec3 rotateVectorAroundYCC(net.minecraft.world.phys.Vec3 vec, double angle) Rotate a vector counter clock wise around the y axis.- Parameter:
vec- Vector to rotateangle- Rotation angle- Gibt zurück:
- Rotated vector
-
rotateVectorCC
public static net.minecraft.world.phys.Vec3 rotateVectorCC(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 axis, double angle) Rotate a vector counter clock wise around an axis.- Parameter:
vec- Vector to rotateaxis- Rotation axisangle- Rotation angle- Gibt zurück:
- Rotated vector
-
randomNumberInRange
public static int randomNumberInRange(int min, int max) Returns a pseudo random number in range of min and max (inclusive). Use thisRANDOMinstance- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)- Gibt zurück:
- Return a random value between min and max
-
randomNumberInRange
public static int randomNumberInRange(net.minecraft.util.RandomSource random, int min, int max) Returns a pseudo random number in range of min and max (inclusive).- Parameter:
random- The random instancemin- Minimal value (inclusive)max- Maximal value (inclusive)- Gibt zurück:
- Return a random value between min and max
-
randomNumberInRange
public static float randomNumberInRange(float min, float max) Returns a pseudo random number in range of min and max (inclusive). Use thisRANDOMinstance- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)- Gibt zurück:
- Return a random value between min and max
-
randomNumberInRange
public static float randomNumberInRange(net.minecraft.util.RandomSource random, float min, float max) Returns a pseudo random number in range of min and max (inclusive).- Parameter:
random- The random instancemin- Minimal value (inclusive)max- Maximal value (inclusive)- Gibt zurück:
- Return a random value between min and max
-
randomNumberInRange
public static double randomNumberInRange(double min, double max) Returns a pseudo random number in range of min and max (inclusive). Use thisRANDOMinstance- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)- Gibt zurück:
- Return a random value between min and max
-
randomNumberInRange
public static double randomNumberInRange(net.minecraft.util.RandomSource random, double min, double max) Returns a pseudo random number in range of min and max (inclusive).- Parameter:
random- The random instancemin- Minimal value (inclusive)max- Maximal value (inclusive)- Gibt zurück:
- Return a random value between min and max
-
valueInRange
public static int valueInRange(int min, int max, int value) Returns a value between min and max- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)value- Value that should be in range- Gibt zurück:
- Return a value between min and max
-
valueInRange
public static long valueInRange(long min, long max, long value) Returns a value between min and max- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)value- Value that should be in range- Gibt zurück:
- Return a value between min and max
-
valueInRange
public static float valueInRange(float min, float max, float value) Returns a value between min and max- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)value- Value that should be in range- Gibt zurück:
- Return a value between min and max
-
valueInRange
public static double valueInRange(double min, double max, double value) Returns a value between min and max- Parameter:
min- Minimal value (inclusive)max- Maximal value (inclusive)value- Value that should be in range- Gibt zurück:
- Return a value between min and max
-
getPlaneDistance
public static float getPlaneDistance(int x1, int z1, int x2, int z2) Returns the distance between x1, z1 and x2, z2- Parameter:
x1- First x coordinatez1- First z coordinatex2- Second x coordinatez2- Second z coordinate- Gibt zurück:
- The distance between these two coordinates
-