Changed documentation style to match that used by KDE/Kate (for Doxygen syntax highlighting)
This commit is contained in:
parent
20a6095d75
commit
8b91e55c84
@ -36,35 +36,35 @@ freely, subject to the following restrictions:
|
||||
namespace PolyVox
|
||||
{
|
||||
/**
|
||||
Represents a vector in space.
|
||||
|
||||
This Vector class is templated on both size and data type. It is designed to be
|
||||
generic but so far had only been tested with vectors of size 2 and 3. Also note
|
||||
that some of the operations do not make sense with integer types, for example it
|
||||
does not make conceptual sense to try and normalise an integer Vector.
|
||||
|
||||
The elements of the Vector are accessed via the overloaded () operator which takes
|
||||
an index indicating the element to fetch. They are set using the set() function which
|
||||
takes an index indicating the element to set and a new value for that element. For
|
||||
convienience, the functions getX(), setX(), getY(), setY(), getZ(), setZ(), getw() and setW()
|
||||
do the same thing for the first 4 elements of the Vector.
|
||||
|
||||
A variety of overloaded operators are also provided for comparison and arithmetic
|
||||
operations. For most of these arithmetic operators only the unary versions are
|
||||
documented below - however often binary versions are also generated by std::operators.
|
||||
|
||||
Lastly, note that for convienience a set of typedefs are included for 2 and 3 dimensional
|
||||
vectors with type float, double, int32_t, and uint32_t. They are used as follows:
|
||||
|
||||
\code
|
||||
Vector2DInt4 test(1,2); //Declares a 2 dimensional Vector of type int4.
|
||||
\endcode
|
||||
|
||||
Extra things to mention when I when I fill this out shortly:
|
||||
Vector must have at least two elements.
|
||||
Use of 'OperationType'
|
||||
Floating point return values are always single precision
|
||||
Component order is WYZW
|
||||
* Represents a vector in space.
|
||||
*
|
||||
* This Vector class is templated on both size and data type. It is designed to be
|
||||
* generic but so far had only been tested with vectors of size 2 and 3. Also note
|
||||
* that some of the operations do not make sense with integer types, for example it
|
||||
* does not make conceptual sense to try and normalise an integer Vector.
|
||||
*
|
||||
* The elements of the Vector are accessed via the overloaded () operator which takes
|
||||
* an index indicating the element to fetch. They are set using the set() function which
|
||||
* takes an index indicating the element to set and a new value for that element. For
|
||||
* convienience, the functions getX(), setX(), getY(), setY(), getZ(), setZ(), getw() and setW()
|
||||
* do the same thing for the first 4 elements of the Vector.
|
||||
*
|
||||
* A variety of overloaded operators are also provided for comparison and arithmetic
|
||||
* operations. For most of these arithmetic operators only the unary versions are
|
||||
* documented below - however often binary versions are also generated by std::operators.
|
||||
*
|
||||
* Lastly, note that for convienience a set of typedefs are included for 2 and 3 dimensional
|
||||
* vectors with type float, double, int32_t, and uint32_t. They are used as follows:
|
||||
*
|
||||
* \code
|
||||
* Vector2DInt4 test(1,2); //Declares a 2 dimensional Vector of type int4.
|
||||
* \endcode
|
||||
*
|
||||
* Extra things to mention when I when I fill this out shortly:
|
||||
* Vector must have at least two elements.
|
||||
* Use of 'OperationType'
|
||||
* Floating point return values are always single precision
|
||||
* Component order is WYZW
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
class Vector
|
||||
|
@ -25,7 +25,7 @@ namespace PolyVox
|
||||
{
|
||||
//-------------------------- Constructors, etc ---------------------------------
|
||||
/**
|
||||
Creates a Vector object but does not initialise it.
|
||||
* Creates a Vector object but does not initialise it.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
Vector<Size, StorageType, OperationType>::Vector(void)
|
||||
@ -33,8 +33,8 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a Vector object and initialises all components with the given value.
|
||||
\param tFillValue The value to write to every component.
|
||||
* Creates a Vector object and initialises all components with the given value.
|
||||
* \param tFillValue The value to write to every component.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType>::Vector(StorageType tFillValue)
|
||||
@ -46,9 +46,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a Vector object and initialises it with given values.
|
||||
\param x The X component to set.
|
||||
\param y The Y component to set.
|
||||
* Creates a Vector object and initialises it with given values.
|
||||
* \param x The X component to set.
|
||||
* \param y The Y component to set.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType>::Vector(StorageType x, StorageType y)
|
||||
@ -62,10 +62,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a Vector3D object and initialises it with given values.
|
||||
\param x The X component to set.
|
||||
\param y The Y component to set.
|
||||
\param z the Z component to set.
|
||||
* Creates a Vector3D object and initialises it with given values.
|
||||
* \param x The X component to set.
|
||||
* \param y The Y component to set.
|
||||
* \param z the Z component to set.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType>::Vector(StorageType x, StorageType y, StorageType z)
|
||||
@ -81,11 +81,11 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Creates a Vector3D object and initialises it with given values.
|
||||
\param x The X component to set.
|
||||
\param y The Y component to set.
|
||||
\param z The Z component to set.
|
||||
\param w The W component to set.
|
||||
* Creates a Vector3D object and initialises it with given values.
|
||||
* \param x The X component to set.
|
||||
* \param y The Y component to set.
|
||||
* \param z The Z component to set.
|
||||
* \param w The W component to set.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType>::Vector(StorageType x, StorageType y, StorageType z, StorageType w)
|
||||
@ -101,8 +101,8 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Copy constructor builds object based on object passed as parameter.
|
||||
\param vector A reference to the Vector to be copied.
|
||||
* Copy constructor builds object based on object passed as parameter.
|
||||
* \param vector A reference to the Vector to be copied.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
Vector<Size, StorageType, OperationType>::Vector(const Vector<Size, StorageType, OperationType>& vector)
|
||||
@ -111,13 +111,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
This copy constructor allows casting between vectors with different data types.
|
||||
It makes it possible to use code such as:
|
||||
|
||||
Vector3DDouble v3dDouble(1.0,2.0,3.0);
|
||||
Vector3DFloat v3dFloat = static_cast<Vector3DFloat>(v3dDouble); //Casting
|
||||
|
||||
\param vector A reference to the Vector to be copied.
|
||||
* This copy constructor allows casting between vectors with different data types.
|
||||
* It makes it possible to use code such as:
|
||||
*
|
||||
* Vector3DDouble v3dDouble(1.0,2.0,3.0);
|
||||
* Vector3DFloat v3dFloat = static_cast<Vector3DFloat>(v3dDouble); //Casting
|
||||
*
|
||||
* \param vector A reference to the Vector to be copied.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
template <typename CastType>
|
||||
@ -130,7 +130,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Destroys the Vector.
|
||||
* Destroys the Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
Vector<Size, StorageType, OperationType>::~Vector(void)
|
||||
@ -146,9 +146,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Assignment operator copies each element of first Vector to the second.
|
||||
\param rhs Vector to assign to.
|
||||
\return A reference to the result to allow chaining.
|
||||
* Assignment operator copies each element of first Vector to the second.
|
||||
* \param rhs Vector to assign to.
|
||||
* \return A reference to the result to allow chaining.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator=(const Vector<Size, StorageType, OperationType>& rhs)
|
||||
@ -162,10 +162,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether two Vectors are equal.
|
||||
\param rhs The Vector to compare to.
|
||||
\return true if the Vectors match.
|
||||
\see operator!=
|
||||
* Checks whether two Vectors are equal.
|
||||
* \param rhs The Vector to compare to.
|
||||
* \return true if the Vectors match.
|
||||
* \see operator!=
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline bool Vector<Size, StorageType, OperationType>::operator==(const Vector<Size, StorageType, OperationType> &rhs) const
|
||||
@ -183,10 +183,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether two Vectors are not equal.
|
||||
\param rhs The Vector to compare to.
|
||||
\return true if the Vectors do not match.
|
||||
\see operator==
|
||||
* Checks whether two Vectors are not equal.
|
||||
* \param rhs The Vector to compare to.
|
||||
* \return true if the Vectors do not match.
|
||||
* \see operator==
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline bool Vector<Size, StorageType, OperationType>::operator!=(const Vector<Size, StorageType, OperationType> &rhs) const
|
||||
@ -195,13 +195,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether this vector is less than the parameter. The metric is
|
||||
meaningless but it allows Vectors to me used as key in sdt::map, etc.
|
||||
This function is deprecated. You should specify a seperate comparator to the std:map if you need one.
|
||||
\param rhs The Vector to compare to.
|
||||
\return true if this is less than the parameter
|
||||
\see operator!=
|
||||
\deprecated
|
||||
* Checks whether this vector is less than the parameter. The metric is
|
||||
* meaningless but it allows Vectors to me used as key in sdt::map, etc.
|
||||
* This function is deprecated. You should specify a seperate comparator to the std:map if you need one.
|
||||
* \param rhs The Vector to compare to.
|
||||
* \return true if this is less than the parameter
|
||||
* \see operator!=
|
||||
* \deprecated
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline bool Vector<Size, StorageType, OperationType>::operator<(const Vector<Size, StorageType, OperationType> &rhs) const
|
||||
@ -217,9 +217,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Addition operator adds corresponding elements of the two Vectors.
|
||||
\param rhs The Vector to add
|
||||
\return The resulting Vector.
|
||||
* Addition operator adds corresponding elements of the two Vectors.
|
||||
* \param rhs The Vector to add
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator+=(const Vector<Size, StorageType, OperationType>& rhs)
|
||||
@ -232,9 +232,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Subtraction operator subtracts corresponding elements of one Vector from the other.
|
||||
\param rhs The Vector to subtract
|
||||
\return The resulting Vector.
|
||||
* Subtraction operator subtracts corresponding elements of one Vector from the other.
|
||||
* \param rhs The Vector to subtract
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator-=(const Vector<Size, StorageType, OperationType>& rhs)
|
||||
@ -247,9 +247,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Multiplication operator multiplies corresponding elements of the two Vectors.
|
||||
\param rhs The Vector to multiply by
|
||||
\return The resulting Vector.
|
||||
* Multiplication operator multiplies corresponding elements of the two Vectors.
|
||||
* \param rhs The Vector to multiply by
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator*=(const Vector<Size, StorageType, OperationType>& rhs)
|
||||
@ -262,9 +262,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Division operator divides corresponding elements of one Vector by the other.
|
||||
\param rhs The Vector to divide by
|
||||
\return The resulting Vector.
|
||||
* Division operator divides corresponding elements of one Vector by the other.
|
||||
* \param rhs The Vector to divide by
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator/=(const Vector<Size, StorageType, OperationType>& rhs)
|
||||
@ -277,9 +277,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Multiplication operator multiplies each element of the Vector by a number.
|
||||
\param rhs The number the Vector is multiplied by.
|
||||
\return The resulting Vector.
|
||||
* Multiplication operator multiplies each element of the Vector by a number.
|
||||
* \param rhs The number the Vector is multiplied by.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator*=(const StorageType& rhs)
|
||||
@ -292,9 +292,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Division operator divides each element of the Vector by a number.
|
||||
\param rhs The number the Vector is divided by.
|
||||
\return The resulting Vector.
|
||||
* Division operator divides each element of the Vector by a number.
|
||||
* \param rhs The number the Vector is divided by.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType>& Vector<Size, StorageType, OperationType>::operator/=(const StorageType& rhs)
|
||||
@ -307,10 +307,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Addition operator adds corresponding elements of the two Vectors.
|
||||
\param lhs The Vector to add to.
|
||||
\param rhs The Vector to add.
|
||||
\return The resulting Vector.
|
||||
* Addition operator adds corresponding elements of the two Vectors.
|
||||
* \param lhs The Vector to add to.
|
||||
* \param rhs The Vector to add.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType> operator+(const Vector<Size,StorageType,OperationType>& lhs, const Vector<Size,StorageType,OperationType>& rhs)
|
||||
@ -321,10 +321,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Subtraction operator subtracts corresponding elements of one Vector from the other.
|
||||
\param lhs The Vector to subtract from.
|
||||
\param rhs The Vector to subtract.
|
||||
\return The resulting Vector.
|
||||
* Subtraction operator subtracts corresponding elements of one Vector from the other.
|
||||
* \param lhs The Vector to subtract from.
|
||||
* \param rhs The Vector to subtract.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType> operator-(const Vector<Size,StorageType,OperationType>& lhs, const Vector<Size,StorageType,OperationType>& rhs)
|
||||
@ -335,10 +335,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Multiplication operator mulitplies corresponding elements of the two Vectors.
|
||||
\param lhs The Vector to multiply.
|
||||
\param rhs The Vector to multiply by.
|
||||
\return The resulting Vector.
|
||||
* Multiplication operator mulitplies corresponding elements of the two Vectors.
|
||||
* \param lhs The Vector to multiply.
|
||||
* \param rhs The Vector to multiply by.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType> operator*(const Vector<Size,StorageType,OperationType>& lhs, const Vector<Size,StorageType,OperationType>& rhs)
|
||||
@ -349,10 +349,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Division operator divides corresponding elements of one Vector by the other.
|
||||
\param lhs The Vector to divide.
|
||||
\param rhs The Vector to divide by.
|
||||
\return The resulting Vector.
|
||||
* Division operator divides corresponding elements of one Vector by the other.
|
||||
* \param lhs The Vector to divide.
|
||||
* \param rhs The Vector to divide by.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType> operator/(const Vector<Size,StorageType,OperationType>& lhs, const Vector<Size,StorageType,OperationType>& rhs)
|
||||
@ -363,10 +363,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Multiplication operator multiplies each element of the Vector by a number.
|
||||
\param lhs The Vector to multiply.
|
||||
\param rhs The number the Vector is multiplied by.
|
||||
\return The resulting Vector.
|
||||
* Multiplication operator multiplies each element of the Vector by a number.
|
||||
* \param lhs The Vector to multiply.
|
||||
* \param rhs The number the Vector is multiplied by.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType> operator*(const Vector<Size,StorageType,OperationType>& lhs, const StorageType& rhs)
|
||||
@ -377,10 +377,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Division operator divides each element of the Vector by a number.
|
||||
\param lhs The Vector to divide.
|
||||
\param rhs The number the Vector is divided by.
|
||||
\return The resulting Vector.
|
||||
* Division operator divides each element of the Vector by a number.
|
||||
* \param lhs The Vector to divide.
|
||||
* \param rhs The number the Vector is divided by.
|
||||
* \return The resulting Vector.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
Vector<Size,StorageType,OperationType> operator/(const Vector<Size,StorageType,OperationType>& lhs, const StorageType& rhs)
|
||||
@ -391,10 +391,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Enables the Vector to be used intuitively with output streams such as cout.
|
||||
\param os The output stream to write to.
|
||||
\param vector The Vector to write to the stream.
|
||||
\return A reference to the output stream to allow chaining.
|
||||
* Enables the Vector to be used intuitively with output streams such as cout.
|
||||
* \param os The output stream to write to.
|
||||
* \param vector The Vector to write to the stream.
|
||||
* \return A reference to the output stream to allow chaining.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
std::ostream& operator<<(std::ostream& os, const Vector<Size, StorageType, OperationType>& vector)
|
||||
@ -413,9 +413,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the element at the given position.
|
||||
\param index The index of the element to return.
|
||||
\return The element.
|
||||
* Returns the element at the given position.
|
||||
* \param index The index of the element to return.
|
||||
* \return The element.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline StorageType Vector<Size, StorageType, OperationType>::getElement(uint32_t index) const
|
||||
@ -425,7 +425,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector.
|
||||
* \return A const reference to the X component of a 1, 2, 3, or 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline StorageType Vector<Size, StorageType, OperationType>::getX(void) const
|
||||
@ -434,7 +434,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\return A const reference to the Y component of a 2, 3, or 4 dimensional Vector.
|
||||
* \return A const reference to the Y component of a 2, 3, or 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline StorageType Vector<Size, StorageType, OperationType>::getY(void) const
|
||||
@ -443,7 +443,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\return A const reference to the Z component of a 3 or 4 dimensional Vector.
|
||||
* \return A const reference to the Z component of a 3 or 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline StorageType Vector<Size, StorageType, OperationType>::getZ(void) const
|
||||
@ -456,7 +456,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\return A const reference to the W component of a 4 dimensional Vector.
|
||||
* \return A const reference to the W component of a 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline StorageType Vector<Size, StorageType, OperationType>::getW(void) const
|
||||
@ -469,8 +469,8 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\param index The index of the element to set.
|
||||
\param tValue The new value for the element.
|
||||
* \param index The index of the element to set.
|
||||
* \param tValue The new value for the element.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline void Vector<Size, StorageType, OperationType>::setElement(uint32_t index, StorageType tValue)
|
||||
@ -480,9 +480,9 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Sets several elements of a vector at once.
|
||||
\param x The X component to set.
|
||||
\param y The Y component to set.
|
||||
* Sets several elements of a vector at once.
|
||||
* \param x The X component to set.
|
||||
* \param y The Y component to set.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
inline void Vector<Size,StorageType,OperationType>::setElements(StorageType x, StorageType y)
|
||||
@ -493,10 +493,10 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Sets several elements of a vector at once.
|
||||
\param x The X component to set.
|
||||
\param y The Y component to set.
|
||||
\param z The Z component to set.
|
||||
* Sets several elements of a vector at once.
|
||||
* \param x The X component to set.
|
||||
* \param y The Y component to set.
|
||||
* \param z The Z component to set.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
inline void Vector<Size,StorageType,OperationType>::setElements(StorageType x, StorageType y, StorageType z)
|
||||
@ -510,11 +510,11 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Sets several elements of a vector at once.
|
||||
\param x The X component to set.
|
||||
\param y The Y component to set.
|
||||
\param z The Z component to set.
|
||||
\param w The W component to set.
|
||||
* Sets several elements of a vector at once.
|
||||
* \param x The X component to set.
|
||||
* \param y The Y component to set.
|
||||
* \param z The Z component to set.
|
||||
* \param w The W component to set.
|
||||
*/
|
||||
template <uint32_t Size,typename StorageType, typename OperationType>
|
||||
inline void Vector<Size,StorageType,OperationType>::setElements(StorageType x, StorageType y, StorageType z, StorageType w)
|
||||
@ -529,7 +529,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector.
|
||||
* \param tX The new value for the X component of a 1, 2, 3, or 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline void Vector<Size, StorageType, OperationType>::setX(StorageType tX)
|
||||
@ -538,7 +538,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\param tY The new value for the Y component of a 2, 3, or 4 dimensional Vector.
|
||||
* \param tY The new value for the Y component of a 2, 3, or 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline void Vector<Size, StorageType, OperationType>::setY(StorageType tY)
|
||||
@ -547,7 +547,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\param tZ The new value for the Z component of a 3 or 4 dimensional Vector.
|
||||
* \param tZ The new value for the Z component of a 3 or 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline void Vector<Size, StorageType, OperationType>::setZ(StorageType tZ)
|
||||
@ -559,7 +559,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\param tW The new value for the W component of a 4 dimensional Vector.
|
||||
* \param tW The new value for the W component of a 4 dimensional Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline void Vector<Size, StorageType, OperationType>::setW(StorageType tW)
|
||||
@ -571,8 +571,8 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer.
|
||||
\return The length of the Vector.
|
||||
* \note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer.
|
||||
* \return The length of the Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline float Vector<Size, StorageType, OperationType>::length(void) const
|
||||
@ -581,7 +581,7 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
\return The squared length of the Vector.
|
||||
* \return The squared length of the Vector.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline OperationType Vector<Size, StorageType, OperationType>::lengthSquared(void) const
|
||||
@ -595,13 +595,13 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
This function is commutative, such that a.angleTo(b) == b.angleTo(a). The angle
|
||||
returned is in radians and varies between 0 and 3.14(pi). It is always positive.
|
||||
|
||||
\note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer.
|
||||
|
||||
\param vector The Vector to find the angle to.
|
||||
\return The angle between them in radians.
|
||||
* This function is commutative, such that a.angleTo(b) == b.angleTo(a). The angle
|
||||
* returned is in radians and varies between 0 and 3.14(pi). It is always positive.
|
||||
*
|
||||
* \note This function always returns a single precision floating point value, even when the StorageType is a double precision floating point value or an integer.
|
||||
*
|
||||
* \param vector The Vector to find the angle to.
|
||||
* \return The angle between them in radians.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline float Vector<Size, StorageType, OperationType>::angleTo(const Vector<Size, StorageType, OperationType>& vector) const
|
||||
@ -610,16 +610,16 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used to calculate the cross product of two Vectors.
|
||||
The cross product is the Vector which is perpendicular to the two
|
||||
given Vectors. It is worth remembering that, unlike the dot product,
|
||||
it is not commutative. E.g a.b != b.a. The cross product obeys the
|
||||
right-hand rule such that if the two vectors are given by the index
|
||||
finger and middle finger respectively then the cross product is given
|
||||
by the thumb.
|
||||
\param vector The vector to cross with this
|
||||
\return The value of the cross product.
|
||||
\see dot()
|
||||
* This function is used to calculate the cross product of two Vectors.
|
||||
* The cross product is the Vector which is perpendicular to the two
|
||||
* given Vectors. It is worth remembering that, unlike the dot product,
|
||||
* it is not commutative. E.g a.b != b.a. The cross product obeys the
|
||||
* right-hand rule such that if the two vectors are given by the index
|
||||
* finger and middle finger respectively then the cross product is given
|
||||
* by the thumb.
|
||||
* \param vector The vector to cross with this
|
||||
* \return The value of the cross product.
|
||||
* \see dot()
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline Vector<Size, StorageType, OperationType> Vector<Size, StorageType, OperationType>::cross(const Vector<Size, StorageType, OperationType>& vector) const
|
||||
@ -631,11 +631,11 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Calculates the dot product of the Vector and the parameter.
|
||||
This function is commutative, such that a.dot(b) == b.dot(a).
|
||||
\param rhs The Vector to find the dot product with.
|
||||
\return The value of the dot product.
|
||||
\see cross()
|
||||
* Calculates the dot product of the Vector and the parameter.
|
||||
* This function is commutative, such that a.dot(b) == b.dot(a).
|
||||
* \param rhs The Vector to find the dot product with.
|
||||
* \return The value of the dot product.
|
||||
* \see cross()
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline OperationType Vector<Size, StorageType, OperationType>::dot(const Vector<Size, StorageType, OperationType>& rhs) const
|
||||
@ -649,11 +649,11 @@ namespace PolyVox
|
||||
}
|
||||
|
||||
/**
|
||||
Divides the i, j, and k components by the length to give a Vector of length 1.0. If the vector is
|
||||
very short (or zero) then a divide by zero may cause elements to take on invalid values. You may
|
||||
want to check for this before normalising.
|
||||
|
||||
\note You should not attempt to normalise a vector whose StorageType is an integer.
|
||||
* Divides the i, j, and k components by the length to give a Vector of length 1.0. If the vector is
|
||||
* very short (or zero) then a divide by zero may cause elements to take on invalid values. You may
|
||||
* want to check for this before normalising.
|
||||
*
|
||||
* \note You should not attempt to normalise a vector whose StorageType is an integer.
|
||||
*/
|
||||
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||
inline void Vector<Size, StorageType, OperationType>::normalise(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user