|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.TupleNf<Tuple3f>
org.openmali.vecmath2.Tuple3f
org.openmali.vecmath2.Vector3f
public class Vector3f
A simple 3-dimensional float-Vector implementation. Inspired by Kenji Hiranabe's Vector3f implementation
| Field Summary | |
|---|---|
static Vector3f |
NEGATIVE_X_AXIS
|
static Vector3f |
NEGATIVE_Y_AXIS
|
static Vector3f |
NEGATIVE_Z_AXIS
|
static Vector3f |
POSITIVE_X_AXIS
|
static Vector3f |
POSITIVE_Y_AXIS
|
static Vector3f |
POSITIVE_Z_AXIS
|
static Vector3f |
ZERO
|
| Fields inherited from class org.openmali.vecmath2.TupleNf |
|---|
isDirty, roTrick, values |
| Constructor Summary | |
|---|---|
|
Vector3f()
Creates a new Vector3f instance. |
protected |
Vector3f(boolean readOnly)
Creates a new Vector3f instance. |
protected |
Vector3f(boolean readOnly,
float[] values,
boolean[] isDirty,
boolean copy)
Creates a new Vector3f instance. |
protected |
Vector3f(boolean readOnly,
float x,
float y,
float z)
Creates a new Vector3f instance. |
protected |
Vector3f(boolean readOnly,
Tuple3f tuple)
Creates a new Vector3f instance. |
|
Vector3f(float[] values)
Creates a new Vector3f instance. |
|
Vector3f(float x,
float y,
float z)
Creates a new Vector3f instance. |
|
Vector3f(Tuple3f tuple)
Creates a new Vector3f instance. |
| Method Summary | |
|---|---|
float |
angle(Vector3f v2)
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI]. |
Vector3f |
asReadOnly()
|
Vector3f |
clone()
Creates and returns a copy of this object. |
Vector3f |
cross(Vector3f v1,
Vector3f v2)
Sets this vector to be the vector cross product of vectors v1 and v2. |
float |
dot(Vector3f v2)
Computes the dot product of the this vector and vector v2. |
static Vector3f |
fromPool()
Allocates an Vector3f instance from the pool. |
static Vector3f |
fromPool(float x,
float y,
float z)
Allocates an Vector3f instance from the pool. |
static Vector3f |
fromPool(Tuple3f tuple)
Allocates an Vector3f instance from the pool. |
Vector3f |
getReadOnly()
|
float |
length()
|
float |
lengthSquared()
|
static Vector3f |
newReadOnly()
Creates a new Vector3f instance. |
static Vector3f |
newReadOnly(float[] values)
Creates a new Vector3f instance. |
static Vector3f |
newReadOnly(float x,
float y,
float z)
Creates a new Vector3f instance. |
static Vector3f |
newReadOnly(Tuple3f tuple)
Creates a new Vector3f instance. |
Vector3f |
normalize()
Normalizes this vector in place. |
Vector3f |
normalize(Vector3f vector)
Sets the value of this vector to the normalization of vector v1. |
static void |
toPool(Vector3f o)
Stores the given Vector3f instance in the pool. |
| Methods inherited from class org.openmali.vecmath2.Tuple3f |
|---|
add, addX, addY, addZ, div, divX, divY, divZ, equals, getX, getY, getZ, mul, mulX, mulY, mulZ, scale, set, setX, setY, setZ, sub, subX, subY, subZ, toPool, x, x, y, y, z, z |
| 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, get, getSerializationBufferSize, getSize, getValue, hashCode, interpolate, interpolate, isDirty, isReadOnly, mul, mulValue, negate, negate, readExternal, readFromBuffer, readFromBuffer, readFromBuffer, readFromBuffer, round, round, scale, scale, scaleAdd, scaleAdd, serialize, set, set, set, setClean, setValue, setZero, sub, sub, subValue, toString, writeExternal, writeToBuffer, writeToBuffer, 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, get, getSize, getValue, interpolate, interpolate, isDirty, isReadOnly, mul, mulValue, negate, negate, round, round, scale, scale, scaleAdd, scaleAdd, set, set, set, setClean, setValue, setZero, sub, sub, subValue |
| Field Detail |
|---|
public static final Vector3f ZERO
public static final Vector3f POSITIVE_X_AXIS
public static final Vector3f NEGATIVE_X_AXIS
public static final Vector3f POSITIVE_Y_AXIS
public static final Vector3f NEGATIVE_Y_AXIS
public static final Vector3f POSITIVE_Z_AXIS
public static final Vector3f NEGATIVE_Z_AXIS
| Constructor Detail |
|---|
protected Vector3f(boolean readOnly,
float x,
float y,
float z)
readOnly - x - the x element to usey - the y element to usez - the z element to use
protected Vector3f(boolean readOnly,
float[] values,
boolean[] isDirty,
boolean copy)
readOnly - values - the values array (must be at least size 3)isDirty - the isDirty-valuecopy - copy the array?
protected Vector3f(boolean readOnly,
Tuple3f tuple)
readOnly - tuple - the Tuple3f to copy the values fromprotected Vector3f(boolean readOnly)
readOnly -
public Vector3f(float x,
float y,
float z)
x - the x element to usey - the y element to usez - the z element to usepublic Vector3f(float[] values)
values - the values array (must be at least size 3)public Vector3f(Tuple3f tuple)
tuple - the Tuple3f to copy the values frompublic Vector3f()
| Method Detail |
|---|
public final float lengthSquared()
lengthSquared in interface VectorInterface<Tuple3f,Vector3f>public final float length()
length in interface VectorInterface<Tuple3f,Vector3f>public final Vector3f normalize()
normalize in interface VectorInterface<Tuple3f,Vector3f>public final Vector3f normalize(Vector3f vector)
normalize in interface VectorInterface<Tuple3f,Vector3f>vector - the un-normalized vector
public final Vector3f cross(Vector3f v1,
Vector3f v2)
cross in interface VectorInterface<Tuple3f,Vector3f>v1 - the first vectorv2 - the second vector
public final float dot(Vector3f v2)
dot in interface VectorInterface<Tuple3f,Vector3f>v2 - the other vectorpublic final float angle(Vector3f v2)
angle in interface VectorInterface<Tuple3f,Vector3f>v2 - the other vector
public Vector3f clone()
clone in class Tuple3fCloneablepublic Vector3f asReadOnly()
asReadOnly in class Tuple3fTupleNf.getReadOnly()public Vector3f getReadOnly()
getReadOnly in class Tuple3fTupleNf.asReadOnly()
public static Vector3f newReadOnly(float x,
float y,
float z)
x - the x element to usey - the y element to usez - the z element to usepublic static Vector3f newReadOnly(float[] values)
values - the values array (must be at least size 3)public static Vector3f newReadOnly(Tuple3f tuple)
tuple - the Tuple3f to copy the values frompublic static Vector3f newReadOnly()
public static Vector3f fromPool()
public static Vector3f fromPool(float x,
float y,
float z)
public static Vector3f fromPool(Tuple3f tuple)
public static void toPool(Vector3f o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||