game.geom
Class CFixedPoint
java.lang.Object
game.geom.CFixedPoint
public class CFixedPoint
- extends java.lang.Object
Abstract class implementing static functions handling fixed point arithmetics.
- Author:
- seb
Field Summary |
static int |
MAX
|
static int |
MIN
|
static int |
OFFSET
|
static int |
ONE
|
Method Summary |
static int |
ceil(int fp)
|
static int |
div(int fp1,
int fp2)
|
static int |
doubleToFp(double d)
|
static int |
floatToFp(float f)
|
static int |
floor(int fp)
|
static double |
fpToDouble(int fp)
|
static float |
fpToFloat(int fp)
|
static int |
fpToInt(int fp)
|
static int |
intToFp(int i)
|
static int |
mul(int fp1,
int fp2)
|
static java.lang.String |
toString(int fp)
Makes a string representation of a fixed-point number. |
static java.lang.String |
toString(int fpx,
int fpy)
|
static int |
vectorLength(int fpx,
int fpy)
Calculates the length of a fixed-point vector. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OFFSET
public static final int OFFSET
- See Also:
- Constant Field Values
ONE
public static final int ONE
- See Also:
- Constant Field Values
MIN
public static final int MIN
- See Also:
- Constant Field Values
MAX
public static final int MAX
- See Also:
- Constant Field Values
CFixedPoint
private CFixedPoint()
mul
public static final int mul(int fp1,
int fp2)
div
public static final int div(int fp1,
int fp2)
ceil
public static final int ceil(int fp)
floor
public static final int floor(int fp)
vectorLength
public static final int vectorLength(int fpx,
int fpy)
- Calculates the length of a fixed-point vector.
fpToInt
public static final int fpToInt(int fp)
fpToFloat
public static final float fpToFloat(int fp)
fpToDouble
public static final double fpToDouble(int fp)
intToFp
public static final int intToFp(int i)
floatToFp
public static final int floatToFp(float f)
doubleToFp
public static final int doubleToFp(double d)
toString
public static final java.lang.String toString(int fp)
- Makes a string representation of a fixed-point number.
toString
public static final java.lang.String toString(int fpx,
int fpy)