org.openmali.vecmath2
Interface VectorInterface<T extends TupleNf<T>,V extends TupleNf<?>>

All Superinterfaces:
TupleInterface<T>
All Known Implementing Classes:
Vector2f, Vector3f, Vector4f, VectorNf

public interface VectorInterface<T extends TupleNf<T>,V extends TupleNf<?>>
extends TupleInterface<T>

Common interface for all vector types.
Using it may slow down execution time because of prevented inlining.


Method Summary
 float angle(V vector2)
          Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].
 VectorInterface<T,V> cross(V v1, V v2)
          Sets this vector to be the vector cross product of vectors v1 and v2.
 float dot(V vector2)
          Computes the dot product of the this vector and vector v2.
 float length()
           
 float lengthSquared()
           
 VectorInterface<T,V> normalize()
          Normalizes this vector in place.
 VectorInterface<T,V> normalize(V vector)
          Sets the value of this vector to the normalization of vector v1.
 
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
 

Method Detail

lengthSquared

float lengthSquared()
Returns:
the squared length of this vector

length

float length()
Returns:
the length of this vector

normalize

VectorInterface<T,V> normalize()
Normalizes this vector in place.

Returns:
itself

normalize

VectorInterface<T,V> normalize(V vector)
Sets the value of this vector to the normalization of vector v1.

Parameters:
vector - the un-normalized vector
Returns:
itself

cross

VectorInterface<T,V> cross(V v1,
                           V v2)
Sets this vector to be the vector cross product of vectors v1 and v2.

Parameters:
v1 - the first vector
v2 - the second vector
Returns:
itself

dot

float dot(V vector2)
Computes the dot product of the this vector and vector v2.

Parameters:
vector2 - the other vector

angle

float angle(V vector2)
Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].

Parameters:
vector2 - the other vector
Returns:
the angle in radians in the range [0,PI]