![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
default type for DVALUE_t in templates More...
#include <cVecT.h>
Public Types | |
typedef TYPE | DVALUE_t |
Dimension value type. More... | |
typedef cVecTC< TYPE, _IQTY, _TYPE_C > | THIS_t |
Public Member Functions | |
TYPE * | get_T () noexcept |
const TYPE * | get_CT () const noexcept |
const _TYPE_C & | get_CR () const noexcept |
operator const TYPE * () const noexcept | |
TYPE | GetElem (int i) const noexcept |
TYPE | operator[] (int i) const noexcept |
bool | isZero () const noexcept |
COMPARE_t | Compare (const THIS_t &v2) const noexcept |
bool | operator== (const THIS_t &v2) const noexcept |
bool | operator!= (const THIS_t &v2) const noexcept |
bool | IsNear (const THIS_t &v2, TYPE fDist=(TYPE) k_FLT_MIN2) const |
TYPE | get_MagnitudeSq () const noexcept |
TYPE | get_Magnitude () const noexcept |
_TYPE_C | operator- () const |
_TYPE_C | get_Abs () const |
_TYPE_C | GetSum (const THIS_t &v2) const |
_TYPE_C | operator+ (const THIS_t &v2) const |
_TYPE_C | GetDiff (const THIS_t &v2) const |
_TYPE_C | operator- (const THIS_t &v2) const |
_TYPE_C | GetScaled (TYPE nScale) const |
_TYPE_C | operator* (TYPE nScale) const |
_TYPE_C | operator/ (TYPE nScale) const |
_TYPE_C | GetMul (const THIS_t &v2) const |
_TYPE_C | GetDiv (const THIS_t &v2) const |
TYPE | GetDistSq (const THIS_t &v2) const |
TYPE | GetDist (const THIS_t &v2) const |
TYPE | GetDot (const THIS_t &v2) const |
_TYPE_C | get_Normalized () const |
operator TYPE * () | |
TYPE & | RefElem (int i) noexcept |
TYPE & | operator[] (int i) |
void | Set (const THIS_t &v) |
void | SetZero () noexcept |
TYPE | SetNormalized (void) noexcept |
bool | put_Magnitude (TYPE nLength) |
void | SetLerp (const THIS_t &a, const THIS_t &b, DVALUE_t t) |
const _TYPE_C & | operator+= (const THIS_t &v2) |
const _TYPE_C & | operator+= (TYPE n) |
const _TYPE_C & | operator-= (const THIS_t &v2) noexcept |
const _TYPE_C & | operator-= (TYPE n) noexcept |
void | DoScale (TYPE n) noexcept |
const _TYPE_C & | operator*= (TYPE nScale) noexcept |
const _TYPE_C & | operator/= (TYPE nScale) |
void | DoMul (const THIS_t &v2) noexcept |
_TYPE_C & | operator*= (const THIS_t &v2) noexcept |
void | DoDiv (const THIS_t &v2) |
_TYPE_C & | operator/= (const THIS_t &v2) |
Static Public Member Functions | |
static TYPE | GetDot (const THIS_t &v1, const THIS_t &v2) |
Static Public Attributes | |
static const int | k_nDim = _IQTY |
Protected Member Functions | |
cVecTC () | |
default type for DVALUE_t in templates
Base class for operations that are generic to vectors of any TYPE or _IQTY. e.g. a 3d point in space. TYPE = the dimension precision. int,float,double. _IQTY = number of dimensions. i.e. 2,3,4 _TYPE_C = the composite derived class that stores the data.
typedef TYPE GrayLib::cVecTC< TYPE, _IQTY, _TYPE_C >::DVALUE_t |
Dimension value type.
typedef cVecTC<TYPE, _IQTY, _TYPE_C> GrayLib::cVecTC< TYPE, _IQTY, _TYPE_C >::THIS_t |
|
inlineprotected |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
this = this * v2 like: D3DXColorModulate, GetMul()
|
inlinenoexcept |
like: D3DXColorScale or D3DXVec4Scale
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Vector length = distance to origin. like D3DXVec3Length D3DXQuaternionLength
|
inlinenoexcept |
Vector length Pre-square root. like D3DXVec3LengthSq, D3DXQuaternionLengthSq
|
inline |
Make this vector have a unit length of 1. i.e. get_Magnitude() == 1
|
inlinenoexcept |
|
inline |
= a - b = D3DXVec3Subtract
|
inline |
get the distance
|
inline |
get the square of the distance
|
inline |
= a / b
|
inlinestatic |
|
inline |
Dot Product = Angle between vectors. cosine. https://en.wikipedia.org/wiki/Dot_product like D3DXVec3Dot D3DXQuaternionDot D3DXVec4Dot AKA "Inner product" e.g. Calc::ACos( GetDot(v2)) = angle in radians. GetDot(*this) = get_MagnitudeSq() (on self)
|
inlinenoexcept |
get an element of the vector.
|
inline |
= a * b
|
inline |
= a * nScale
|
inline |
D3DXVec3Add = a + b
|
inline |
|
inlinenoexcept |
Are all values in the vector zero?
|
inlinenoexcept |
get a pointer to the vector. this should allow array [x] operators. but with usual 'C' lack of range checking.
|
inline |
get a pointer to the vector. this should allow array [x] operators. but with usual 'C' lack of range checking.
|
inlinenoexcept |
|
inline |
= a * nScale
|
inlinenoexcept |
like HLSL, but no D3DX equivalent
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
unary operator = All negative.
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
like HLSL, but no d3dx equivalent
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
i.e. Magnitude = 1 = normalized.
|
inlinenoexcept |
get a changeable reference to an element.
|
inline |
|
inline |
change between 2 values. like: D3DXVec3Lerp, D3DXColorLerp or D3DXVec4Lerp t = 0 to 1
|
inlinenoexcept |
like D3DXVec3Normalize() and D3DXQuaternionNormalize except it returns the length. NOT the same as D3DXPlaneNormalize
|
inlinenoexcept |
Zero all values.
|
static |