Add WithDistance

This commit is contained in:
Pascal Serrarens 2024-09-09 15:14:06 +02:00
parent 69bad8f662
commit 407e7712c6
2 changed files with 8 additions and 0 deletions

View File

@ -107,6 +107,12 @@ template <>
const SphericalOf<signed short> SphericalOf<signed short>::zero =
SphericalOf(0.0f, AngleOf<signed short>(0), AngleOf<signed short>(0));
template <typename T>
SphericalOf<T> SphericalOf<T>::WithDistance(float distance) {
SphericalOf<T> v = SphericalOf<T>(distance, this->horizontal, this->vertical);
return SphericalOf<T>();
}
template <typename T>
SphericalOf<T> SphericalOf<T>::operator-() const {
SphericalOf<T> v =

View File

@ -51,6 +51,8 @@ class SphericalOf {
/// @brief A normalized down-oriented vector
const static SphericalOf<T> down;
SphericalOf<T> WithDistance(float distance);
/// @brief Negate the vector
/// @return The negated vector
/// This will rotate the vector by 180 degrees horizontally and