From 407e7712c6fad230270198359774d56264dc4bc3 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Mon, 9 Sep 2024 15:14:06 +0200 Subject: [PATCH] Add WithDistance --- Spherical.cpp | 6 ++++++ Spherical.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Spherical.cpp b/Spherical.cpp index 7f6c3ca..9552373 100644 --- a/Spherical.cpp +++ b/Spherical.cpp @@ -107,6 +107,12 @@ template <> const SphericalOf SphericalOf::zero = SphericalOf(0.0f, AngleOf(0), AngleOf(0)); +template +SphericalOf SphericalOf::WithDistance(float distance) { + SphericalOf v = SphericalOf(distance, this->horizontal, this->vertical); + return SphericalOf(); +} + template SphericalOf SphericalOf::operator-() const { SphericalOf v = diff --git a/Spherical.h b/Spherical.h index 2c4a12b..159520a 100644 --- a/Spherical.h +++ b/Spherical.h @@ -51,6 +51,8 @@ class SphericalOf { /// @brief A normalized down-oriented vector const static SphericalOf down; + SphericalOf WithDistance(float distance); + /// @brief Negate the vector /// @return The negated vector /// This will rotate the vector by 180 degrees horizontally and