Onsens  1.0
This is C++ game about bitwise logic.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Vector4< T > Struct Template Reference

4D vector type, used to set uniforms in GLSL More...

Public Member Functions

 Vector4 ()
 Default constructor, creates a zero vector. More...
 
 Vector4 (T X, T Y, T Z, T W)
 Construct from 4 vector components. More...
 
template<typename U >
 Vector4 (const Vector4< U > &other)
 Conversion constructor. More...
 
 Vector4 (const Color &color)
 Construct float vector implicitly from color. More...
 

Public Attributes

x
 1st component (X) of the 4D vector More...
 
y
 2nd component (Y) of the 4D vector More...
 
z
 3rd component (Z) of the 4D vector More...
 
w
 4th component (W) of the 4D vector More...
 

Detailed Description

template<typename T>
struct Vector4< T >

4D vector type, used to set uniforms in GLSL

Definition at line 92 of file Glsl.inl.

Constructor & Destructor Documentation

◆ Vector4() [1/4]

template<typename T >
Vector4< T >::Vector4 ( )
inline

Default constructor, creates a zero vector.

Definition at line 98 of file Glsl.inl.

◆ Vector4() [2/4]

template<typename T >
Vector4< T >::Vector4 ( X,
Y,
Z,
W 
)
inline

Construct from 4 vector components.

Parameters
XComponent of the 4D vector
YComponent of the 4D vector
ZComponent of the 4D vector
WComponent of the 4D vector

Definition at line 115 of file Glsl.inl.

◆ Vector4() [3/4]

template<typename T >
template<typename U >
Vector4< T >::Vector4 ( const Vector4< U > &  other)
inlineexplicit

Conversion constructor.

Parameters
other4D vector of different type

Definition at line 130 of file Glsl.inl.

◆ Vector4() [4/4]

template<typename T >
Vector4< T >::Vector4 ( const Color &  color)
inline

Construct float vector implicitly from color.

Parameters
colorColor instance. Is normalized to [0, 1] for floats, and left as-is for ints.

Definition at line 145 of file Glsl.inl.

+ Here is the call graph for this function:

Member Data Documentation

◆ w

template<typename T >
T Vector4< T >::w

4th component (W) of the 4D vector

Definition at line 154 of file Glsl.inl.

◆ x

template<typename T >
T Vector4< T >::x

1st component (X) of the 4D vector

Definition at line 151 of file Glsl.inl.

◆ y

template<typename T >
T Vector4< T >::y

2nd component (Y) of the 4D vector

Definition at line 152 of file Glsl.inl.

◆ z

template<typename T >
T Vector4< T >::z

3rd component (Z) of the 4D vector

Definition at line 153 of file Glsl.inl.


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