Candle v1.0
2D lighting for SFML
|
This file contains utility functions for 2D vectors. More...
Functions | |
template<typename T > | |
float | sfu::magnitude (const sf::Vector2< T > &v) |
template<typename T > | |
float | sfu::magnitude2 (const sf::Vector2< T > &v) |
template<typename T > | |
sf::Vector2< T > | sfu::normalize (const sf::Vector2< T > &v) |
template<typename T , typename Q > | |
T | sfu::dot (const sf::Vector2< T > &v1, const sf::Vector2< Q > &v2) |
template<typename T , typename Q > | |
float | sfu::angle (const sf::Vector2< T > &v1, const sf::Vector2< Q > &v2) |
template<typename T > | |
float | sfu::angle (const sf::Vector2< T > &v) |
This file contains utility functions for 2D vectors.
float sfu::magnitude | ( | const sf::Vector2< T > & | v | ) |
Get the magnitude of a 2D vector.
float sfu::magnitude2 | ( | const sf::Vector2< T > & | v | ) |
Get the squared magnitude of a 2D vector.
sf::Vector2< T > sfu::normalize | ( | const sf::Vector2< T > & | v | ) |
Get the normalized version of a 2D vector.
T sfu::dot | ( | const sf::Vector2< T > & | v1, |
const sf::Vector2< Q > & | v2 | ||
) |
Get the dot product of two 2D vectors.
float sfu::angle | ( | const sf::Vector2< T > & | v1, |
const sf::Vector2< Q > & | v2 | ||
) |
Get the angle between two 2D vectors.
float sfu::angle | ( | const sf::Vector2< T > & | v | ) |
Get the angle of a 2D vector with the X axis.