|
OpenVDB 10.0.1
|
#include <openvdb/math/Vec4.h>
Public Types | |
| using | value_type = T |
| using | ValueType = T |
Public Member Functions | |
| Vec4 ()=default | |
| Vec4 (T val) | |
| Construct a vector all of whose components have the given value. | |
| Vec4 (T x, T y, T z, T w) | |
| Constructor with four arguments, e.g. Vec4f v(1,2,3,4);. | |
| template<typename Source > | |
| Vec4 (Source *a) | |
| Constructor with array argument, e.g. float a[4]; Vec4f v(a);. | |
| template<typename Source > | |
| Vec4 (const Tuple< 4, Source > &v) | |
| Conversion constructor. | |
| template<typename Other > | |
| Vec4 (Other val, typename std::enable_if< std::is_arithmetic< Other >::value, Conversion >::type=Conversion{}) | |
| Construct a vector all of whose components have the given value, which may be of an arithmetic type different from this vector's value type. | |
| T & | x () |
| Reference to the component, e.g. v.x() = 4.5f;. | |
| T & | y () |
| T & | z () |
| T & | w () |
| T | x () const |
| Get the component, e.g. float f = v.y();. | |
| T | y () const |
| T | z () const |
| T | w () const |
| T * | asPointer () |
| const T * | asPointer () const |
| T & | operator() (int i) |
| Alternative indexed reference to the elements. | |
| T | operator() (int i) const |
| Alternative indexed constant reference to the elements,. | |
| Vec3< T > | getVec3 () const |
| Returns a Vec3 with the first three elements of the Vec4. | |
| const Vec4< T > & | init (T x=0, T y=0, T z=0, T w=0) |
| const Vec4< T > & | setZero () |
| Set "this" vector to zero. | |
| template<typename Source > | |
| const Vec4< T > & | operator= (const Vec4< Source > &v) |
| Assignment operator. | |
| bool | eq (const Vec4< T > &v, T eps=static_cast< T >(1.0e-8)) const |
| Vec4< T > | operator- () const |
| Negation operator, for e.g. v1 = -v2;. | |
| template<typename T0 , typename T1 > | |
| const Vec4< T > & | add (const Vec4< T0 > &v1, const Vec4< T1 > &v2) |
| template<typename T0 , typename T1 > | |
| const Vec4< T > & | sub (const Vec4< T0 > &v1, const Vec4< T1 > &v2) |
| template<typename T0 , typename T1 > | |
| const Vec4< T > & | scale (T0 scale, const Vec4< T1 > &v) |
| template<typename T0 , typename T1 > | |
| const Vec4< T > & | div (T0 scalar, const Vec4< T1 > &v) |
| T | dot (const Vec4< T > &v) const |
| Dot product. | |
| T | length () const |
| Length of the vector. | |
| T | lengthSqr () const |
| const Vec4< T > & | exp () |
| const Vec4< T > & | log () |
| T | sum () const |
| Return the sum of all the vector components. | |
| T | product () const |
| Return the product of all the vector components. | |
| bool | normalize (T eps=static_cast< T >(1.0e-8)) |
| this = normalized this | |
| Vec4< T > | unit (T eps=0) const |
| return normalized this, throws if null vector | |
| Vec4< T > | unit (T eps, T &len) const |
| return normalized this and length, throws if null vector | |
| Vec4< T > | unitSafe () const |
| return normalized this, or (1, 0, 0, 0) if this is null vector | |
| template<typename S > | |
| const Vec4< T > & | operator*= (S scalar) |
| Multiply each element of this vector by scalar. | |
| template<typename S > | |
| const Vec4< T > & | operator*= (const Vec4< S > &v1) |
| Multiply each element of this vector by the corresponding element of the given vector. | |
| template<typename S > | |
| const Vec4< T > & | operator/= (S scalar) |
| Divide each element of this vector by scalar. | |
| template<typename S > | |
| const Vec4< T > & | operator/= (const Vec4< S > &v1) |
| Divide each element of this vector by the corresponding element of the given vector. | |
| template<typename S > | |
| const Vec4< T > & | operator+= (S scalar) |
| Add scalar to each element of this vector. | |
| template<typename S > | |
| const Vec4< T > & | operator+= (const Vec4< S > &v1) |
| Add each element of the given vector to the corresponding element of this vector. | |
| template<typename S > | |
| const Vec4< T > & | operator-= (S scalar) |
| Subtract scalar from each element of this vector. | |
| template<typename S > | |
| const Vec4< T > & | operator-= (const Vec4< S > &v1) |
| Subtract each element of the given vector from the corresponding element of this vector. | |
| T | operator[] (IdxT i) const |
| T & | operator[] (IdxT i) |
| T | operator[] (int i) const |
| T & | operator[] (int i) |
Static Public Member Functions | |
| static unsigned | numRows () |
| static unsigned | numColumns () |
| static unsigned | numElements () |
| static Vec4< T > | zero () |
| Predefined constants, e.g. Vec4f v = Vec4f::xNegAxis();. | |
| static Vec4< T > | origin () |
| static Vec4< T > | ones () |
Static Public Attributes | |
| static const int | size |
Compatibility | |
These are mostly for backwards compatibility with functions that take old-style Vs (which are just arrays). | |
| void | toV (S *v) const |
| Copies this tuple into an array of a compatible type. | |
| value_type * | asV () |
| Exposes the internal array. Be careful when using this function. | |
| value_type const * | asV () const |
| Exposes the internal array. Be careful when using this function. | |
| std::string | str () const |
| void | write (std::ostream &os) const |
| Copies this tuple into an array of a compatible type. | |
| void | read (std::istream &is) |
| Copies this tuple into an array of a compatible type. | |
| bool | isNan () const |
| True if a Nan is present in this tuple. | |
| bool | isInfinite () const |
| True if an Inf is present in this tuple. | |
| bool | isFinite () const |
| True if no Nan or Inf values are present. | |
| bool | isZero () const |
| True if all elements are exactly zero. | |
| T | mm [SIZE] |
| Copies this tuple into an array of a compatible type. | |
| using value_type = T |
| using ValueType = T |
|
default |
Trivial constructor, the vector is NOT initialized
|
inlineexplicit |
Construct a vector all of whose components have the given value.
|
inline |
Constructor with four arguments, e.g. Vec4f v(1,2,3,4);.
Constructor with array argument, e.g. float a[4]; Vec4f v(a);.
|
inlineexplicit |
Conversion constructor.
|
inlineexplicit |
Construct a vector all of whose components have the given value, which may be of an arithmetic type different from this vector's value type.
Type conversion warnings are suppressed.
|
inline |
this = v1 + v2 "this", v1 and v2 need not be distinct objects, e.g. v.add(v1,v);
|
inline |
|
inline |
|
inlineinherited |
Exposes the internal array. Be careful when using this function.
|
inlineinherited |
Exposes the internal array. Be careful when using this function.
|
inline |
|
inline |
Dot product.
|
inline |
Test if "this" vector is equivalent to vector v with tolerance of eps
|
inline |
Return a reference to itself after the exponent has been applied to all the vector components.
|
inline |
|
inline |
"this" vector gets initialized to [x, y, z, w], calling v.init(); has same effect as calling v = Vec4::zero();
|
inlineinherited |
True if no Nan or Inf values are present.
|
inlineinherited |
True if an Inf is present in this tuple.
|
inlineinherited |
True if a Nan is present in this tuple.
|
inlineinherited |
True if all elements are exactly zero.
|
inline |
Length of the vector.
|
inline |
Squared length of the vector, much faster than length() as it does not involve square root
|
inline |
Return a reference to itself after log has been applied to all the vector components.
|
inline |
this = normalized this
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Alternative indexed reference to the elements.
|
inline |
Alternative indexed constant reference to the elements,.
|
inline |
Multiply each element of this vector by the corresponding element of the given vector.
Multiply each element of this vector by scalar.
|
inline |
Add each element of the given vector to the corresponding element of this vector.
Add scalar to each element of this vector.
|
inline |
Negation operator, for e.g. v1 = -v2;.
|
inline |
Subtract each element of the given vector from the corresponding element of this vector.
Subtract scalar from each element of this vector.
|
inline |
Divide each element of this vector by the corresponding element of the given vector.
Divide each element of this vector by scalar.
|
inline |
Assignment operator.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinestatic |
|
inline |
Return the product of all the vector components.
|
inlineinherited |
Copies this tuple into an array of a compatible type.
|
inline |
this = scalar*v, v need not be a distinct object from "this", e.g. v.scale(1.5,v1);
|
inline |
Set "this" vector to zero.
|
inlineinherited |
|
inline |
this = v1 - v2 "this", v1 and v2 need not be distinct objects, e.g. v.sub(v1,v);
|
inline |
Return the sum of all the vector components.
|
inlineinherited |
Copies this tuple into an array of a compatible type.
|
inline |
return normalized this and length, throws if null vector
|
inline |
return normalized this, throws if null vector
|
inline |
return normalized this, or (1, 0, 0, 0) if this is null vector
|
inline |
|
inline |
|
inlineinherited |
Copies this tuple into an array of a compatible type.
|
inline |
Reference to the component, e.g. v.x() = 4.5f;.
|
inline |
Get the component, e.g. float f = v.y();.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Predefined constants, e.g. Vec4f v = Vec4f::xNegAxis();.
|
protectedinherited |
Copies this tuple into an array of a compatible type.
|
staticinherited |