public class NukkitMath extends Object
| Constructor and Description |
|---|
NukkitMath() |
| Modifier and Type | Method and Description |
|---|---|
static int |
ceilDouble(double n) |
static int |
ceilFloat(float n) |
static double |
clamp(double value,
double min,
double max) |
static int |
clamp(int value,
int min,
int max) |
static int |
floorDouble(double n) |
static int |
floorFloat(float n) |
static double |
getDirection(double diffX,
double diffZ) |
static com.nukkitx.math.vector.Vector3f |
getIntermediateWithXValue(com.nukkitx.math.vector.Vector3f v,
com.nukkitx.math.vector.Vector3f v2,
float x)
Returns a new vector with x value equal to the second parameter, along the line between this vector and the
passed in vector, or null if not possible.
|
static com.nukkitx.math.vector.Vector3f |
getIntermediateWithYValue(com.nukkitx.math.vector.Vector3f v,
com.nukkitx.math.vector.Vector3f v2,
float y)
Returns a new vector with y value equal to the second parameter, along the line between this vector and the
passed in vector, or null if not possible.
|
static com.nukkitx.math.vector.Vector3f |
getIntermediateWithZValue(com.nukkitx.math.vector.Vector3f v,
com.nukkitx.math.vector.Vector3f v2,
float z)
Returns a new vector with z value equal to the second parameter, along the line between this vector and the
passed in vector, or null if not possible.
|
static double |
round(double d) |
static double |
round(double d,
int precision) |
public static int floorDouble(double n)
public static int ceilDouble(double n)
public static int floorFloat(float n)
public static int ceilFloat(float n)
public static double round(double d)
public static double round(double d,
int precision)
public static double clamp(double value,
double min,
double max)
public static int clamp(int value,
int min,
int max)
public static double getDirection(double diffX,
double diffZ)
public static com.nukkitx.math.vector.Vector3f getIntermediateWithXValue(com.nukkitx.math.vector.Vector3f v,
com.nukkitx.math.vector.Vector3f v2,
float x)
v2 - vectorx - x valuepublic static com.nukkitx.math.vector.Vector3f getIntermediateWithYValue(com.nukkitx.math.vector.Vector3f v,
com.nukkitx.math.vector.Vector3f v2,
float y)
v2 - vectory - y valuepublic static com.nukkitx.math.vector.Vector3f getIntermediateWithZValue(com.nukkitx.math.vector.Vector3f v,
com.nukkitx.math.vector.Vector3f v2,
float z)
v2 - vectorz - z valueCopyright © 2020. All rights reserved.