|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.globalse.arena.frag.util.MathVector
class for a 3-D vector and some calc on it.
Field Summary | |
double |
x
|
double |
y
|
double |
z
|
Constructor Summary | |
MathVector()
Default Constructor. |
|
MathVector(double _x,
double _y,
double _z)
Constructor for setting the coordinates with the values of the parameters |
Method Summary | |
MathVector |
add(MathVector other)
Adds the coordinates of the other MathVector to the coordinates of the current vector. |
java.lang.Object |
clone()
Returns a copy of the instance of the object. |
boolean |
equals(java.lang.Object obj)
Calculates wether the parameter object is equal with the current vector. |
double |
length()
Returns the legth of the vector. |
MathVector |
normalize()
Returns normalized MathVector. |
MathVector |
scale(double value)
Multiplies each coordinate of the vector with the parameter value. |
MathVector |
sub(MathVector other)
Substracts the coordinates of the oteher MathVector from the current vector. |
java.lang.String |
toString()
Return the coordinates of the vector as a string. |
Methods inherited from class java.lang.Object |
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public double x
public double y
public double z
Constructor Detail |
public MathVector()
public MathVector(double _x, double _y, double _z)
_x
- the x coordinate_y
- the y coordinate_z
- the z coordinateMethod Detail |
public java.lang.Object clone()
public double length()
public MathVector add(MathVector other)
other
- the second vectorpublic MathVector sub(MathVector other)
other
- the second vectorpublic MathVector scale(double value)
value
- the value for the multiplicationpublic MathVector normalize()
public boolean equals(java.lang.Object obj)
obj
- the second objectpublic java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |