|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.math.Vector3f
public final class Vector3f
A three element vector.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
static Vector3f |
MAX_VALUE
A vector containing the maximum floating point value for all components. |
static Vector3f |
MIN_VALUE
A vector containing the minimum floating point value for all components (note: the components are - Float.MAX_VALUE, not Float.MIN_VALUE). |
static Vector3f |
NORMAL_XYZ
A normalized version of UNIT_XYZ. |
static Vector3f |
UNIT_X
A unit vector in the X+ direction. |
static Vector3f |
UNIT_XYZ
A vector containing unity for all components. |
static Vector3f |
UNIT_Y
A unit vector in the Y+ direction. |
static Vector3f |
UNIT_Z
A unit vector in the Z+ direction. |
float |
x
The components of the vector. |
float |
y
The components of the vector. |
float |
z
The components of the vector. |
static Vector3f |
ZERO
The zero vector. |
| Constructor Summary | |
|---|---|
Vector3f()
Creates a zero vector. |
|
Vector3f(float[] values)
Creates a vector from an array of values. |
|
Vector3f(float x,
float y,
float z)
Creates a vector from three components. |
|
Vector3f(Vector3f other)
Copy constructor. |
|
| Method Summary | |
|---|---|
Vector3f |
add(float x,
float y,
float z)
Adds a vector to this one. |
Vector3f |
add(float x,
float y,
float z,
Vector3f result)
Adds a vector to this one and stores the result in the object provided. |
Vector3f |
add(Vector3f other)
Adds a vector to this one. |
Vector3f |
add(Vector3f other,
Vector3f result)
Adds a vector to this one, storing the result in the object provided. |
Vector3f |
addLocal(float x,
float y,
float z)
Adds a vector in-place to this one. |
Vector3f |
addLocal(Vector3f other)
Adds a vector in-place to this one. |
Vector3f |
addScaled(Vector3f other,
float v)
Adds a scaled vector to this one. |
Vector3f |
addScaled(Vector3f other,
float v,
Vector3f result)
Adds a scaled vector to this one and stores the result in the supplied vector. |
Vector3f |
addScaledLocal(Vector3f other,
float v)
Adds a scaled vector in-place to this one. |
float |
angle(Vector3f other)
Returns the angle between this vector and the specified other vector. |
Vector3f |
cross(Vector3f other)
Computes the cross product of this and the specified other vector. |
Vector3f |
cross(Vector3f other,
Vector3f result)
Computes the cross product of this and the specified other vector, placing the result in the object supplied. |
Vector3f |
crossLocal(Vector3f other)
Computes the cross product of this and the specified other vector, storing the result in this vector. |
void |
decodeFromStream(DataInputStream in)
Initializes this object with data read from the specified stream. |
void |
decodeFromString(String string)
Initializes this object with the contents of the specified string. |
float |
distance(Vector3f other)
Returns the distance from this vector to the specified other vector. |
float |
distanceSquared(Vector3f other)
Returns the squared distance from this vector to the specified other. |
float |
dot(Vector3f other)
Computes and returns the dot product of this and the specified other vector. |
void |
encodeToStream(DataOutputStream out)
Encodes this object to the specified stream. |
String |
encodeToString()
Returns a string representation of this object. |
boolean |
equals(Object other)
|
void |
get(float[] values)
Populates the supplied array with the contents of this vector. |
FloatBuffer |
get(FloatBuffer buf)
Populates the supplied buffer with the contents of this vector. |
float |
get(int idx)
Returns the element at the idx'th position of the vector. |
int |
hashCode()
|
float |
length()
Returns the length of this vector. |
float |
lengthSquared()
Returns the squared length of this vector. |
Vector3f |
lerp(Vector3f other,
float t)
Linearly interpolates between this and the specified other vector by the supplied amount. |
Vector3f |
lerp(Vector3f other,
float t,
Vector3f result)
Linearly interpolates between this and the supplied other vector by the supplied amount, storing the result in the supplied object. |
Vector3f |
lerpLocal(Vector3f other,
float t)
Linearly interpolates between this and the specified other vector in-place by the supplied amount. |
float |
manhattanDistance(Vector3f other)
Returns the Manhattan distance between this vector and the specified other. |
Vector3f |
mult(float v)
Multiplies this vector by a scalar. |
Vector3f |
mult(float v,
Vector3f result)
Multiplies this vector by a scalar and places the result in the supplied object. |
Vector3f |
mult(Vector3f other)
Multiplies this vector by another. |
Vector3f |
mult(Vector3f other,
Vector3f result)
Multiplies this vector by another, storing the result in the object provided. |
Vector3f |
multLocal(float v)
Multiplies this vector in-place by a scalar. |
Vector3f |
multLocal(Vector3f other)
Multiplies this vector in-place by another. |
Vector3f |
negate()
Negates this vector. |
Vector3f |
negate(Vector3f result)
Negates this vector, storing the result in the supplied object. |
Vector3f |
negateLocal()
Negates this vector in-place. |
Vector3f |
normalize()
Normalizes this vector. |
Vector3f |
normalize(Vector3f result)
Normalizes this vector, storing the result in the object supplied. |
Vector3f |
normalizeLocal()
Normalizes this vector in-place. |
Vector3f |
set(float[] values)
Copies the elements of an array. |
Vector3f |
set(float x,
float y,
float z)
Sets all of the elements of the vector. |
Vector3f |
set(Vector3f other)
Copies the elements of another vector. |
Vector3f |
subtract(Vector3f other)
Subtracts a vector from this one. |
Vector3f |
subtract(Vector3f other,
Vector3f result)
Subtracts a vector from this one and places the result in the supplied object. |
Vector3f |
subtractLocal(Vector3f other)
Subtracts a vector in-place from this one. |
String |
toString()
|
float |
triple(Vector3f b,
Vector3f c)
Computes the triple product of this and the specified other vectors, which is equal to this.dot(b.cross(c)). |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Vector3f UNIT_X
public static final Vector3f UNIT_Y
public static final Vector3f UNIT_Z
public static final Vector3f UNIT_XYZ
public static final Vector3f NORMAL_XYZ
public static final Vector3f ZERO
public static final Vector3f MIN_VALUE
Float.MAX_VALUE, not Float.MIN_VALUE).
public static final Vector3f MAX_VALUE
public float x
public float y
public float z
| Constructor Detail |
|---|
public Vector3f(float x,
float y,
float z)
public Vector3f(float[] values)
public Vector3f(Vector3f other)
public Vector3f()
| Method Detail |
|---|
public float dot(Vector3f other)
public Vector3f crossLocal(Vector3f other)
public Vector3f cross(Vector3f other)
public Vector3f cross(Vector3f other,
Vector3f result)
public float triple(Vector3f b,
Vector3f c)
this.dot(b.cross(c)).
public Vector3f negateLocal()
public Vector3f negate()
public Vector3f negate(Vector3f result)
public Vector3f normalizeLocal()
public Vector3f normalize()
public Vector3f normalize(Vector3f result)
public float angle(Vector3f other)
public float length()
public float lengthSquared()
public float distance(Vector3f other)
public float distanceSquared(Vector3f other)
public float manhattanDistance(Vector3f other)
public Vector3f multLocal(float v)
public Vector3f mult(float v)
public Vector3f mult(float v,
Vector3f result)
public Vector3f multLocal(Vector3f other)
public Vector3f mult(Vector3f other)
public Vector3f mult(Vector3f other,
Vector3f result)
public Vector3f addLocal(Vector3f other)
public Vector3f add(Vector3f other)
public Vector3f add(Vector3f other,
Vector3f result)
public Vector3f subtractLocal(Vector3f other)
public Vector3f subtract(Vector3f other)
public Vector3f subtract(Vector3f other,
Vector3f result)
public Vector3f addLocal(float x,
float y,
float z)
public Vector3f add(float x,
float y,
float z)
public Vector3f add(float x,
float y,
float z,
Vector3f result)
public Vector3f addScaledLocal(Vector3f other,
float v)
public Vector3f addScaled(Vector3f other,
float v)
public Vector3f addScaled(Vector3f other,
float v,
Vector3f result)
public Vector3f lerpLocal(Vector3f other,
float t)
public Vector3f lerp(Vector3f other,
float t)
public Vector3f lerp(Vector3f other,
float t,
Vector3f result)
public Vector3f set(Vector3f other)
public Vector3f set(float[] values)
public Vector3f set(float x,
float y,
float z)
public float get(int idx)
public void get(float[] values)
public FloatBuffer get(FloatBuffer buf)
public String encodeToString()
Encodable
encodeToString in interface Encodable
public void decodeFromString(String string)
throws Exception
Encodable
decodeFromString in interface EncodableException
public void encodeToStream(DataOutputStream out)
throws IOException
Encodable
encodeToStream in interface EncodableIOException
public void decodeFromStream(DataInputStream in)
throws IOException
Encodable
decodeFromStream in interface EncodableIOExceptionpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||