MaterialX 1.39.1
|
The class template for vectors of scalar values. More...
#include <Types.h>
Classes | |
class | Hash |
Function object for hashing vectors. More... | |
Public Types | |
using | Iterator = typename std::array< S, N >::iterator |
using | ConstIterator = typename std::array< S, N >::const_iterator |
Public Member Functions | |
VectorN (Uninit) | |
VectorN (S s) | |
VectorN (const std::array< S, N > &arr) | |
VectorN (const vector< S > &vec) | |
VectorN (const S *begin, const S *end) | |
Comparison Operators | |
bool | operator== (const V &rhs) const |
Return true if the given vector is identical to this one. | |
bool | operator!= (const V &rhs) const |
Return true if the given vector differs from this one. | |
bool | operator< (const V &rhs) const |
Compare two vectors lexicographically. | |
Indexing Operators | |
S & | operator[] (size_t i) |
Return the scalar value at the given index. | |
const S & | operator[] (size_t i) const |
Return the const scalar value at the given index. | |
Component-wise Operators | |
V | operator+ (const V &rhs) const |
Component-wise addition of two vectors. | |
VectorN & | operator+= (const V &rhs) |
Component-wise addition of two vectors. | |
V | operator- (const V &rhs) const |
Component-wise subtraction of two vectors. | |
VectorN & | operator-= (const V &rhs) |
Component-wise subtraction of two vectors. | |
V | operator* (const V &rhs) const |
Component-wise multiplication of two vectors. | |
VectorN & | operator*= (const V &rhs) |
Component-wise multiplication of two vectors. | |
V | operator/ (const V &rhs) const |
Component-wise division of two vectors. | |
VectorN & | operator/= (const V &rhs) |
Component-wise division of two vectors. | |
V | operator* (S s) const |
Component-wise multiplication of a vector by a scalar. | |
VectorN & | operator*= (S s) |
Component-wise multiplication of a vector by a scalar. | |
V | operator/ (S s) const |
Component-wise division of a vector by a scalar. | |
VectorN & | operator/= (S s) |
Component-wise division of a vector by a scalar. | |
V | operator- () const |
Unary negation of a vector. | |
Geometric Methods | |
S | getMagnitude () const |
Return the magnitude of the vector. | |
V | getNormalized () const |
Return a normalized vector. | |
S | dot (const V &rhs) const |
Return the dot product of two vectors. | |
Iterators | |
Iterator | begin () |
ConstIterator | begin () const |
Iterator | end () |
ConstIterator | end () const |
Utility | |
S * | data () |
Return a pointer to the underlying data array. | |
const S * | data () const |
Return a const pointer to the underlying data array. | |
Static Public Member Functions | |
Static Methods | |
static constexpr size_t | numElements () |
Return the number of scalar elements for the vector. | |
Protected Attributes | |
std::array< S, N > | _arr |
The class template for vectors of scalar values.
Inherited by Vector2, Vector3, Vector4, Color3, and Color4.
Template parameter V is the vector subclass, S is the scalar element type, and N is the number of scalar elements in the vector.