Hermes
hermes::Vector4< T > Class Template Reference

Geometric 4-dimensional point (x, y, z, w) More...

+ Inheritance diagram for hermes::Vector4< T >:

Public Member Functions

HERMES_DEVICE_CALLABLE Vector4 ()
 Default constructor.
 
HERMES_DEVICE_CALLABLE Vector4 (T _x, T _y, T _z, T _w)
 Construct from component values. More...
 
HERMES_DEVICE_CALLABLE Vector4< T > & operator+= (const Vector4< T > &v)
 
HERMES_DEVICE_CALLABLE Vector4< T > & operator-= (const Vector4< T > &v)
 
HERMES_DEVICE_CALLABLE Vector4< T > & operator*= (T f)
 
HERMES_DEVICE_CALLABLE Vector4< T > & operator/= (T f)
 
HERMES_DEVICE_CALLABLE Vector4< T > operator- () const
 
HERMES_DEVICE_CALLABLE Vector4< T > operator+ (const Vector4< T > &b)
 
HERMES_DEVICE_CALLABLE Vector4< T > operator- (const Vector4< T > &b)
 
HERMES_DEVICE_CALLABLE Vector4< T > operator* (T f)
 
HERMES_DEVICE_CALLABLE Vector4< T > operator/ (T f)
 
HERMES_DEVICE_CALLABLEoperator[] (int i) const
 Get i-th component. More...
 
HERMES_DEVICE_CALLABLE T & operator[] (int i)
 Get i-th component reference. More...
 
HERMES_DEVICE_CALLABLE Vector2< T > xy ()
 Gets first 2 components. More...
 
HERMES_DEVICE_CALLABLE Vector3< T > xyz ()
 Gets first 3 components. More...
 
HERMES_DEVICE_CALLABLElength2 () const
 Computes vector squared magnitude. More...
 
HERMES_DEVICE_CALLABLElength () const
 Computes vector magnitude. More...
 

Public Attributes

x = T(0.0)
 0-th component
 
y = T(0.0)
 1-th component
 
z = T(0.0)
 2-th component
 
w = T(0.0)
 3-th component
 

Additional Inherited Members

- Static Public Member Functions inherited from hermes::MathElement< T, 4 >
static constexpr u64 componentCount ()
 Gets the number of dimensional components. More...
 
static constexpr u64 numericTypeSizeInBytes ()
 Gets the size in bytes of underlying data type. More...
 
static MemoryDumper::RegionLayout memoryDumpLayout ()
 Gets memory layout. More...
 
- Static Public Attributes inherited from hermes::MathElement< T, 4 >
static T numeric_data
 Underlying data type.
 

Detailed Description

template<typename T>
class hermes::Vector4< T >

Geometric 4-dimensional point (x, y, z, w)

Template Parameters
T

Constructor & Destructor Documentation

◆ Vector4()

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Vector4< T >::Vector4 ( _x,
_y,
_z,
_w 
)
inline

Construct from component values.

Parameters
_x
_y
_z
_w

Member Function Documentation

◆ length()

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Vector4< T >::length ( ) const
inline

Computes vector magnitude.

Returns

◆ length2()

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Vector4< T >::length2 ( ) const
inline

Computes vector squared magnitude.

Returns

◆ operator[]() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE T& hermes::Vector4< T >::operator[] ( int  i)
inline

Get i-th component reference.

Warning
i is not checked
Parameters
icomponent index in [0, 3]
Returns

◆ operator[]() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Vector4< T >::operator[] ( int  i) const
inline

Get i-th component.

Warning
i is not checked
Parameters
icomponent index in [0, 3]
Returns

◆ xy()

template<typename T >
HERMES_DEVICE_CALLABLE Vector2<T> hermes::Vector4< T >::xy ( )
inline

Gets first 2 components.

Returns

◆ xyz()

template<typename T >
HERMES_DEVICE_CALLABLE Vector3<T> hermes::Vector4< T >::xyz ( )
inline

Gets first 3 components.

Returns

The documentation for this class was generated from the following file: