mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 04:41:51 +09:00
ground hit detection and adjust player position accordingly (it's working at least)
Former-commit-id: be639eeeac82b35aae145540ede5e0b1f3b02d01 Former-commit-id: 4d214a5160cd80955909da238c3991ede5488ca6
This commit is contained in:
@@ -70,8 +70,6 @@ final public class FastMath {
|
||||
public static final float DEG_TO_RAD = PI / 180.0f;
|
||||
/** A value to multiply a radian value by, to convert it to degrees. */
|
||||
public static final float RAD_TO_DEG = 180.0f / PI;
|
||||
/** A precreated random object for random numbers. */
|
||||
public static final Random rand = new Random(System.currentTimeMillis());
|
||||
|
||||
/**
|
||||
* Returns true if the number is a power of 2 (2,4,8,16...)
|
||||
@@ -655,30 +653,6 @@ final public class FastMath {
|
||||
* (m10 * det12 - m11 * det02 + m12 * det01));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random float between 0 and 1.
|
||||
*
|
||||
* @return A random float between <tt>0.0f</tt> (inclusive) to
|
||||
* <tt>1.0f</tt> (exclusive).
|
||||
*/
|
||||
public static float nextRandomFloat() {
|
||||
return rand.nextFloat();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random float between min and max.
|
||||
*
|
||||
* @return A random int between <tt>min</tt> (inclusive) to
|
||||
* <tt>max</tt> (inclusive).
|
||||
*/
|
||||
public static int nextRandomInt(int min, int max) {
|
||||
return (int) (nextRandomFloat() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
public static int nextRandomInt() {
|
||||
return rand.nextInt();
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a point from Spherical coordinates to Cartesian (using positive
|
||||
* Y as up) and stores the results in the store var.
|
||||
|
||||
Reference in New Issue
Block a user