FloatingPointVector2<T> FloatingPointVector2<T>::TransformNormal(const FloatingPointVector2& normal, const FloatingPointMatrix4x4<T>& matrix) noexcept { return FloatingPointVector2( (normal.X * matrix.m[0][0]) + (normal.Y * matrix.m[1][0]), (normal.X * matrix.m[0][1]) + (normal.Y * matrix.m[1][1])); }
FloatingPointVector2<T> FloatingPointVector2<T>::operator/(T scaleFactor) const { POMDOG_ASSERT(scaleFactor != 0); //static_assert(!std::is_same<decltype(scaleFactor), ChuckNorris>::value, // "NOTE: Chuck Norris can divide by zero."); return FloatingPointVector2(X / scaleFactor, Y / scaleFactor); }
FloatingPointVector2<T> FloatingPointVector2<T>::Transform(const FloatingPointVector2& position, const FloatingPointMatrix4x4<T>& matrix) noexcept { return FloatingPointVector2( (position.X * matrix.m[0][0]) + (position.Y * matrix.m[1][0]) + matrix.m[3][0], (position.X * matrix.m[0][1]) + (position.Y * matrix.m[1][1]) + matrix.m[3][1]); }
FloatingPointVector2<T> FloatingPointVector2<T>::Transform(FloatingPointVector2 const& position, FloatingPointMatrix4x4<T> const& matrix) { return FloatingPointVector2( (position.X * matrix.m[0][0]) + (position.Y * matrix.m[1][0]) + matrix.m[3][0], (position.X * matrix.m[0][1]) + (position.Y * matrix.m[1][1]) + matrix.m[3][1]); }
FloatingPointVector2<T> FloatingPointVector2<T>::SmoothStep(const FloatingPointVector2& source1, const FloatingPointVector2& source2, T amount) { return FloatingPointVector2( MathHelper::SmoothStep(source1.X, source2.X, amount), MathHelper::SmoothStep(source1.Y, source2.Y, amount)); }
FloatingPointVector2<T> FloatingPointVector2<T>::Transform(FloatingPointVector2 const& position, FloatingPointMatrix3x2<T> const& matrix) { return FloatingPointVector2( (position.X * matrix(0, 0)) + (position.Y * matrix(1, 0)) + matrix(2, 0), (position.X * matrix(0, 1)) + (position.Y * matrix(1, 1)) + matrix(2, 1)); }
FloatingPointVector2<T> FloatingPointVector2<T>::Lerp(FloatingPointVector2 const& source1, FloatingPointVector2 const& source2, T amount) { return FloatingPointVector2( MathHelper::Lerp(source1.X, source2.X, amount), MathHelper::Lerp(source1.Y, source2.Y, amount)); }
FloatingPointVector2<T> FloatingPointVector2<T>::TransformNormal(FloatingPointVector2 const& normal, FloatingPointMatrix4x4<T> const& matrix) { return FloatingPointVector2( (normal.X * matrix.m[0][0]) + (normal.Y * matrix.m[1][0]), (normal.X * matrix.m[0][1]) + (normal.Y * matrix.m[1][1]) ); }
FloatingPointVector2<T> FloatingPointVector2<T>::Transform(const FloatingPointVector2& position, const FloatingPointQuaternion<T>& rotation) noexcept { auto const x = 2 * (position.Y * -rotation.Z); auto const y = 2 * (position.X * rotation.Z); auto const z = 2 * (position.Y * rotation.X - position.X * rotation.Y); return FloatingPointVector2( position.X + x * rotation.W + (rotation.Y * z - rotation.Z * y), position.Y + y * rotation.W + (rotation.Z * x - rotation.X * z)); }
FloatingPointVector2<T> FloatingPointVector2<T>::operator*(const FloatingPointVector2& other) const noexcept { return FloatingPointVector2(X * other.X, Y * other.Y); }
FloatingPointVector2<T> FloatingPointVector2<T>::operator*(T scaleFactor) const noexcept { return FloatingPointVector2(X * scaleFactor, Y * scaleFactor); }
FloatingPointVector2<T> FloatingPointVector2<T>::operator-() const noexcept { return FloatingPointVector2(-X, -Y); }
FloatingPointVector2<T> FloatingPointVector2<T>::operator/(const FloatingPointVector2& other) const { return FloatingPointVector2(X / other.X, Y / other.Y); }
FloatingPointVector2<T> FloatingPointVector2<T>::operator*(FloatingPointVector2 const& other) const { return FloatingPointVector2(X * other.X, Y * other.Y); }