Cleaning up header comments.

This commit is contained in:
Kyle Isom 2019-08-07 01:55:19 +00:00
parent bbaa497a71
commit 48729670c1
2 changed files with 18 additions and 13 deletions

View File

@ -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<typename T>
class Quaternion {
@ -465,13 +465,6 @@ ShortestSLERP(Quaternion<T> p, Quaternion<T> 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

View File

@ -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 <typename T, size_t N>
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];