, SDK SFML / . ../include/SFML/System/( ) Vector2.hpp Vector2.inl. :
rotate Vector2.hpp:
...stuff...
template <typename T>
class Vector2
{
public :
....
void Rotate(T angle);
....
};
vector2.inl( ):
template <typename T>
void Vector2<T>::Rotate(T angle) {
...your implementation here...
}
Vector2 , SFML Thor, . ( ) , Thor SDK, 2D- :
- ..//Thor/Vectors/VectorAlgebra2d.hpp
- ..//Thor/Detail/VectorAlgebra2D.inl
- ..//Thor//Trigonometry.hpp
- ../SRC/Trigonometry.cpp
sf:: Vector, - :
#include <iostream>
#include <SFML/Graphics.hpp>
#include "VectorAlgebra2D.hpp"
....
sf::Vector2f rotate_THIS(10.0f,10.0f);
thor::Rotate(rotate_THIS, 180.0f);
std::cout << "(" << rotate_THIS.x << ", " << rotate_THIS.y << ")" << std::endl;
sf::Vector2f rotated = thor::RotatedVector(rotate_THIS, 180.0f);
std::cout << "(" << rotated .x << ", " << rotated .y << ")" << std::endl;
....
():
(-10,-10)
(10,10)
, SFML , , (Length Dot Product), Thor, .