|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.Vector3
public class Vector3
three dimensional float vector
| Field Summary | |
|---|---|
float |
x
|
float |
y
|
float |
z
|
| Constructor Summary | |
|---|---|
Vector3()
x,y and z are set to 0 |
|
Vector3(float x,
float y,
float z)
vector constructor. sets x, y and z components to the given parameters |
|
| Method Summary | |
|---|---|
Vector3 |
add(Vector3 other)
adds this to other vector and stores result in this |
Vector3 |
clone()
copies the value of this and returns a clone |
float |
distance(Vector3 other)
calculates the distance between the two points specified by this vector and other |
float |
length()
returns the length of the vector |
Vector3 |
mult(float scalar)
multiplies this with scalar and stores result in this |
Vector3 |
normalize()
normalizes this vector |
void |
set(float x,
float y,
float z)
sets x, y and z components to the given parameters |
Vector3 |
sub(Vector3 other)
|
Vector3 |
subThisFrom(Vector3 other)
subtracts this from other and stores result in this |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public float x
public float y
public float z
| Constructor Detail |
|---|
public Vector3()
public Vector3(float x,
float y,
float z)
x - xy - yz - z| Method Detail |
|---|
public void set(float x,
float y,
float z)
x - xy - yz - zpublic float distance(Vector3 other)
other - other vector interpreted as point
public Vector3 normalize()
public float length()
public Vector3 sub(Vector3 other)
public Vector3 subThisFrom(Vector3 other)
other - vector from which this is subtracted
public Vector3 add(Vector3 other)
other - other vector that is added
public Vector3 mult(float scalar)
scalar -
public Vector3 clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||