|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.TupleNf<VectorNf>
org.openmali.vecmath2.VectorNf
org.openmali.vecmath2.Vector4f
public class Vector4f
A simple 4-dimensional float-Vector implementation. Inspired by Kenji Hiranabe's Vector4f implementation
| Field Summary | |
|---|---|
static Vector4f |
ZERO
|
| Fields inherited from class org.openmali.vecmath2.TupleNf |
|---|
isDirty, roTrick, values |
| Constructor Summary | |
|---|---|
|
Vector4f()
Creates a new Vector4f instance. |
protected |
Vector4f(boolean readOnly)
Creates a new Vector4f instance. |
protected |
Vector4f(boolean readOnly,
float[] values,
boolean[] isDirty,
boolean copy)
Creates a new Vector4f instance. |
protected |
Vector4f(boolean readOnly,
float x,
float y,
float z,
float w)
Creates a new Vector4f instance. |
protected |
Vector4f(boolean readOnly,
Vector4f vec)
Creates a new Vector4f instance. |
|
Vector4f(float[] values)
Creates a new Vector4f instance. |
|
Vector4f(float x,
float y,
float z,
float w)
Creates a new Vector4f instance. |
|
Vector4f(Vector4f vec)
Creates a new Vector4f instance. |
| Method Summary | |
|---|---|
Vector4f |
add(float x,
float y,
float z,
float w)
Adds the given parameters to this tuple's values. |
Vector4f |
addW(float w)
Adds v to this vector's w value. |
Vector4f |
addX(float v)
Adds v to this vector's x value. |
Vector4f |
addY(float v)
Adds v to this vector's y value. |
Vector4f |
addZ(float v)
Adds v to this vector's z value. |
Vector4f |
asReadOnly()
|
Vector4f |
clone()
Creates and returns a copy of this object. |
Vector4f |
cross(Vector4f v1,
Vector4f v2)
Sets this vector to be the vector cross product of vectors v1 and v2. |
float |
distanceL1(VectorNf v2)
Computes the L-1 (Manhattan) distance between this point and point p1. |
float |
distanceLinf(VectorNf v2)
Computes the L-infinite distance between this point and point p1. |
Vector4f |
div(float vx,
float vy,
float vz,
float vw)
Divides this vector's values by vx, vy, vz. |
Vector4f |
divW(float v)
Divides this vector's w value by v. |
Vector4f |
divX(float v)
Divides this vector's x value by v. |
Vector4f |
divY(float v)
Divides this vector's y value by v. |
Vector4f |
divZ(float v)
Divides this vector's z value by v. |
boolean |
equals(java.lang.Object o)
Returns true if the Object t1 is of type Vector4f and all of the data members of t1 are equal to the corresponding data members in this Vector4f. |
static Vector4f |
fromPool()
Allocates an Vector4f instance from the pool. |
static Vector4f |
fromPool(float x,
float y,
float z,
float w)
Allocates an Vector4f instance from the pool. |
static Vector4f |
fromPool(Vector4f tuple)
Allocates an Vector4f instance from the pool. |
void |
get(Tuple3f buffer)
Writes all values of this Tuple to the specified buffer Tuple. |
void |
getLinearHyperPlaneNormal(TupleNf<?> p1,
TupleNf<?> p2,
TupleNf<?> p3)
returns the normal of a linear hyperplane (that is a 4D hyperplane passing through the origin) from three points. i.e. |
static TupleNf<?> |
getLinearHyperPlaneNormal(TupleNf<?> p1,
TupleNf<?> p2,
TupleNf<?> p3,
TupleNf<?> normal)
returns the normal of a linear hyperplane (that is a 4D hyperplane passing through the origin) from three points. i.e. |
Vector4f |
getReadOnly()
|
float |
getW()
|
float |
getX()
|
float |
getY()
|
float |
getZ()
|
float |
length3()
computes the length of the (x,y,z)-component of this vector. |
float |
lengthSquared3()
Computes the squared length of the (x,y,z)-component of this vector. |
Vector4f |
mul(float vx,
float vy,
float vz,
float vw)
Multiplies this vector's values with vx, vy, vz. |
Vector4f |
mulW(float v)
Multiplies this vector's w value with v. |
Vector4f |
mulX(float v)
Multiplies this vector's x value with v. |
Vector4f |
mulY(float v)
Multiplies this vector's y value with v. |
Vector4f |
mulZ(float v)
Multiplies this vector's z value with v. |
static Vector4f |
newReadOnly()
Creates a new Vector4f instance. |
static Vector4f |
newReadOnly(float[] values)
Creates a new Vector4f instance. |
static Vector4f |
newReadOnly(float x,
float y,
float z,
float w)
Creates a new Vector4f instance. |
static Vector4f |
newReadOnly(Vector4f vec)
Creates a new Vector4f instance. |
Vector4f |
scale(float factorX,
float factorY,
float factorZ,
float factorW)
Sets the value of this vector to the scalar multiplication of vector t1. |
Vector4f |
set(float x,
float y,
float z,
float w)
Sets all values of this Tuple to the specified ones. |
Vector4f |
set(Tuple3f tuple)
Sets all values of this vector to the specified ones. |
Vector4f |
set(Vector3f v,
float w)
Sets this vector's xyz components to the ones of the given vector and w to w. |
Vector4f |
setW(float w)
Sets the value of the w-element of this vector. |
Vector4f |
setX(float x)
Sets the value of the x-element of this vector. |
Vector4f |
setY(float y)
Sets the value of the y-element of this vector. |
Vector4f |
setZ(float z)
Sets the value of the z-element of this vector. |
Vector4f |
sub(float x,
float y,
float z,
float w)
Subtracts the given parameters from this vector's values. |
Vector4f |
sub(Tuple3f tuple2)
Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1). |
Vector4f |
sub(Tuple3f tuple1,
Tuple3f tuple2)
Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2). |
Vector4f |
subW(float v)
Subtracts v from this vector's w value. |
Vector4f |
subX(float v)
Subtracts v from this vector's x value. |
Vector4f |
subY(float v)
Subtracts v from this vector's y value. |
Vector4f |
subZ(float v)
Subtracts v from this vector's z value. |
static void |
toPool(Vector4f o)
Stores the given Vector4f instance in the pool. |
| Methods inherited from class org.openmali.vecmath2.VectorNf |
|---|
angle, cross, dot, getNorm, getNormSquared, length, lengthSquared, LUDBackSolve, mul, mul, newReadOnly, newReadOnly, newReadOnly, normalize, normalize, SVDBackSolve |
| 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.VectorInterface |
|---|
angle, cross, dot, length, lengthSquared, normalize, normalize |
| 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 Vector4f ZERO
| Constructor Detail |
|---|
protected Vector4f(boolean readOnly,
float x,
float y,
float z,
float w)
readOnly - x - the x element to usey - the y element to usez - the z element to usew - the w element to use
protected Vector4f(boolean readOnly,
float[] values,
boolean[] isDirty,
boolean copy)
readOnly - values - the values array (must be at least size 4)isDirty - copy -
protected Vector4f(boolean readOnly,
Vector4f vec)
readOnly - vec - the Vector4f to copy the values fromprotected Vector4f(boolean readOnly)
readOnly -
public Vector4f(float x,
float y,
float z,
float w)
x - the x element to usey - the y element to usez - the z element to usew - the w element to usepublic Vector4f(float[] values)
values - the values array (must be at least size 4)public Vector4f(Vector4f vec)
vec - the Vector4f to copy the values frompublic Vector4f()
| Method Detail |
|---|
public final Vector4f setX(float x)
x -
public final Vector4f setY(float y)
y -
public final Vector4f setZ(float z)
z -
public final Vector4f setW(float w)
w -
public final float getX()
public final float getY()
public final float getZ()
public final float getW()
public final Vector4f set(float x,
float y,
float z,
float w)
x - the x element to usey - the y element to usez - the z element to usew - the w element to use
public final Vector4f set(Vector3f v,
float w)
v - w -
public final Vector4f addX(float v)
v -
public final Vector4f addY(float v)
v -
public final Vector4f addZ(float v)
v -
public final Vector4f addW(float w)
w -
public final Vector4f add(float x,
float y,
float z,
float w)
x - y - z - w -
public final Vector4f subX(float v)
v -
public final Vector4f subY(float v)
v -
public final Vector4f subZ(float v)
v -
public final Vector4f subW(float v)
v -
public final Vector4f sub(float x,
float y,
float z,
float w)
x - y - z - w -
public final Vector4f mulX(float v)
v -
public final Vector4f mulY(float v)
v -
public final Vector4f mulZ(float v)
v -
public final Vector4f mulW(float v)
v -
public final Vector4f mul(float vx,
float vy,
float vz,
float vw)
vx - vy - vz - vw -
public final Vector4f scale(float factorX,
float factorY,
float factorZ,
float factorW)
factorX - factorY - factorZ - factorW -
public final Vector4f divX(float v)
v -
public final Vector4f divY(float v)
v -
public final Vector4f divZ(float v)
v -
public final Vector4f divW(float v)
v -
public final Vector4f div(float vx,
float vy,
float vz,
float vw)
vx - vy -
public final Vector4f set(Tuple3f tuple)
tuple - the tuple to be copied
public final void get(Tuple3f buffer)
buffer - the buffer Tuple to write the values to
public final Vector4f sub(Tuple3f tuple1,
Tuple3f tuple2)
tuple1 - the first tupletuple2 - the second tuple
public final Vector4f sub(Tuple3f tuple2)
tuple2 - the other tuple
public final Vector4f cross(Vector4f v1,
Vector4f v2)
v1 - the first vectorv2 - the second vector
public final float lengthSquared3()
VectorNf.getNormSquared()
VectorNf.getNormSquared()public final float length3()
VectorNf.getNorm()
VectorNf.getNorm()public final float distanceL1(VectorNf v2)
v2 - the other point
public static TupleNf<?> getLinearHyperPlaneNormal(TupleNf<?> p1,
TupleNf<?> p2,
TupleNf<?> p3,
TupleNf<?> normal)
p1 - p2 - p3 - normal -
public final void getLinearHyperPlaneNormal(TupleNf<?> p1,
TupleNf<?> p2,
TupleNf<?> p3)
p1 - p2 - p3 - public final float distanceLinf(VectorNf v2)
v2 - the other point
public Vector4f asReadOnly()
asReadOnly in class VectorNfTupleNf.getReadOnly()public Vector4f getReadOnly()
getReadOnly in class VectorNfTupleNf.asReadOnly()public boolean equals(java.lang.Object o)
equals in class TupleNf<VectorNf>o - the Object with which the comparison is made
public Vector4f clone()
clone in class VectorNfjava.lang.OutOfMemoryError - if there is not enough memory.Cloneable
public static Vector4f newReadOnly(float x,
float y,
float z,
float w)
x - the x element to usey - the y element to usez - the z element to usew - the w element to usepublic static Vector4f newReadOnly(float[] values)
values - the values array (must be at least size 4)public static Vector4f newReadOnly(Vector4f vec)
vec - the Vector4f to copy the values frompublic static Vector4f newReadOnly()
public static Vector4f fromPool()
public static Vector4f fromPool(float x,
float y,
float z,
float w)
public static Vector4f fromPool(Vector4f tuple)
public static void toPool(Vector4f o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||