IVec< T, N > Class Template Reference
Detailed Description
template<typename T, int N>
class cy::IVec< T, N >
class cy::IVec< T, N >
A general class for N-dimensional integer vectors.
#include <cyIVector.h>
Public Member Functions | |
Constructors | |
| IVec (T const *p) | |
| IVec (T v) | |
| template<typename S > | |
| IVec (IVec< S, N > const &p) | |
| template<int M> | |
| IVec (IVec< T, M > const &p) | |
| template<typename S , int M> | |
| IVec (IVec< S, M > const &p) | |
| IVec (IVec2< T > const &p) | |
| IVec (IVec3< T > const &p) | |
| IVec (IVec4< T > const &p) | |
| template<typename S > | |
| IVec (IVec2< S > const &p) | |
| template<typename S > | |
| IVec (IVec3< S > const &p) | |
| template<typename S > | |
| IVec (IVec4< S > const &p) | |
| template<typename P > | |
| IVec (P const &p) | |
Set & Get value methods | |
| void | Zero () |
| Sets the coordinates as zero. | |
| void | Get (T *p) const |
| Puts the coordinate values into the array. | |
| void | Set (T const *p) |
| Sets the coordinates using the values in the given array. | |
| void | Set (T v) |
| Sets all coordinates using the given value. | |
| template<int M> | |
| void | CopyData (T *p) |
| Sets the coordinates as zero. | |
| template<typename S , int M> | |
| void | ConvertData (S *p) |
| Sets the coordinates as zero. | |
General methods | |
| T | Sum () const |
| Returns the sum of its components. | |
| bool | IsZero () const |
| Returns true if all components are exactly zero. | |
| T | Min () const |
| Returns the sum of its components. | |
| T | Max () const |
| Returns the sum of its components. | |
| int | MinComp () const |
| Returns the sum of its components. | |
| int | MaxComp () const |
| Returns the sum of its components. | |
Limit methods | |
| void | Clamp (T minValue, T maxValue) |
| Ensures that all components of the vector are within the given limits. | |
| void | ClampMin (T v) |
| Ensures that all components of the vector are greater than or equal to the given limit. | |
| void | ClampMax (T v) |
| Ensures that all components of the vector are smaller than or equal to the given limit. | |
| void | SetAbs () |
| Converts all negative components to positive values. | |
Unary operators | |
| IVec | operator- () const |
Binary operators | |
| IVec | operator+ (IVec const &p) const |
| IVec | operator- (IVec const &p) const |
| IVec | operator* (IVec const &p) const |
| IVec | operator/ (IVec const &p) const |
| IVec | operator+ (T const v) const |
| IVec | operator- (T const v) const |
| IVec | operator* (T const v) const |
| IVec | operator/ (T const v) const |
Assignment operators | |
| const IVec & | operator+= (IVec const &p) |
| const IVec & | operator-= (IVec const &p) |
| const IVec & | operator*= (IVec const &p) |
| const IVec & | operator/= (IVec const &p) |
| const IVec & | operator+= (T const v) |
| const IVec & | operator-= (T const v) |
| const IVec & | operator*= (T const v) |
| const IVec & | operator/= (T const v) |
Bitwise operators | |
| IVec | operator<< (IVec const &p) const |
| IVec | operator>> (IVec const &p) const |
| IVec | operator& (IVec const &p) const |
| IVec | operator| (IVec const &p) const |
| IVec | operator^ (IVec const &p) const |
| IVec | operator<< (T const v) const |
| IVec | operator>> (T const v) const |
| IVec | operator& (T const v) const |
| IVec | operator| (T const v) const |
| IVec | operator^ (T const v) const |
Bitwise Assignment operators | |
| const IVec & | operator<<= (IVec const &p) |
| const IVec & | operator>>= (IVec const &p) |
| const IVec & | operator&= (IVec const &p) |
| const IVec & | operator|= (IVec const &p) |
| const IVec & | operator^= (IVec const &p) |
| const IVec & | operator<<= (T const v) |
| const IVec & | operator>>= (T const v) |
| const IVec & | operator&= (T const v) |
| const IVec & | operator|= (T const v) |
| const IVec & | operator^= (T const v) |
Test operators | |
| bool | operator== (IVec const &p) const |
| bool | operator!= (IVec const &p) const |
Access operators | |
| T & | operator[] (int i) |
| T | operator[] (int i) const |
Dot product | |
| T | Dot (IVec const &p) const |
| Dot product. | |
| T | operator% (IVec const &p) const |
| Dot product operator. | |
Public Attributes | |
Components of the vector | |
| T | elem [N] |
Friends | |
| IVec | operator- (T v, IVec const &p) |
| Subtraction from a constant. | |
| IVec | operator+ (T v, IVec const &p) |
| Addition with a constant. | |
| IVec | operator* (T v, IVec const &p) |
| Multiplication with a constant. | |