36 lines
505 B
C++
36 lines
505 B
C++
|
#include "vector2D.h"
|
||
|
#include <num/num.h>
|
||
|
|
||
|
|
||
|
Vector2D::Vector2D()
|
||
|
{
|
||
|
this->x = 0.0;
|
||
|
this->y = 0.0;
|
||
|
}
|
||
|
|
||
|
Vector2D::Vector2D( float x, float y )
|
||
|
{
|
||
|
this->x = libnum::num32(x);
|
||
|
this->y = libnum::num32(y);
|
||
|
}
|
||
|
|
||
|
Vector2D::Vector2D( libnum::num32 x, libnum::num32 y )
|
||
|
{
|
||
|
this->x = x;
|
||
|
this->y = y;
|
||
|
}
|
||
|
|
||
|
Vector2D::~Vector2D()
|
||
|
{
|
||
|
this->x = 0.0;
|
||
|
this->y = 0.0;
|
||
|
}
|
||
|
|
||
|
Vector2D Vector2D::AddVectors( Vector2D a, Vector2D b )
|
||
|
{
|
||
|
this->x = a.x + b.x;
|
||
|
this->y = a.y + b.y;
|
||
|
return *this;
|
||
|
}
|
||
|
|