Package buildengine.math.vector
Class Vector2f
java.lang.Object
buildengine.math.vector.Vector2f
2D Vector with float point coordinates
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionadd(float d) add(float x, float y) clone()div(float d) div(float x, float y) floatbooleanflip()floatfloatgetX()floatgetY()floatlength()mul(float d) mul(float x, float y) rotate(double theta) set(float x, float y) Changes the components of the vectorvoidsetX(float x) voidsetY(float y) sub(float d) sub(float x, float y) toString()static Vector2fvalueOf(float[] floats) static Vector2f
- 
Field Details- 
xpublic float xThe components of the vector
- 
ypublic float yThe components of the vector
 
- 
- 
Constructor Details- 
Vector2fpublic Vector2f()Creates a new vector with both components set to 0
- 
Vector2fpublic Vector2f(float d) Creates a new vector with equal components- Parameters:
- d- both components value
 
- 
Vector2f
- 
Vector2f
- 
Vector2fpublic Vector2f(float x, float y) Creates a new vector with specified components- Parameters:
- x- the x component
- y- the y component
 
 
- 
- 
Method Details- 
setChanges the components of the vector- Parameters:
- x- the x component
- y- the y component
- Returns:
- the current object
 
- 
add
- 
add
- 
add
- 
add
- 
add
- 
add
- 
sub
- 
sub
- 
sub
- 
sub
- 
sub
- 
sub
- 
mul
- 
mul
- 
mul
- 
mul
- 
mul
- 
mul
- 
div
- 
div
- 
div
- 
div
- 
div
- 
div
- 
dot
- 
flip
- 
flip
- 
normalize
- 
normalize
- 
rotate
- 
rotate
- 
lengthpublic float length()
- 
getRadianspublic float getRadians()
- 
getPerpendicular
- 
getXpublic float getX()
- 
getYpublic float getY()
- 
setXpublic void setX(float x) 
- 
setYpublic void setY(float y) 
- 
valueOf
- 
valueOf
- 
equals
- 
toString
- 
clone
 
-