36 #ifndef THOR_VECTORALGEBRA3D_HPP
37 #define THOR_VECTORALGEBRA3D_HPP
41 #include <SFML/System/Vector2.hpp>
42 #include <SFML/System/Vector3.hpp>
56 T
length(
const sf::Vector3<T>& vector);
66 sf::Vector3<T>
unitVector(
const sf::Vector3<T>& vector);
88 T
dotProduct(
const sf::Vector3<T>& lhs,
const sf::Vector3<T>& rhs);
93 sf::Vector3<T>
crossProduct(
const sf::Vector3<T>& lhs,
const sf::Vector3<T>& rhs);
99 sf::Vector3<T>
cwiseProduct(
const sf::Vector3<T>& lhs,
const sf::Vector3<T>& rhs);
105 template <
typename T>
106 sf::Vector3<T>
cwiseQuotient(
const sf::Vector3<T>& lhs,
const sf::Vector3<T>& rhs);
113 template <
typename T>
114 sf::Vector3<T>
toVector3(
const sf::Vector2<T>& vector2);
120 #include <Thor/Vectors/Detail/VectorAlgebra3D.inl>
121 #endif // THOR_VECTORALGEBRA3D_HPP
T dotProduct(const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
Computes the dot product of two 3D vectors.
sf::Vector3< T > toVector3(const sf::Vector2< T > &vector2)
Constructs a 3D vector from a 2D vector by setting the Z component to zero.
T elevationAngle(const sf::Vector3< T > &vector)
Returns the elevation angle of vector.
sf::Vector3< T > cwiseProduct(const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
Returns the component-wise product of lhs and rhs.
Definition: Animator.hpp:42
sf::Vector3< T > cwiseQuotient(const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
Returns the component-wise quotient of lhs and rhs.
Class template thor::TrigonometricTraits and some trigonometry-related functions and constants...
sf::Vector3< T > crossProduct(const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
Computes the cross product of two 3D vectors.
T squaredLength(const sf::Vector3< T > &vector)
Returns the square of vector's length.
T polarAngle(const sf::Vector3< T > &vector)
Returns the angle between the projection of vector onto the XY-plane and the X-axis.
sf::Vector3< T > unitVector(const sf::Vector3< T > &vector)
Returns a vector with same direction as the argument, but with length 1.
T length(const sf::Vector3< T > &vector)
Returns the length of the 3D vector.