GRIM: Added Vector2d's getters and setters for its data.
This commit is contained in:
parent
41d597c879
commit
594d9cf38d
5 changed files with 63 additions and 46 deletions
|
@ -41,12 +41,26 @@ Vector2d::Vector2d(const Vector2d &vec) :
|
|||
|
||||
}
|
||||
|
||||
void Vector2d::setX(float x) {
|
||||
_x = x;
|
||||
}
|
||||
|
||||
void Vector2d::setY(float y) {
|
||||
_y = y;
|
||||
}
|
||||
|
||||
Vector2d &Vector2d::operator=(const Vector2d &vec) {
|
||||
_x = vec._x;
|
||||
_y = vec._y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector2d &Vector2d::operator/=(float s) {
|
||||
_x /= s;
|
||||
_y /= s;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Vector2d::rotateAround(const Vector2d &point, float angle) {
|
||||
_x -= point._x;
|
||||
_y -= point._y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue