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

20 lines
377 B
C++
Raw Normal View History

2017-11-13 22:16:38 +00:00
#include "math/Vector2f.h"
Vector2f& Vector2f::round()
{
2017-11-17 14:58:52 +00:00
mX = (float)(int)(mX + 0.5f);
mY = (float)(int)(mY + 0.5f);
2017-11-13 22:16:38 +00:00
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