Atoms Crowd
7.0.0
|
#include <ImathVec.h>
Public Types | |
typedef T | BaseType |
Public Member Functions | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 T & | operator[] (int i) noexcept |
Element access by index. | |
constexpr ATOMSMATH_HOSTDEVICE const T & | operator[] (int i) const noexcept |
Element access by index. | |
short | length () const noexcept=delete |
const Vec4< short > & | normalize () noexcept=delete |
const Vec4< short > & | normalizeExc ()=delete |
const Vec4< short > & | normalizeNonNull () noexcept=delete |
Vec4< short > | normalized () const noexcept=delete |
Vec4< short > | normalizedExc () const=delete |
Vec4< short > | normalizedNonNull () const noexcept=delete |
int | length () const noexcept=delete |
const Vec4< int > & | normalize () noexcept=delete |
const Vec4< int > & | normalizeExc ()=delete |
const Vec4< int > & | normalizeNonNull () noexcept=delete |
Vec4< int > | normalized () const noexcept=delete |
Vec4< int > | normalizedExc () const=delete |
Vec4< int > | normalizedNonNull () const noexcept=delete |
template<class S > | |
constexpr | Vec4 (const Vec4< S > &v) noexcept |
template<class S > | |
constexpr | Vec4 (const Vec3< S > &v) noexcept |
template<class S > | |
constexpr bool | operator== (const Vec4< S > &v) const noexcept |
template<class S > | |
constexpr bool | operator!= (const Vec4< S > &v) const noexcept |
Constructors and Assignment | |
ATOMSMATH_HOSTDEVICE | Vec4 () noexcept |
Uninitialized by default. | |
constexpr ATOMSMATH_HOSTDEVICE | Vec4 (T a) noexcept |
Initialize to a scalar (a,a,a,a) | |
constexpr ATOMSMATH_HOSTDEVICE | Vec4 (T a, T b, T c, T d) noexcept |
Initialize to given elements (a,b,c,d) | |
constexpr ATOMSMATH_HOSTDEVICE | Vec4 (const Vec4 &v) noexcept |
Copy constructor. | |
template<class S > | |
constexpr ATOMSMATH_HOSTDEVICE | Vec4 (const Vec4< S > &v) noexcept |
Construct from Vec4 of another base type. | |
template<class S > | |
constexpr ATOMSMATH_HOSTDEVICE | Vec4 (const Vec3< S > &v) noexcept |
Vec3 to Vec4 conversion, sets w to 1. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator= (const Vec4 &v) noexcept |
Assignment. | |
~Vec4 () noexcept=default | |
Destructor. | |
Arithmetic and Comparison | |
template<class S > | |
constexpr ATOMSMATH_HOSTDEVICE bool | operator== (const Vec4< S > &v) const noexcept |
Equality. | |
template<class S > | |
constexpr ATOMSMATH_HOSTDEVICE bool | operator!= (const Vec4< S > &v) const noexcept |
Inequality. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | equalWithAbsError (const Vec4< T > &v, T e) const noexcept |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | equalWithRelError (const Vec4< T > &v, T e) const noexcept |
constexpr ATOMSMATH_HOSTDEVICE T | dot (const Vec4 &v) const noexcept |
Dot product. | |
constexpr ATOMSMATH_HOSTDEVICE T | operator^ (const Vec4 &v) const noexcept |
Dot product. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator+= (const Vec4 &v) noexcept |
Component-wise addition. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator+ (const Vec4 &v) const noexcept |
Component-wise addition. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator-= (const Vec4 &v) noexcept |
Component-wise subtraction. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator- (const Vec4 &v) const noexcept |
Component-wise subtraction. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator- () const noexcept |
Component-wise multiplication by -1. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | negate () noexcept |
Component-wise multiplication by -1. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator*= (const Vec4 &v) noexcept |
Component-wise multiplication. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator*= (T a) noexcept |
Component-wise multiplication. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator* (const Vec4 &v) const noexcept |
Component-wise multiplication. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator* (T a) const noexcept |
Component-wise multiplication. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator/= (const Vec4 &v) noexcept |
Component-wise division. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 const Vec4 & | operator/= (T a) noexcept |
Component-wise division. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator/ (const Vec4 &v) const noexcept |
Component-wise division. | |
constexpr ATOMSMATH_HOSTDEVICE Vec4 | operator/ (T a) const noexcept |
Component-wise division. | |
Query and Manipulation | |
ATOMSMATH_HOSTDEVICE T | length () const noexcept |
Return the Euclidean norm. | |
constexpr ATOMSMATH_HOSTDEVICE T | length2 () const noexcept |
ATOMSMATH_HOSTDEVICE const Vec4 & | normalize () noexcept |
Normalize in place. If length()==0, return a null vector. | |
const Vec4 & | normalizeExc () |
Normalize in place. If length()==0, throw an exception. | |
ATOMSMATH_HOSTDEVICE const Vec4 & | normalizeNonNull () noexcept |
ATOMSMATH_HOSTDEVICE Vec4< T > | normalized () const noexcept |
Return a normalized vector. Does not modify *this. | |
Vec4< T > | normalizedExc () const |
ATOMSMATH_HOSTDEVICE Vec4< T > | normalizedNonNull () const noexcept |
Static Public Member Functions | |
constexpr static ATOMSMATH_HOSTDEVICE unsigned int | dimensions () noexcept |
Return the number of dimensions, i.e. 4. | |
Numeric Limits | |
constexpr static ATOMSMATH_HOSTDEVICE T | baseTypeLowest () noexcept |
Largest possible negative value. | |
constexpr static ATOMSMATH_HOSTDEVICE T | baseTypeMax () noexcept |
Largest possible positive value. | |
constexpr static ATOMSMATH_HOSTDEVICE T | baseTypeSmallest () noexcept |
Smallest possible positive value. | |
constexpr static ATOMSMATH_HOSTDEVICE T | baseTypeEpsilon () noexcept |
Smallest possible e for which 1+e != 1. | |
Public Attributes | |
Direct access to elements | |
T | x |
T | y |
T | z |
T | w |
4-element vector
The base type: In templates that accept a parameter V
, you can refer to T
as V::BaseType
|
inlinenoexcept |
Compare two matrices and test if they are "approximately equal":
m
are the same with an absolute error of no more than e, i.e., for all i, j:abs (this[i][j] - m[i][j]) <= e
|
inlinenoexcept |
Compare two matrices and test if they are "approximately equal":
abs (this[i] - v[i][j]) <= e * abs (this[i][j])
|
inlineconstexprnoexcept |
Return the square of the Euclidean norm, i.e. the dot product with itself.
Return a normalized vector. Does not modify *this. Throw an exception if length()==0.
Return a normalized vector. Does not modify *this, and does not check for length()==0. Slightly faster than the other normalization routines, but if v.length() is 0.0, the result is undefined.
Normalize without any checks for length()==0. Slightly faster than the other normalization routines, but if v.length() is 0.0, the result is undefined.