ES-DE/es-core/src/math/Vector2f.cpp

20 lines
363 B
C++
Raw Normal View History

2017-11-13 22:16:38 +00:00
#include "math/Vector2f.h"
Vector2f& Vector2f::round()
{
mX = (int)(mX + 0.5f);
mY = (int)(mY + 0.5f);
return *this;
} // round
Vector2f& Vector2f::lerp(const Vector2f& _start, const Vector2f& _end, const float _fraction)
{
mX = Math::lerp(_start.x(), _end.x(), _fraction);
mY = Math::lerp(_start.y(), _end.y(), _fraction);
return *this;
} // lerp