|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.edu.swin.synergy.math.BVector2
A vector class for BScalars. It contains 2 elements. NOTE: this is not a Vector in the java sense, but rather a vector in the computer graphics/mathematical sense. While they are similar, there are certain differences that I won't elaborate on here. Just don't think that it's like a normal java.util.Vector. provides methods for multiplying, dividing, scaling, adding and subtracting vectors. The vector array is public, so no function calls are necessary to obtain the values. Index the array using the predefined constants.
Field Summary | |
static int |
kNumElements
|
static int |
kXPos
|
static int |
kYPos
|
BScalar[] |
vect
|
Constructor Summary | |
BVector2(BScalar x,
BScalar y)
Creates a new bvector2 from the scalar values given. |
|
BVector2(float x,
float y)
Creates a new bvector2 with scalars that have the values of the floats passed in |
|
BVector2(int x,
int y)
Creates a new bvector2 with scalars that have the values of the ints passed in |
Method Summary | |
void |
add(BScalar x,
BScalar y)
adds scalar values to the scalar |
void |
add(BVector2 op2)
adds another vector to this vector |
void |
add(int x,
int y)
adds int values to the scalar |
void |
div(BVector2 op2)
divs this vector by another vector |
BScalar |
getXScalar()
gets the x scalar |
BScalar |
getYScalar()
gets the y scalar |
void |
mult(BVector2 op2)
multiplies this vector by another vector |
void |
mult(BVector2 op1,
BVector2 op2)
this vector = one vector multiplied by another vector |
void |
scale(float scale)
scales this vector by a floating value. |
void |
setVals(BScalar x,
BScalar y)
sets the values of the bvector2 |
void |
setVals(float x,
float y)
sets the values of the bvector2 |
void |
setVals(int x,
int y)
sets the values of the bvector2 |
void |
sub(BVector2 op2)
subs another vector from this vector |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int kNumElements
public static final int kXPos
public static final int kYPos
public BScalar[] vect
Constructor Detail |
public BVector2(BScalar x, BScalar y)
public BVector2(int x, int y)
public BVector2(float x, float y)
Method Detail |
public void setVals(int x, int y)
public void setVals(float x, float y)
public void setVals(BScalar x, BScalar y)
public final BScalar getXScalar()
public final BScalar getYScalar()
public final void mult(BVector2 op2)
public final void mult(BVector2 op1, BVector2 op2)
public final void div(BVector2 op2)
public final void scale(float scale)
public final void add(BVector2 op2)
public final void add(int x, int y)
public final void add(BScalar x, BScalar y)
public final void sub(BVector2 op2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |