From 48729670c16525fe5c0b53587569ae3a6c4574b4 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Wed, 7 Aug 2019 01:55:19 +0000 Subject: [PATCH] Cleaning up header comments. --- include/wrmath/geom/quaternion.h | 9 +-------- include/wrmath/geom/vector.h | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/include/wrmath/geom/quaternion.h b/include/wrmath/geom/quaternion.h index 223634a..6755bfe 100644 --- a/include/wrmath/geom/quaternion.h +++ b/include/wrmath/geom/quaternion.h @@ -38,7 +38,7 @@ namespace geom { /// Like vectors, quaternions carry an internal tolerance value ε that is used for /// floating point comparisons. The wr::math namespace contains the default values /// used for this; generally, a tolerance of 0.0001 is considered appropriate for -/// the uses of this library. MATHJThe tolerance can be explicitly set with the +/// the uses of this library. The tolerance can be explicitly set with the /// setEpsilon method. template class Quaternion { @@ -465,13 +465,6 @@ ShortestSLERP(Quaternion p, Quaternion q, T t) void Quaternion_SelfTest(); -// Helpful references for understanding quaternions: -// + "Intro to Quaternions" - https://www.youtube.com/watch?v=fKIss4EV6ME -// 15 minutes into this video I had a more intuitive understanding. -// + "Quaternions and Rotations" - http://graphics.stanford.edu/courses/cs348a-17-winter/Papers/quaternion.pdf -// + "Understanding Quaternions" - http://www.chrobotics.com/library/understanding-quaternions - - } // namespace geom } // namespace wr diff --git a/include/wrmath/geom/vector.h b/include/wrmath/geom/vector.h index 4339803..a86e65c 100644 --- a/include/wrmath/geom/vector.h +++ b/include/wrmath/geom/vector.h @@ -25,10 +25,13 @@ namespace geom { /// @brief Vectors represent a direction and magnitude. /// /// Vector provides a standard interface for dimensionless fixed-size -/// vectors. Once instantiated, they cannot be modified. Note that while -/// the type is generic, it's intended to be used with floating-point -/// types. They can be indexed like arrays, and they contain an epsilon -/// value that defines a tolerance for equality. +/// vectors. Once instantiated, they cannot be modified. +/// +/// Note that while the class is templated, it's intended to be used with +/// floating-point types. +/// +/// Vectors can be indexed like arrays, and they contain an epsilon value +/// that defines a tolerance for equality. template class Vector { public: @@ -314,9 +317,18 @@ public: /// Support array indexing into vector. + /// + /// Note that the values of the vector cannot be modified. Instead, + /// it's required to do something like the following: + /// + /// ``` + /// Vector3d a {1.0, 2.0, 3.0}; + /// Vector3d b {a[0], a[1]*2.0, a[2]}; + /// ``` + /// /// @param i The component index. /// @return The value of the vector component at i. - T + const T& operator[](size_t i) const { return this->arr[i];