Add and cleanup some of the API documentation.

This commit is contained in:
Matt Williams
2010-07-05 15:57:24 +00:00
parent 2818311a94
commit e8b10fd2b9
8 changed files with 89 additions and 40 deletions

View File

@ -34,7 +34,31 @@ freely, subject to the following restrictions:
namespace PolyVox
{
///Represents a vector in space.
/**
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
*/
template <uint32_t Size, typename Type>
class Vector
{