Updated Vector documentation.
This commit is contained in:
parent
a502e84764
commit
414d242701
@ -38,33 +38,28 @@ 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
|
* This is a generl purpose vector class designed to represent both positions and directions. It is templatised
|
||||||
* generic but so far had only been tested with vectors of size 2 and 3. Also note
|
* on both size and data type but note that some of the operations do not make sense with integer types. For
|
||||||
* that some of the operations do not make sense with integer types, for example it
|
* example it does not make conceptual sense to try and normalise an integer Vector.
|
||||||
* does not make conceptual sense to try and normalise an integer Vector.
|
*
|
||||||
|
* Every Vector must have at at least two elements, and the first four elements of any vector are known as the
|
||||||
|
* X, Y, Z and W elements. Note that W is last even though it comes before X in the alphabet. These elements can
|
||||||
|
* be accessed through getX(), setX(), getY(), setY(), getZ(), setZ(), getW() and setW(), while other elements
|
||||||
|
* can be accessed through getElemen() and setElement().
|
||||||
*
|
*
|
||||||
* The elements of the Vector are accessed via the overloaded () operator which takes
|
* This class includes a number of common mathematical operations (addition, subtraction, etc) as well as vector
|
||||||
* an index indicating the element to fetch. They are set using the set() function which
|
* specific operations such as the dot and cross products. Note that this class is also templatised on an
|
||||||
* takes an index indicating the element to set and a new value for that element. For
|
* OperationType which is used for many internal calculations and some results. For example, the square of a
|
||||||
* convienience, the functions getX(), setX(), getY(), setY(), getZ(), setZ(), getw() and setW()
|
* vector's length will always be an integer if all the elements are integers, but the value might be outside
|
||||||
* do the same thing for the first 4 elements of the Vector.
|
* that which can be represented by the StorageType. You don't need to worry about this as long as you are using
|
||||||
*
|
* the built in typedefs for common configurations.
|
||||||
* A variety of overloaded operators are also provided for comparison and arithmetic
|
*
|
||||||
* operations. For most of these arithmetic operators only the unary versions are
|
* Typedefs are provided for 2, 3 and 4 dimensional vector with int8_t, uint8_t, int16_t, uint6_t, int32_t,
|
||||||
* documented below - however often binary versions are also generated by std::operators.
|
* uint32_t, float and double types. These typedefs are used as follows:
|
||||||
*
|
|
||||||
* 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
|
* \code
|
||||||
* Vector2DInt4 test(1,2); //Declares a 2 dimensional Vector of type int4.
|
* Vector2DInt32 test(1,2); //Declares a 2 dimensional Vector of type int32_t.
|
||||||
* \endcode
|
* \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>
|
template <uint32_t Size, typename StorageType, typename OperationType>
|
||||||
class Vector
|
class Vector
|
||||||
|
Loading…
x
Reference in New Issue
Block a user