Changeset 161 in flair-src for trunk/lib/FlairCore/src/Vector2D.cpp


Ignore:
Timestamp:
Mar 6, 2017, 12:45:57 AM (8 years ago)
Author:
Sanahuja Guillaume
Message:

modifs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Vector2D.cpp

    r15 r161  
    3333}
    3434
     35Vector2D &Vector2D::operator+=(const Vector2D &vector) {
     36  x += vector.x;
     37  y += vector.y;
     38  return (*this);
     39}
     40
     41Vector2D &Vector2D::operator-=(const Vector2D &vector) {
     42  x -= vector.x;
     43  y -= vector.y;
     44  return (*this);
     45}
     46
    3547Vector2D operator+(const Vector2D &vectorA, const Vector2D &vectorB) {
    3648  return Vector2D(vectorA.x + vectorB.x, vectorA.y + vectorB.y);
     
    3951Vector2D operator-(const Vector2D &vectorA, const Vector2D &vectorB) {
    4052  return Vector2D(vectorA.x - vectorB.x, vectorA.y - vectorB.y);
     53}
     54
     55Vector2D operator-(const Vector2D &vectorA) {
     56 return Vector2D(-vectorA.x, -vectorA.y);
    4157}
    4258
Note: See TracChangeset for help on using the changeset viewer.