Added explicit conversions between different types of sf::Vector2, sf::Vector3 and sf::Rect (implements feature #31)

This commit is contained in:
Laurent Gomila 2011-04-26 19:20:24 +02:00
parent ade8cb8771
commit eac841ec71
6 changed files with 75 additions and 0 deletions

View file

@ -45,6 +45,17 @@ z(Z)
}
////////////////////////////////////////////////////////////
template <typename T>
template <typename U>
inline Vector3<T>::Vector3(const Vector3<U>& vector) :
x(static_cast<T>(vector.x)),
y(static_cast<T>(vector.y)),
z(static_cast<T>(vector.z))
{
}
////////////////////////////////////////////////////////////
template <typename T>
inline Vector3<T> operator -(const Vector3<T>& left)