Fermat
Classes | Typedefs | Functions

Detailed Description

defines linear vectors structs and functions

Classes

struct  cugar::Vector< T, DIM >
 
struct  cugar::Vector< T, 1 >
 
struct  cugar::Vector< T, 2 >
 
struct  cugar::Vector< T, 3 >
 
struct  cugar::Vector< T, 4 >
 
struct  cugar::vector_traits< Vector< T, DIM_T > >
 

Typedefs

typedef Vector< float, 2 > cugar::Vector2f
 
typedef Vector< float, 3 > cugar::Vector3f
 
typedef Vector< float, 4 > cugar::Vector4f
 
typedef Vector< double, 2 > cugar::Vector2d
 
typedef Vector< double, 3 > cugar::Vector3d
 
typedef Vector< double, 4 > cugar::Vector4d
 
typedef Vector< int, 2 > cugar::Vector2i
 
typedef Vector< int, 3 > cugar::Vector3i
 
typedef Vector< int, 4 > cugar::Vector4i
 
typedef Vector< uint32, 2 > cugar::Vector2u
 
typedef Vector< uint32, 3 > cugar::Vector3u
 
typedef Vector< uint32, 4 > cugar::Vector4u
 

Functions

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator- (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator+ (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator+= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator- (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator-= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator*= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* (const T op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator*= (Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator/ (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator/= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator/ (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator/= (Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > min (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > max (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > min (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > max (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > abs (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T max_comp (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T min_comp (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool any (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool all (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator== (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator!= (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator< (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator> (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator<= (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator>= (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T dot (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T length (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > normalize (const Vector< T, DIM > &op)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3u > cross (const Vector< T, 3u > &op1, const Vector< T, 3u > &op2)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > reflect (const Vector< T, 3 > I, const Vector< T, 3 > N)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > refract (const Vector< T, 3 > I, const Vector< T, 3 > N, const float eta)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > refraction_normal (const Vector< T, 3 > I, const Vector< T, 3 > T, const float eta)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > faceforward (const Vector< T, 3 > N, const Vector< T, 3 > I)
 
template<typename T >
CUGAR_HOST_DEVICE Vector< T, 3 > orthogonal (const Vector< T, 3 > v)
 
template<typename T >
CUGAR_HOST_DEVICE void orthonormal_basis (const Vector< T, 3 > normal, Vector< T, 3 > &tangent, Vector< T, 3 > &bitangent)
 
template<typename T >
CUGAR_HOST_DEVICE uint32 pack_vector (const Vector< T, 2 > v, const uint32 n_bits_comp)
 
template<typename T >
CUGAR_HOST_DEVICE Vector< T, 2 > unpack_vector (const uint32 u, const uint32 n_bits_comp)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > mod (const Vector< T, DIM > &op, const T m)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > sqrt (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool is_finite (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L1_norm (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L2_norm (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L_inf_norm (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM, uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L_norm (const Vector< T, DIM > &op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L1_norm (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L1_norm (const double op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L2_norm (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L2_norm (const double op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L_inf_norm (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L_inf_norm (const double op)
 
template<uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L_norm (const float op)
 
template<uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L_norm (const double op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T average (const Vector< T, DIM > &op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float average (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double average (const double op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > lerp (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2, const T u)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float lerp (const float op1, const float op2, const float u)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double lerp (const double op1, const double op2, const double u)
 

Function Documentation

◆ abs()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > abs ( const Vector< T, DIM > &  op)
related

component-wise vector abs

◆ all()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool all ( const Vector< T, DIM > &  op)
related

return true if all of the components are non-zero

◆ any()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool any ( const Vector< T, DIM > &  op)
related

return true if any of the components is non-zero

◆ average() [1/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T average ( const Vector< T, DIM > &  op)
related

vector average

◆ average() [2/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float average ( const float  op)
related

vector average

◆ average() [3/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double average ( const double  op)
related

vector average

◆ cross()

template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3u > cross ( const Vector< T, 3u > &  op1,
const Vector< T, 3u > &  op2 
)
related

cross product

◆ dot()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T dot ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

dot product

◆ faceforward()

template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > faceforward ( const Vector< T, 3 >  N,
const Vector< T, 3 >  I 
)
related

given a vector N and an incident vector I, return sgn(dot(N,I)) * N

◆ is_finite()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool is_finite ( const Vector< T, DIM > &  op)
related

return true iff all components are finite

◆ L1_norm() [1/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L1_norm ( const Vector< T, DIM > &  op)
related

L_1 vector norm

◆ L1_norm() [2/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L1_norm ( const float  op)
related

L_1 vector norm

◆ L1_norm() [3/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L1_norm ( const double  op)
related

L_1 vector norm

◆ L2_norm() [1/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L2_norm ( const Vector< T, DIM > &  op)
related

L_2 vector norm

◆ L2_norm() [2/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L2_norm ( const float  op)
related

L_2 vector norm

◆ L2_norm() [3/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L2_norm ( const double  op)
related

L_2 vector norm

◆ L_inf_norm() [1/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L_inf_norm ( const Vector< T, DIM > &  op)
related

L_inf vector norm

◆ L_inf_norm() [2/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L_inf_norm ( const float  op)
related

L_inf vector norm

◆ L_inf_norm() [3/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L_inf_norm ( const double  op)
related

L_inf vector norm

◆ L_norm() [1/3]

template<typename T , uint32 DIM, uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L_norm ( const Vector< T, DIM > &  op)
related

L_p vector norm

◆ L_norm() [2/3]

template<uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L_norm ( const float  op)
related

L_p vector norm

◆ L_norm() [3/3]

template<uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L_norm ( const double  op)
related

L_p vector norm

◆ length()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T length ( const Vector< T, DIM > &  op)
related

Euclidean length

◆ lerp() [1/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > lerp ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2,
const T  u 
)
related

vector lerp

◆ lerp() [2/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float lerp ( const float  op1,
const float  op2,
const float  u 
)
related

vector lerp

◆ lerp() [3/3]

template<typename T, uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double lerp ( const double  op1,
const double  op2,
const double  u 
)
related

vector lerp

◆ max() [1/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > max ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

binary component-wise vector max

◆ max() [2/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > max ( const Vector< T, DIM > &  op1,
const T  op2 
)
related

component-wise vector max

◆ max_comp()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T max_comp ( const Vector< T, DIM > &  op)
related

return the maximum component

◆ min() [1/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > min ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

binary component-wise vector min

◆ min() [2/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > min ( const Vector< T, DIM > &  op1,
const T  op2 
)
related

component-wise vector min

◆ min_comp()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T min_comp ( const Vector< T, DIM > &  op)
related

return the minimum component

◆ mod()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > mod ( const Vector< T, DIM > &  op,
const T  m 
)
related

component-wise vector modulo

◆ normalize()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > normalize ( const Vector< T, DIM > &  op)
related

Euclidean normalization

◆ operator!=()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator!= ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector inequality test

◆ operator*() [1/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector multiplication

◆ operator*() [2/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* ( const T  op1,
const Vector< T, DIM > &  op2 
)
related

vector multiplication

◆ operator*() [3/3]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* ( const Vector< T, DIM > &  op1,
const T  op2 
)
related

vector multiplication by scalar

◆ operator*=() [1/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator*= ( Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector multiplication

◆ operator*=() [2/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator*= ( Vector< T, DIM > &  op1,
const T  op2 
)
related

vector multiplication by scalar

◆ operator+()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator+ ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector addition

◆ operator+=()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator+= ( Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector addition

◆ operator-() [1/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator- ( const Vector< T, DIM > &  op)
related

vector negation

◆ operator-() [2/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator- ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector subtraction

◆ operator-=()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator-= ( Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector subtraction

◆ operator/() [1/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator/ ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector division

◆ operator/() [2/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator/ ( const Vector< T, DIM > &  op1,
const T  op2 
)
related

vector division by scalar

◆ operator/=() [1/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator/= ( Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector division

◆ operator/=() [2/2]

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator/= ( Vector< T, DIM > &  op1,
const T  op2 
)
related

vector division by scalar

◆ operator<()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator< ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

lexicographic vector less

◆ operator<=()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator<= ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

lexicographic vector less or equal

◆ operator==()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator== ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

vector equality test

◆ operator>()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator> ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

lexicographic vector greater

◆ operator>=()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator>= ( const Vector< T, DIM > &  op1,
const Vector< T, DIM > &  op2 
)
related

lexicographic vector greater or equal

◆ orthogonal()

template<typename T >
CUGAR_HOST_DEVICE Vector< T, 3 > orthogonal ( const Vector< T, 3 >  v)
related

return a vector orthogonal to a given vector

◆ orthonormal_basis()

template<typename T >
CUGAR_HOST_DEVICE void orthonormal_basis ( const Vector< T, 3 >  normal,
Vector< T, 3 > &  tangent,
Vector< T, 3 > &  bitangent 
)
related

build an orthonormal basis

◆ pack_vector()

template<typename T >
CUGAR_HOST_DEVICE uint32 pack_vector ( const Vector< T, 2 >  v,
const uint32  n_bits_comp 
)
related

pack a normalized 2d vector using n bits per component

◆ reflect()

template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > reflect ( const Vector< T, 3 >  I,
const Vector< T, 3 >  N 
)
related

reflect a vector against another NOTE: this function assumes the vector I is incident into the surface, i.e. dot(I,N) < 0, so that the reflected ray will point in the opposite direction, contrarily to the custom in BSDF sampling literature of having bouth I and the reflected direction point outwards.

◆ refract()

template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > refract ( const Vector< T, 3 >  I,
const Vector< T, 3 >  N,
const float  eta 
)
related

refract a vector against a normal NOTE: this function assumes the vector I is incident into the surface, i.e. dot(I,N) < 0, so that the refracted ray will point in the same direction, contrarily to the custom in BSDF sampling literature of having I point outwards and the refracted direction inwards.

◆ refraction_normal()

template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > refraction_normal ( const Vector< T, 3 >  I,
const Vector< T, 3 >  T,
const float  eta 
)
related

compute the normal responsible for refraction from I to T NOTE: this function assumes the vector I is incident into the surface, i.e. dot(I,N) < 0, and that the refracted ray points in the same direction, contrarily to the custom in BSDF sampling literature of having I point outwards and T inwards.

◆ sqrt()

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > sqrt ( const Vector< T, DIM > &  op)
related

component-wise vector sqrt

◆ unpack_vector()

template<typename T >
CUGAR_HOST_DEVICE Vector< T, 2 > unpack_vector ( const uint32  u,
const uint32  n_bits_comp 
)
related

unpack a normalized 2d vector using n bits per component