|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.TupleNf<Tuple2f>
org.openmali.vecmath2.Tuple2f
org.openmali.vecmath2.Point2f
public class Point2f
A 2 element point that is represented by single precision floating point x,y coordinates. Inspired by Kenji Hiranabe's Point2f implementation
| Field Summary | |
|---|---|
static Point2f |
ZERO
|
| Fields inherited from class org.openmali.vecmath2.TupleNf |
|---|
isDirty, roTrick, values |
| Constructor Summary | |
|---|---|
|
Point2f()
Creates a new Point2f instance. |
protected |
Point2f(boolean readOnly)
Creates a new Point2f instance. |
protected |
Point2f(boolean readOnly,
float[] values)
Creates a new Point2f instance. |
protected |
Point2f(boolean readOnly,
float x,
float y)
Creates a new Point2f instance. |
protected |
Point2f(boolean readOnly,
Tuple2f tuple)
Creates a new Point2f instance. |
|
Point2f(float[] values)
Creates a new Point2f instance. |
|
Point2f(float x,
float y)
Creates a new Point2f instance. |
|
Point2f(Tuple2f tuple)
Creates a new Point2f instance. |
| Method Summary | |
|---|---|
float |
distance(float p2x,
float p2y)
|
float |
distance(Point2f point2)
|
float |
distanceL1(Point2f point2)
Computes the L-1 (Manhattan) distance between this point and point p1. |
float |
distanceLinf(Point2f point2)
Computes the L-infinite distance between this point and point p1. |
float |
distanceSquared(float p2x,
float p2y)
|
float |
distanceSquared(Point2f point2)
|
static Point2f |
fromPool()
Allocates an Point2f instance from the pool. |
static Point2f |
fromPool(float x,
float y)
Allocates an Point2f instance from the pool. |
static Point2f |
fromPool(Tuple2f tuple)
Allocates an Point2f instance from the pool. |
static Point2f |
newReadOnly()
Creates a new Point2f instance. |
static Point2f |
newReadOnly(float[] values)
Creates a new Point2f instance. |
static Point2f |
newReadOnly(float x,
float y)
Creates a new Point2f instance. |
static Point2f |
newReadOnly(Tuple2f tuple)
Creates a new Point2f instance. |
static void |
toPool(Point2f o)
Stores the given Point2f instance in the pool. |
| Methods inherited from class org.openmali.vecmath2.Tuple2f |
|---|
add, addX, addY, clone, div, divX, divY, equals, getX, getY, mul, mulX, mulY, scale, set, setX, setY, sub, subX, subY, toPool |
| Methods inherited from class org.openmali.vecmath2.TupleNf |
|---|
absolute, absolute, add, add, addValue, clamp, clamp, clampMax, clampMax, clampMin, clampMin, deserialize, div, divValue, epsilonEquals, equals, fill, get, get, getSerializationBufferSize, getSize, getValue, hashCode, interpolate, interpolate, isDirty, isReadOnly, mul, mulValue, negate, negate, readExternal, round, round, scale, scale, scaleAdd, scaleAdd, serialize, set, set, setClean, setValue, setZero, sub, sub, subValue, toString, writeExternal, writeToBuffer, writeToBuffer |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Methods inherited from interface org.openmali.vecmath2.TupleInterface |
|---|
absolute, absolute, add, add, addValue, clamp, clamp, clampMax, clampMax, clampMin, clampMin, div, divValue, epsilonEquals, fill, get, get, getSize, getValue, interpolate, interpolate, isDirty, isReadOnly, mul, mulValue, negate, negate, round, round, scale, scale, scaleAdd, scaleAdd, set, set, setClean, setValue, setZero, sub, sub, subValue |
| Field Detail |
|---|
public static final Point2f ZERO
| Constructor Detail |
|---|
protected Point2f(boolean readOnly,
float x,
float y)
readOnly - x - the x element to usey - the y element to use
protected Point2f(boolean readOnly,
float[] values)
readOnly - values - the values array (must be at least size 2)
protected Point2f(boolean readOnly,
Tuple2f tuple)
readOnly - tuple - the Tuple2f to copy the values fromprotected Point2f(boolean readOnly)
readOnly -
public Point2f(float x,
float y)
x - the x element to usey - the y element to usepublic Point2f(float[] values)
values - the values array (must be at least size 2)public Point2f(Tuple2f tuple)
tuple - the Tuple2f to copy the values frompublic Point2f()
| Method Detail |
|---|
public final float distanceSquared(Point2f point2)
distanceSquared in interface PointInterface<Tuple2f,Point2f>public final float distance(Point2f point2)
distance in interface PointInterface<Tuple2f,Point2f>
public final float distanceSquared(float p2x,
float p2y)
public final float distance(float p2x,
float p2y)
public final float distanceL1(Point2f point2)
point2 - the other pointpublic final float distanceLinf(Point2f point2)
point2 - the other point
public static Point2f newReadOnly(float x,
float y)
x - the x element to usey - the y element to usepublic static Point2f newReadOnly(float[] values)
values - the values array (must be at least size 2)public static Point2f newReadOnly(Tuple2f tuple)
tuple - the Tuple2f to copy the values frompublic static Point2f newReadOnly()
public static Point2f fromPool()
public static Point2f fromPool(float x,
float y)
public static Point2f fromPool(Tuple2f tuple)
public static void toPool(Point2f o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||