From 1fa7681c0d83da20a0e55f2bbe2bbb0a455b60e1 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Tue, 11 Jan 2022 10:42:48 +0100 Subject: [PATCH] Relocated src and include files --- CMakeLists.txt | 3 ++- Quaternion.h => include/Quaternion.h | 9 ++++++++- Vector3.h => include/Vector3.h | 0 Quaternion.cpp => src/Quaternion.cpp | 0 Vector3.cpp => src/Vector3.cpp | 0 5 files changed, 10 insertions(+), 2 deletions(-) rename Quaternion.h => include/Quaternion.h (96%) rename Vector3.h => include/Vector3.h (100%) rename Quaternion.cpp => src/Quaternion.cpp (100%) rename Vector3.cpp => src/Vector3.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a2e6ce..d6e15ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.13) # CMake version check project(VectorAlgebra) # Create project "simple_example" set(CMAKE_CXX_STANDARD 14) # Enable c++14 standard +include_directories(include) -add_library(VectorAlgebra STATIC Vector3.cpp Quaternion.cpp) \ No newline at end of file +add_library(VectorAlgebra STATIC "src/Vector3.cpp" "src/Quaternion.cpp") \ No newline at end of file diff --git a/Quaternion.h b/include/Quaternion.h similarity index 96% rename from Quaternion.h rename to include/Quaternion.h index 6dddd1d..41e7141 100644 --- a/Quaternion.h +++ b/include/Quaternion.h @@ -230,6 +230,14 @@ public: /// A pointer to the quaternion for the twist result static void GetSwingTwist(Vector3 axis, Quaternion rotation, Quaternion* swing, Quaternion* twist); + /// + /// Calculate the dot product of two quaternions + /// + /// The first rotation + /// The second rotation + /// + static float Dot(Quaternion rotation1, Quaternion rotation2); + private: float GetLength() const; float GetLengthSquared() const; @@ -238,7 +246,6 @@ private: void ToAxisAngleRad(const Quaternion& q, Vector3* const axis, float* angle); static Quaternion FromEulerRad(Vector3 euler); - static float Dot(Quaternion a, Quaternion b); Vector3 xyz() const; }; diff --git a/Vector3.h b/include/Vector3.h similarity index 100% rename from Vector3.h rename to include/Vector3.h diff --git a/Quaternion.cpp b/src/Quaternion.cpp similarity index 100% rename from Quaternion.cpp rename to src/Quaternion.cpp diff --git a/Vector3.cpp b/src/Vector3.cpp similarity index 100% rename from Vector3.cpp rename to src/Vector3.cpp