For a project of mine, I implemented t

Code: Select all
// Rotates a Vector2 by a given oriented angle
static inline Ogre::Vector2 rotateVector2(const Ogre::Vector2& in, Ogre::Radian angle)
{
return Ogre::Vector2(in.x* Ogre::Math::Cos(angle) - in.y * Ogre::Math::Sin(angle),
in.x * Ogre::Math::Sin(angle) + in.y * Ogre::Math::Cos(angle));
}
I think it could be made a member function of Vector2.
I'll post a patch for this if I get the time
