Hermes
Loading...
Searching...
No Matches
hermes::Vector4< T > Class Template Reference

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

#include <vector.h>

+ 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.
 
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< Toperator- () const
 
HERMES_DEVICE_CALLABLE Vector4< Toperator+ (const Vector4< T > &b)
 
HERMES_DEVICE_CALLABLE Vector4< Toperator- (const Vector4< T > &b)
 
HERMES_DEVICE_CALLABLE Vector4< Toperator* (T f)
 
HERMES_DEVICE_CALLABLE Vector4< Toperator/ (T f)
 
HERMES_DEVICE_CALLABLE T operator[] (int i) const
 Get i-th component.
 
HERMES_DEVICE_CALLABLE Toperator[] (int i)
 Get i-th component reference.
 
HERMES_DEVICE_CALLABLE Vector2< Txy ()
 Gets first 2 components.
 
HERMES_DEVICE_CALLABLE Vector3< Txyz ()
 Gets first 3 components.
 
HERMES_DEVICE_CALLABLE T length2 () const
 Computes vector squared magnitude.
 
HERMES_DEVICE_CALLABLE T length () const
 Computes vector magnitude.
 

Public Attributes

T x = T(0.0)
 0-th component
 
T y = T(0.0)
 1-th component
 
T z = T(0.0)
 2-th component
 
T 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.
 
static constexpr u64 numericTypeSizeInBytes ()
 Gets the size in bytes of underlying data type.
 
static MemoryDumper::RegionLayout memoryDumpLayout ()
 Gets memory layout.
 
- 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 ( T  _x,
T  _y,
T  _z,
T  _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: