diff --git a/AngleAxis.cpp b/AngleAxis.cpp deleted file mode 100644 index 6e17e51..0000000 --- a/AngleAxis.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0.If a copy of the MPL was not distributed with this -// file, You can obtain one at https ://mozilla.org/MPL/2.0/. - -#include "AngleAxis.h" - -template -AngleAxisOf::AngleAxisOf() { - this->angle = 0.0F; - this->axis = DirectionOf(); -} - -template -AngleAxisOf::AngleAxisOf(float angle, DirectionOf axis) { - this->angle = angle; - this->axis = axis; -} - -template -AngleAxisOf::AngleAxisOf(float angle, Vector3 axis) { - this->angle = angle; - this->axis = DirectionOf::FromVector3(axis); -} - -template -AngleAxisOf::AngleAxisOf(Quaternion q) { - float angle; - Vector3 axis; - q.ToAngleAxis(&angle, &axis); - this->angle = angle; - this->axis = DirectionOf::FromVector3(axis); -} - -template -const AngleAxisOf AngleAxisOf::zero = - AngleAxisOf(0.0, DirectionOf(AngleOf(), AngleOf())); - -template -Quaternion AngleAxisOf::ToQuaternion() { - Vector3 axisVector = this->axis.ToVector3(); - Quaternion q = Quaternion::AngleAxis(this->angle, axisVector); - return q; -} - -template -DirectionOf AngleAxisOf::GetSwing() { - return this->axis; -} - -template class AngleAxisOf; -template class AngleAxisOf; -*/ \ No newline at end of file diff --git a/Direction.h b/Direction.h index ebb75f7..b614a04 100644 --- a/Direction.h +++ b/Direction.h @@ -13,7 +13,7 @@ namespace LinearAlgebra { struct Vector3; /// @brief A direction using angles in various representations -/// @tparam T The internal type used for the representations of the angles +/// @tparam T The implementation type used for the representation of the angles /// A direction is represented using two angles: /// * The horizontal angle ranging from -180 (inclusive) to 180 (exclusive) /// degrees which is a rotation in the horizontal plane diff --git a/DoxyGen/DoxyWarnLogfile.txt b/DoxyGen/DoxyWarnLogfile.txt index fac369b..3f3c14a 100644 --- a/DoxyGen/DoxyWarnLogfile.txt +++ b/DoxyGen/DoxyWarnLogfile.txt @@ -5,36 +5,36 @@ Possible candidates: 'friend AngleOf< T > Passer::LinearAlgebra::AngleOf< T >::operator*(const AngleOf< T > &angle, float factor)' at line 117 of file d:/PlatformIO/linear-algebra/Angle.h 'friend AngleOf< T > Passer::LinearAlgebra::AngleOf< T >::operator*(float factor, const AngleOf< T > &angle)' at line 124 of file d:/PlatformIO/linear-algebra/Angle.h 'Vector3 Passer::LinearAlgebra::MatrixOf< T >::operator*(const Vector3 v) const' at line 64 of file d:/PlatformIO/linear-algebra/Matrix.h - 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(const PolarOf &v, float f)' at line 116 of file d:/PlatformIO/linear-algebra/Polar.h - 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(float f, const PolarOf &v)' at line 119 of file d:/PlatformIO/linear-algebra/Polar.h + 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(const PolarOf &v, float f)' at line 118 of file d:/PlatformIO/linear-algebra/Polar.h + 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(float f, const PolarOf &v)' at line 121 of file d:/PlatformIO/linear-algebra/Polar.h 'Vector3 Passer::LinearAlgebra::Quaternion::operator*(const Vector3 &vector) const' at line 98 of file d:/PlatformIO/linear-algebra/Quaternion.h 'Quaternion Passer::LinearAlgebra::Quaternion::operator*(const Quaternion &rotation) const' at line 106 of file d:/PlatformIO/linear-algebra/Quaternion.h - 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(const SphericalOf< T > &v, float f)' at line 109 of file d:/PlatformIO/linear-algebra/Spherical.h - 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(float f, const SphericalOf< T > &v)' at line 112 of file d:/PlatformIO/linear-algebra/Spherical.h - 'SphericalOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SphericalOf< T > &vector) const' at line 45 of file d:/PlatformIO/linear-algebra/SwingTwist.h - 'SwingTwistOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SwingTwistOf< T > &rotation) const' at line 53 of file d:/PlatformIO/linear-algebra/SwingTwist.h - 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(const Vector2 &v, float f)' at line 142 of file d:/PlatformIO/linear-algebra/Vector2.h - 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(float f, const Vector2 &v)' at line 145 of file d:/PlatformIO/linear-algebra/Vector2.h - 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(const Vector3 &v, float f)' at line 150 of file d:/PlatformIO/linear-algebra/Vector3.h - 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(float f, const Vector3 &v)' at line 153 of file d:/PlatformIO/linear-algebra/Vector3.h + 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(const SphericalOf< T > &v, float f)' at line 111 of file d:/PlatformIO/linear-algebra/Spherical.h + 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(float f, const SphericalOf< T > &v)' at line 114 of file d:/PlatformIO/linear-algebra/Spherical.h + 'SphericalOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SphericalOf< T > &vector) const' at line 46 of file d:/PlatformIO/linear-algebra/SwingTwist.h + 'SwingTwistOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SwingTwistOf< T > &rotation) const' at line 54 of file d:/PlatformIO/linear-algebra/SwingTwist.h + 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(const Vector2 &v, float f)' at line 141 of file d:/PlatformIO/linear-algebra/Vector2.h + 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(float f, const Vector2 &v)' at line 144 of file d:/PlatformIO/linear-algebra/Vector2.h + 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(const Vector3 &v, float f)' at line 149 of file d:/PlatformIO/linear-algebra/Vector3.h + 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(float f, const Vector3 &v)' at line 152 of file d:/PlatformIO/linear-algebra/Vector3.h d:/PlatformIO/linear-algebra/Quaternion.cpp:108: warning: no uniquely matching class member found for Vector3 Quaternion::operator*(const Vector3 &p) const Possible candidates: 'friend AngleOf< T > Passer::LinearAlgebra::AngleOf< T >::operator*(const AngleOf< T > &angle, float factor)' at line 117 of file d:/PlatformIO/linear-algebra/Angle.h 'friend AngleOf< T > Passer::LinearAlgebra::AngleOf< T >::operator*(float factor, const AngleOf< T > &angle)' at line 124 of file d:/PlatformIO/linear-algebra/Angle.h 'Vector3 Passer::LinearAlgebra::MatrixOf< T >::operator*(const Vector3 v) const' at line 64 of file d:/PlatformIO/linear-algebra/Matrix.h - 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(const PolarOf &v, float f)' at line 116 of file d:/PlatformIO/linear-algebra/Polar.h - 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(float f, const PolarOf &v)' at line 119 of file d:/PlatformIO/linear-algebra/Polar.h + 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(const PolarOf &v, float f)' at line 118 of file d:/PlatformIO/linear-algebra/Polar.h + 'friend PolarOf Passer::LinearAlgebra::PolarOf< T >::operator*(float f, const PolarOf &v)' at line 121 of file d:/PlatformIO/linear-algebra/Polar.h 'Vector3 Passer::LinearAlgebra::Quaternion::operator*(const Vector3 &vector) const' at line 98 of file d:/PlatformIO/linear-algebra/Quaternion.h 'Quaternion Passer::LinearAlgebra::Quaternion::operator*(const Quaternion &rotation) const' at line 106 of file d:/PlatformIO/linear-algebra/Quaternion.h - 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(const SphericalOf< T > &v, float f)' at line 109 of file d:/PlatformIO/linear-algebra/Spherical.h - 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(float f, const SphericalOf< T > &v)' at line 112 of file d:/PlatformIO/linear-algebra/Spherical.h - 'SphericalOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SphericalOf< T > &vector) const' at line 45 of file d:/PlatformIO/linear-algebra/SwingTwist.h - 'SwingTwistOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SwingTwistOf< T > &rotation) const' at line 53 of file d:/PlatformIO/linear-algebra/SwingTwist.h - 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(const Vector2 &v, float f)' at line 142 of file d:/PlatformIO/linear-algebra/Vector2.h - 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(float f, const Vector2 &v)' at line 145 of file d:/PlatformIO/linear-algebra/Vector2.h - 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(const Vector3 &v, float f)' at line 150 of file d:/PlatformIO/linear-algebra/Vector3.h - 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(float f, const Vector3 &v)' at line 153 of file d:/PlatformIO/linear-algebra/Vector3.h + 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(const SphericalOf< T > &v, float f)' at line 111 of file d:/PlatformIO/linear-algebra/Spherical.h + 'friend SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator*(float f, const SphericalOf< T > &v)' at line 114 of file d:/PlatformIO/linear-algebra/Spherical.h + 'SphericalOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SphericalOf< T > &vector) const' at line 46 of file d:/PlatformIO/linear-algebra/SwingTwist.h + 'SwingTwistOf< T > Passer::LinearAlgebra::SwingTwistOf< T >::operator*(const SwingTwistOf< T > &rotation) const' at line 54 of file d:/PlatformIO/linear-algebra/SwingTwist.h + 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(const Vector2 &v, float f)' at line 141 of file d:/PlatformIO/linear-algebra/Vector2.h + 'friend Vector2 Passer::LinearAlgebra::Vector2::operator*(float f, const Vector2 &v)' at line 144 of file d:/PlatformIO/linear-algebra/Vector2.h + 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(const Vector3 &v, float f)' at line 149 of file d:/PlatformIO/linear-algebra/Vector3.h + 'friend Vector3 Passer::LinearAlgebra::Vector3::operator*(float f, const Vector3 &v)' at line 152 of file d:/PlatformIO/linear-algebra/Vector3.h d:/PlatformIO/linear-algebra/Quaternion.cpp:152: warning: no uniquely matching class member found for Quaternion Quaternion::LookRotation(const Vector3 &forward, const Vector3 &up) Possible candidates: @@ -43,13 +43,13 @@ Possible candidates: d:/PlatformIO/linear-algebra/Quaternion.cpp:330: warning: no uniquely matching class member found for Quaternion Quaternion::Euler(Vector3 euler) Possible candidates: - 'static Quaternion Passer::LinearAlgebra::Quaternion::Euler(float x, float y, float z)' at line 218 of file d:/PlatformIO/linear-algebra/Quaternion.h - 'static Quaternion Passer::LinearAlgebra::Quaternion::Euler(Vector3 eulerAngles)' at line 225 of file d:/PlatformIO/linear-algebra/Quaternion.h + 'static Quaternion Passer::LinearAlgebra::Quaternion::Euler(float x, float y, float z)' at line 215 of file d:/PlatformIO/linear-algebra/Quaternion.h + 'static Quaternion Passer::LinearAlgebra::Quaternion::Euler(Vector3 eulerAngles)' at line 222 of file d:/PlatformIO/linear-algebra/Quaternion.h d:/PlatformIO/linear-algebra/Quaternion.cpp:362: warning: no uniquely matching class member found for Quaternion Quaternion::EulerXYZ(Vector3 euler) Possible candidates: - 'static Quaternion Passer::LinearAlgebra::Quaternion::EulerXYZ(float x, float y, float z)' at line 235 of file d:/PlatformIO/linear-algebra/Quaternion.h - 'static Quaternion Passer::LinearAlgebra::Quaternion::EulerXYZ(Vector3 eulerAngles)' at line 242 of file d:/PlatformIO/linear-algebra/Quaternion.h + 'static Quaternion Passer::LinearAlgebra::Quaternion::EulerXYZ(float x, float y, float z)' at line 232 of file d:/PlatformIO/linear-algebra/Quaternion.h + 'static Quaternion Passer::LinearAlgebra::Quaternion::EulerXYZ(Vector3 eulerAngles)' at line 239 of file d:/PlatformIO/linear-algebra/Quaternion.h d:/PlatformIO/linear-algebra/Spherical.cpp:137: warning: no uniquely matching class member found for template < T > SphericalOf< T > SphericalOf::operator-(const SphericalOf< T > &s2) const @@ -57,35 +57,35 @@ Possible candidates: 'AngleOf< T > Passer::LinearAlgebra::AngleOf< T >::operator-() const' at line 99 of file d:/PlatformIO/linear-algebra/Angle.h 'AngleOf< T > Passer::LinearAlgebra::AngleOf< T >::operator-(const AngleOf< T > &angle) const' at line 103 of file d:/PlatformIO/linear-algebra/Angle.h 'DirectionOf< T > Passer::LinearAlgebra::DirectionOf< T >::operator-() const' at line 84 of file d:/PlatformIO/linear-algebra/Direction.h - 'PolarOf Passer::LinearAlgebra::PolarOf< T >::operator-() const' at line 98 of file d:/PlatformIO/linear-algebra/Polar.h - 'PolarOf Passer::LinearAlgebra::PolarOf< T >::operator-(const PolarOf &v) const' at line 103 of file d:/PlatformIO/linear-algebra/Polar.h - 'SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator-() const' at line 91 of file d:/PlatformIO/linear-algebra/Spherical.h - 'SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator-(const SphericalOf< T > &v) const' at line 96 of file d:/PlatformIO/linear-algebra/Spherical.h - 'Vector2 Passer::LinearAlgebra::Vector2::operator-()' at line 117 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Vector2 Passer::LinearAlgebra::Vector2::operator-(const Vector2 &v) const' at line 122 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Vector3 Passer::LinearAlgebra::Vector3::operator-() const' at line 125 of file d:/PlatformIO/linear-algebra/Vector3.h - 'Vector3 Passer::LinearAlgebra::Vector3::operator-(const Vector3 &v) const' at line 130 of file d:/PlatformIO/linear-algebra/Vector3.h + 'PolarOf Passer::LinearAlgebra::PolarOf< T >::operator-() const' at line 100 of file d:/PlatformIO/linear-algebra/Polar.h + 'PolarOf Passer::LinearAlgebra::PolarOf< T >::operator-(const PolarOf &v) const' at line 105 of file d:/PlatformIO/linear-algebra/Polar.h + 'SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator-() const' at line 93 of file d:/PlatformIO/linear-algebra/Spherical.h + 'SphericalOf< T > Passer::LinearAlgebra::SphericalOf< T >::operator-(const SphericalOf< T > &v) const' at line 98 of file d:/PlatformIO/linear-algebra/Spherical.h + 'Vector2 Passer::LinearAlgebra::Vector2::operator-()' at line 116 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Vector2 Passer::LinearAlgebra::Vector2::operator-(const Vector2 &v) const' at line 121 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Vector3 Passer::LinearAlgebra::Vector3::operator-() const' at line 124 of file d:/PlatformIO/linear-algebra/Vector3.h + 'Vector3 Passer::LinearAlgebra::Vector3::operator-(const Vector3 &v) const' at line 129 of file d:/PlatformIO/linear-algebra/Vector3.h d:/PlatformIO/linear-algebra/Vector2.cpp:20: warning: no uniquely matching class member found for Vector2::Vector2(float _x, float _y) Possible candidates: - 'Passer::LinearAlgebra::Vector2::Vector2()' at line 44 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Passer::LinearAlgebra::Vector2::Vector2(float right, float forward)' at line 48 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Passer::LinearAlgebra::Vector2::Vector2(Vector3 v)' at line 52 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Passer::LinearAlgebra::Vector2::Vector2(PolarOf< float > v)' at line 55 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2()' at line 43 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2(float right, float forward)' at line 47 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2(Vector3 v)' at line 51 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2(PolarOf< float > v)' at line 54 of file d:/PlatformIO/linear-algebra/Vector2.h d:/PlatformIO/linear-algebra/Vector2.cpp:32: warning: no uniquely matching class member found for Vector2::Vector2(PolarSingle p) Possible candidates: - 'Passer::LinearAlgebra::Vector2::Vector2()' at line 44 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Passer::LinearAlgebra::Vector2::Vector2(float right, float forward)' at line 48 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Passer::LinearAlgebra::Vector2::Vector2(Vector3 v)' at line 52 of file d:/PlatformIO/linear-algebra/Vector2.h - 'Passer::LinearAlgebra::Vector2::Vector2(PolarOf< float > v)' at line 55 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2()' at line 43 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2(float right, float forward)' at line 47 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2(Vector3 v)' at line 51 of file d:/PlatformIO/linear-algebra/Vector2.h + 'Passer::LinearAlgebra::Vector2::Vector2(PolarOf< float > v)' at line 54 of file d:/PlatformIO/linear-algebra/Vector2.h d:/PlatformIO/linear-algebra/Vector3.cpp:33: warning: no uniquely matching class member found for Vector3::Vector3(SphericalOf< float > s) Possible candidates: - 'Passer::LinearAlgebra::Vector3::Vector3()' at line 48 of file d:/PlatformIO/linear-algebra/Vector3.h - 'Passer::LinearAlgebra::Vector3::Vector3(float right, float up, float forward)' at line 53 of file d:/PlatformIO/linear-algebra/Vector3.h - 'Passer::LinearAlgebra::Vector3::Vector3(Vector2 v)' at line 56 of file d:/PlatformIO/linear-algebra/Vector3.h - 'Passer::LinearAlgebra::Vector3::Vector3(SphericalOf< float > v)' at line 60 of file d:/PlatformIO/linear-algebra/Vector3.h + 'Passer::LinearAlgebra::Vector3::Vector3()' at line 47 of file d:/PlatformIO/linear-algebra/Vector3.h + 'Passer::LinearAlgebra::Vector3::Vector3(float right, float up, float forward)' at line 52 of file d:/PlatformIO/linear-algebra/Vector3.h + 'Passer::LinearAlgebra::Vector3::Vector3(Vector2 v)' at line 55 of file d:/PlatformIO/linear-algebra/Vector3.h + 'Passer::LinearAlgebra::Vector3::Vector3(SphericalOf< float > v)' at line 59 of file d:/PlatformIO/linear-algebra/Vector3.h d:/PlatformIO/linear-algebra/Direction.h:43: warning: argument 'v' of command @param is not found in the argument list of Passer::LinearAlgebra::DirectionOf< T >::FromVector3(Vector3 vector) d:/PlatformIO/linear-algebra/Direction.h:43: warning: The following parameter of Passer::LinearAlgebra::DirectionOf::FromVector3(Vector3 vector) is not documented: parameter 'vector' @@ -104,18 +104,51 @@ d:/PlatformIO/linear-algebra/Matrix.h:108: warning: Member RowCount() const (fun d:/PlatformIO/linear-algebra/Matrix.h:109: warning: Member ColCount() const (function) of class Passer::LinearAlgebra::MatrixOf is not documented. d:/PlatformIO/linear-algebra/Matrix.h:57: warning: Member Multiply(const MatrixOf< T > *m1, const MatrixOf< T > *m2, MatrixOf< T > *r) (function) of class Passer::LinearAlgebra::MatrixOf is not documented. d:/PlatformIO/linear-algebra/Matrix.h:63: warning: Member Multiply(const MatrixOf< T > *m, Vector3 v) (function) of class Passer::LinearAlgebra::MatrixOf is not documented. -d:/PlatformIO/linear-algebra/Vector2.h:123: warning: Member operator-=(const Vector2 &v) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. -d:/PlatformIO/linear-algebra/Vector2.h:128: warning: Member operator+=(const Vector2 &v) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. -d:/PlatformIO/linear-algebra/Vector2.h:149: warning: Member operator*=(float f) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. -d:/PlatformIO/linear-algebra/Vector2.h:160: warning: Member operator/=(float f) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. -d:/PlatformIO/linear-algebra/Vector2.h:145: warning: Member operator*(float f, const Vector2 &v) (friend) of struct Passer::LinearAlgebra::Vector2 is not documented. -d:/PlatformIO/linear-algebra/Vector2.h:157: warning: Member operator/(float f, const Vector2 &v) (friend) of struct Passer::LinearAlgebra::Vector2 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:83: warning: Member Forward() const (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:84: warning: Member Up() const (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:85: warning: Member Right() const (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:131: warning: Member operator-=(const Vector3 &v) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:136: warning: Member operator+=(const Vector3 &v) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:157: warning: Member operator*=(float f) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:169: warning: Member operator/=(float f) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:153: warning: Member operator*(float f, const Vector3 &v) (friend) of struct Passer::LinearAlgebra::Vector3 is not documented. -d:/PlatformIO/linear-algebra/Vector3.h:165: warning: Member operator/(float f, const Vector3 &v) (friend) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Polar.h:106: warning: Member operator-=(const PolarOf &v) (function) of class Passer::LinearAlgebra::PolarOf is not documented. +d:/PlatformIO/linear-algebra/Polar.h:111: warning: Member operator+=(const PolarOf &v) (function) of class Passer::LinearAlgebra::PolarOf is not documented. +d:/PlatformIO/linear-algebra/Polar.h:124: warning: Member operator*=(float f) (function) of class Passer::LinearAlgebra::PolarOf is not documented. +d:/PlatformIO/linear-algebra/Polar.h:136: warning: Member operator/=(float f) (function) of class Passer::LinearAlgebra::PolarOf is not documented. +d:/PlatformIO/linear-algebra/Polar.h:121: warning: Member operator*(float f, const PolarOf &v) (friend) of class Passer::LinearAlgebra::PolarOf is not documented. +d:/PlatformIO/linear-algebra/Polar.h:133: warning: Member operator/(float f, const PolarOf &v) (friend) of class Passer::LinearAlgebra::PolarOf is not documented. +d:/PlatformIO/linear-algebra/Polar.h:59: warning: argument 's' of command @param is not found in the argument list of Passer::LinearAlgebra::PolarOf< T >::FromSpherical(SphericalOf< T > v) +d:/PlatformIO/linear-algebra/Polar.h:59: warning: The following parameter of Passer::LinearAlgebra::PolarOf::FromSpherical(SphericalOf< T > v) is not documented: + parameter 'v' +d:/PlatformIO/linear-algebra/Spherical.h:29: warning: Member SphericalOf(float distance, AngleOf< T > horizontal, AngleOf< T > vertical) (function) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:29: warning: Member SphericalOf(float distance, DirectionOf< T > direction) (function) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:99: warning: Member operator-=(const SphericalOf< T > &v) (function) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:104: warning: Member operator+=(const SphericalOf< T > &v) (function) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:117: warning: Member operator*=(float f) (function) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:129: warning: Member operator/=(float f) (function) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:54: warning: Member Rad (variable) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:114: warning: Member operator*(float f, const SphericalOf< T > &v) (friend) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/Spherical.h:126: warning: Member operator/(float f, const SphericalOf< T > &v) (friend) of class Passer::LinearAlgebra::SphericalOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:22: warning: Member SwingTwistOf(DirectionOf< T > swing, AngleOf< T > twist) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:22: warning: Member SwingTwistOf(AngleOf< T > horizontal, AngleOf< T > vertical, AngleOf< T > twist) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:31: warning: Member ToQuaternion() const (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:34: warning: Member ToAngleAxis() const (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:39: warning: Member operator==(const SwingTwistOf< T > d) const (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:55: warning: Member operator*=(const SwingTwistOf< T > &rotation) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:69: warning: Member Normalize() (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:28: warning: Member Degrees(float horizontal, float vertical=0, float twist=0) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:32: warning: Member FromQuaternion(Quaternion q) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:35: warning: Member FromAngleAxis(SphericalOf< T > aa) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:57: warning: Member Inverse(SwingTwistOf< T > rotation) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:67: warning: Member Angle(const SwingTwistOf< T > &r1, const SwingTwistOf< T > &r2) (function) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:21: warning: Member swing (variable) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:22: warning: Member twist (variable) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/SwingTwist.h:37: warning: Member identity (variable) of class Passer::LinearAlgebra::SwingTwistOf is not documented. +d:/PlatformIO/linear-algebra/Vector2.h:122: warning: Member operator-=(const Vector2 &v) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. +d:/PlatformIO/linear-algebra/Vector2.h:127: warning: Member operator+=(const Vector2 &v) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. +d:/PlatformIO/linear-algebra/Vector2.h:148: warning: Member operator*=(float f) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. +d:/PlatformIO/linear-algebra/Vector2.h:159: warning: Member operator/=(float f) (function) of struct Passer::LinearAlgebra::Vector2 is not documented. +d:/PlatformIO/linear-algebra/Vector2.h:144: warning: Member operator*(float f, const Vector2 &v) (friend) of struct Passer::LinearAlgebra::Vector2 is not documented. +d:/PlatformIO/linear-algebra/Vector2.h:156: warning: Member operator/(float f, const Vector2 &v) (friend) of struct Passer::LinearAlgebra::Vector2 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:82: warning: Member Forward() const (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:83: warning: Member Up() const (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:84: warning: Member Right() const (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:130: warning: Member operator-=(const Vector3 &v) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:135: warning: Member operator+=(const Vector3 &v) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:156: warning: Member operator*=(float f) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:168: warning: Member operator/=(float f) (function) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:152: warning: Member operator*(float f, const Vector3 &v) (friend) of struct Passer::LinearAlgebra::Vector3 is not documented. +d:/PlatformIO/linear-algebra/Vector3.h:164: warning: Member operator/(float f, const Vector3 &v) (friend) of struct Passer::LinearAlgebra::Vector3 is not documented. diff --git a/Polar.h b/Polar.h index e1c746f..0e62cf8 100644 --- a/Polar.h +++ b/Polar.h @@ -13,6 +13,8 @@ namespace LinearAlgebra { struct Vector2; template class SphericalOf; +/// @brief A polar vector using an angle in various representations +/// @tparam T The implementation type used for the representation of the angle template class PolarOf { public: /// @brief The distance in meters diff --git a/Quaternion.h b/Quaternion.h index 1979c76..34e0827 100644 --- a/Quaternion.h +++ b/Quaternion.h @@ -7,12 +7,9 @@ #include "Vector3.h" -namespace Passer { -namespace LinearAlgebra { - extern "C" { /// -/// A quaternion +/// A quaternion (C-style) /// /// This is a C-style implementation typedef struct Quat { @@ -35,11 +32,14 @@ typedef struct Quat { } Quat; } +namespace Passer { +namespace LinearAlgebra { + /// /// A quaternion /// struct Quaternion : Quat { - public: +public: /// /// Create a new identity quaternion /// @@ -80,7 +80,7 @@ struct Quaternion : Quat { /// A unit quaternion /// This will preserve the orientation, /// but ensures that it is a unit quaternion. - static Quaternion Normalize(const Quaternion& q); + static Quaternion Normalize(const Quaternion &q); /// /// Convert to euler angles @@ -88,14 +88,14 @@ struct Quaternion : Quat { /// The quaternion to convert /// A vector containing euler angles /// The euler angles performed in the order: Z, X, Y - static Vector3 ToAngles(const Quaternion& q); + static Vector3 ToAngles(const Quaternion &q); /// /// Rotate a vector using this quaterion /// /// The vector to rotate /// The rotated vector - Vector3 operator*(const Vector3& vector) const; + Vector3 operator*(const Vector3 &vector) const; /// /// Multiply this quaternion with another quaternion /// @@ -103,7 +103,7 @@ struct Quaternion : Quat { /// The resulting rotation /// The result will be this quaternion rotated according to /// the give rotation. - Quaternion operator*(const Quaternion& rotation) const; + Quaternion operator*(const Quaternion &rotation) const; /// /// Check the equality of two quaternions @@ -114,7 +114,7 @@ struct Quaternion : Quat { /// themselves. Two quaternions with the same rotational effect may have /// different components. Use Quaternion::Angle to check if the rotations are /// the same. - bool operator==(const Quaternion& quaternion) const; + bool operator==(const Quaternion &quaternion) const; /// /// The inverse of quaterion @@ -129,8 +129,8 @@ struct Quaternion : Quat { /// The look direction /// The up direction /// The look rotation - static Quaternion LookRotation(const Vector3& forward, - const Vector3& upwards); + static Quaternion LookRotation(const Vector3 &forward, + const Vector3 &upwards); /// /// Creates a quaternion with the given forward direction with up = /// Vector3::up @@ -140,7 +140,7 @@ struct Quaternion : Quat { /// For the rotation, Vector::up is used for the up direction. /// Note: if the forward direction == Vector3::up, the result is /// Quaternion::identity - static Quaternion LookRotation(const Vector3& forward); + static Quaternion LookRotation(const Vector3 &forward); /// /// Calculat the rotation from on vector to another @@ -157,8 +157,7 @@ struct Quaternion : Quat { /// The destination rotation /// The maximum amount of degrees to /// rotate The possibly limited rotation - static Quaternion RotateTowards(const Quaternion& from, - const Quaternion& to, + static Quaternion RotateTowards(const Quaternion &from, const Quaternion &to, float maxDegreesDelta); /// @@ -167,13 +166,13 @@ struct Quaternion : Quat { /// The angle /// The axis /// The resulting quaternion - static Quaternion AngleAxis(float angle, const Vector3& axis); + static Quaternion AngleAxis(float angle, const Vector3 &axis); /// /// Convert this quaternion to angle/axis representation /// /// A pointer to the angle for the result /// A pointer to the axis for the result - void ToAngleAxis(float* angle, Vector3* axis); + void ToAngleAxis(float *angle, Vector3 *axis); /// /// Get the angle between two orientations @@ -191,9 +190,8 @@ struct Quaternion : Quat { /// The factor between 0 and 1. /// The resulting rotation /// A factor 0 returns rotation1, factor1 returns rotation2. - static Quaternion Slerp(const Quaternion& rotation1, - const Quaternion& rotation2, - float factor); + static Quaternion Slerp(const Quaternion &rotation1, + const Quaternion &rotation2, float factor); /// /// Unclamped sherical lerp between two rotations /// @@ -203,9 +201,8 @@ struct Quaternion : Quat { /// The resulting rotation /// A factor 0 returns rotation1, factor1 returns rotation2. /// Values outside the 0..1 range will result in extrapolated rotations - static Quaternion SlerpUnclamped(const Quaternion& rotation1, - const Quaternion& rotation2, - float factor); + static Quaternion SlerpUnclamped(const Quaternion &rotation1, + const Quaternion &rotation2, float factor); /// /// Create a rotation from euler angles @@ -263,10 +260,8 @@ struct Quaternion : Quat { /// A pointer to the quaternion for the swing /// result A pointer to the quaternion for the /// twist result - static void GetSwingTwist(Vector3 axis, - Quaternion rotation, - Quaternion* swing, - Quaternion* twist); + static void GetSwingTwist(Vector3 axis, Quaternion rotation, + Quaternion *swing, Quaternion *twist); /// /// Calculate the dot product of two quaternions @@ -276,20 +271,20 @@ struct Quaternion : Quat { /// static float Dot(Quaternion rotation1, Quaternion rotation2); - private: +private: float GetLength() const; float GetLengthSquared() const; - static float GetLengthSquared(const Quaternion& q); + static float GetLengthSquared(const Quaternion &q); - void ToAxisAngleRad(const Quaternion& q, Vector3* const axis, float* angle); + void ToAxisAngleRad(const Quaternion &q, Vector3 *const axis, float *angle); static Quaternion FromEulerRad(Vector3 euler); static Quaternion FromEulerRadXYZ(Vector3 euler); Vector3 xyz() const; }; -} // namespace LinearAlgebra -} // namespace Passer +} // namespace LinearAlgebra +} // namespace Passer using namespace Passer::LinearAlgebra; #endif diff --git a/README.md b/README.md index 35bf50f..afc4fbb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,21 @@ -\mainpage Vector Algebra +\mainpage Linear Algebra -Vector algebra library +Linear algebra library Main components --------------- -* [Vector3](struct_passer_1_1_linear_algebra_1_1_vector3.html) -* [Quaternion](struct_passer_1_1_linear_algebra_1_1_quaternion.html) +Carthesian coordinate systems +* [Vector3](#Passer::LinearAlgebra::Vector3): A 3D carthesian vector +* [Vector2](#Passer::LinearAlgebra::Vector2): A 2D carthesian vector -* [Vector2](https://serrarens.nl/apis/LinearAlgebra/struct_vector2.html) +Other coodinate systems +* [Polar](#Passer::LinearAlgebra::PolarOf): A 2D polar vector +* [Spherical](#Passer::LinearAlgebra::SphericalOf): A 3D spherical vector -* [Polar](https://passervr.com/apis/LinearAlgebra/struct_polar.html) +Rotations +* [Quaternion](#Passer::LinearAlgebra::Quaternion): A quaternion rotation +* [SwingTwist](#Passer::LinearAlgebra::SwingTwistOf): A swing/twist angular rotation + +Basics +* [Angle](#Passer::LinearAlgebra::AngleOf): An angle +* [Direction](#Passer::LinearAlgebra::DirectionOf): A direction using angles diff --git a/Spherical.h b/Spherical.h index 4d803bd..e4d6682 100644 --- a/Spherical.h +++ b/Spherical.h @@ -13,6 +13,8 @@ namespace LinearAlgebra { struct Vector3; template class PolarOf; +/// @brief A spherical vector using angles in various representations +/// @tparam T The implementation type used for the representations of the agles template class SphericalOf { public: /// @brief The distance in meters diff --git a/SwingTwist.h b/SwingTwist.h index 7fac16a..df1d03d 100644 --- a/SwingTwist.h +++ b/SwingTwist.h @@ -13,9 +13,11 @@ namespace Passer { namespace LinearAlgebra { -template -class SwingTwistOf { - public: +/// @brief An orientation using swing and twist angles in various +/// representations +/// @tparam T The implmentation type used for the representation of the angles +template class SwingTwistOf { +public: DirectionOf swing; AngleOf twist; @@ -23,8 +25,7 @@ class SwingTwistOf { SwingTwistOf(DirectionOf swing, AngleOf twist); SwingTwistOf(AngleOf horizontal, AngleOf vertical, AngleOf twist); - static SwingTwistOf Degrees(float horizontal, - float vertical = 0, + static SwingTwistOf Degrees(float horizontal, float vertical = 0, float twist = 0); Quaternion ToQuaternion() const; @@ -42,7 +43,7 @@ class SwingTwistOf { /// /// The vector to rotate /// The rotated vector - SphericalOf operator*(const SphericalOf& vector) const; + SphericalOf operator*(const SphericalOf &vector) const; /// /// Multiply this rotation with another rotation /// @@ -50,8 +51,8 @@ class SwingTwistOf { /// The resulting swing/twist rotation /// The result will be this rotation rotated according to /// the give rotation. - SwingTwistOf operator*(const SwingTwistOf& rotation) const; - SwingTwistOf operator*=(const SwingTwistOf& rotation); + SwingTwistOf operator*(const SwingTwistOf &rotation) const; + SwingTwistOf operator*=(const SwingTwistOf &rotation); static SwingTwistOf Inverse(SwingTwistOf rotation); @@ -61,9 +62,9 @@ class SwingTwistOf { /// The angle /// The axis /// The resulting quaternion - static SwingTwistOf AngleAxis(float angle, const DirectionOf& axis); + static SwingTwistOf AngleAxis(float angle, const DirectionOf &axis); - static AngleOf Angle(const SwingTwistOf& r1, const SwingTwistOf& r2); + static AngleOf Angle(const SwingTwistOf &r1, const SwingTwistOf &r2); void Normalize(); }; @@ -71,8 +72,8 @@ class SwingTwistOf { using SwingTwistSingle = SwingTwistOf; using SwingTwist16 = SwingTwistOf; -} // namespace LinearAlgebra -} // namespace Passer +} // namespace LinearAlgebra +} // namespace Passer using namespace Passer::LinearAlgebra; #endif diff --git a/Vector2.h b/Vector2.h index eabac98..8b072d3 100644 --- a/Vector2.h +++ b/Vector2.h @@ -9,7 +9,7 @@ extern "C" { /// -/// 2-dimensional Vector representation +/// 2-dimensional Vector representation (C-style) /// /// This is a C-style implementation /// This uses the right-handed coordinate system. @@ -31,9 +31,8 @@ namespace LinearAlgebra { struct Vector3; template class PolarOf; -// using Polar = PolarOf -/// @brief A 2=dimensional vector +/// @brief A 2-dimensional vector /// @remark This uses the right=handed carthesian coordinate system. /// @note This implementation intentionally avoids the use of x and y struct Vector2 : Vec2 { diff --git a/Vector3.h b/Vector3.h index 9839659..341801a 100644 --- a/Vector3.h +++ b/Vector3.h @@ -7,15 +7,9 @@ #include "Vector2.h" -namespace Passer { -namespace LinearAlgebra { - -// struct Spherical; -template class SphericalOf; - extern "C" { /// -/// 3-dimensional Vector representation +/// 3-dimensional Vector representation (C-style) /// /// This is a C-style implementation /// This uses the right-handed coordinate system. @@ -37,6 +31,11 @@ protected: } Vec3; } +namespace Passer { +namespace LinearAlgebra { + +template class SphericalOf; + /// @brief A 3-dimensional vector /// @remark This uses a right-handed carthesian coordinate system. /// @note This implementation intentionally avoids the use of x, y and z values.