Euphoria
Public Member Functions | Public Attributes | List of all members
eu::v4 Struct Reference

A 4d vector. More...

Public Member Functions

 v4 (float ax, float ay, float az, float aw)
 
 v4 (const v3 &a, float aw)
 
 v4 (const float *a)
 Construct the vector from an array.
 
v3 to_vec3 (float ww) const
 asserts that the w component is what is expected, point=1, vector=0
 
v3 to_vec3_persp_div () const
 returns a 3d vector using perspective division
 
floatget_data_ptr ()
 returns an array to the data
 
const floatget_data_ptr () const
 returns an array to the data
 
bool operator== (const v4 &rhs)=delete
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Detailed Description

A 4d vector.

It represents a homogeneous coordinate/projective coordinate.

Definition at line 16 of file vec4.h.

Constructor & Destructor Documentation

◆ v4() [1/3]

eu::v4::v4 ( float  ax,
float  ay,
float  az,
float  aw 
)

◆ v4() [2/3]

eu::v4::v4 ( const v3 a,
float  aw 
)
Parameters
athe xyz components
awthe w component, point=1, vector=0

◆ v4() [3/3]

eu::v4::v4 ( const float a)
explicit

Construct the vector from an array.

It is assumed the array is of at least 4 elements in xyzw order.

Member Function Documentation

◆ get_data_ptr() [1/2]

float * eu::v4::get_data_ptr ( )

returns an array to the data

◆ get_data_ptr() [2/2]

const float * eu::v4::get_data_ptr ( ) const

returns an array to the data

◆ operator==()

bool eu::v4::operator== ( const v4 rhs)
delete

◆ to_vec3()

v3 eu::v4::to_vec3 ( float  ww) const

asserts that the w component is what is expected, point=1, vector=0

◆ to_vec3_persp_div()

v3 eu::v4::to_vec3_persp_div ( ) const

returns a 3d vector using perspective division

Member Data Documentation

◆ w

float eu::v4::w

Definition at line 21 of file vec4.h.

◆ x

float eu::v4::x

Definition at line 18 of file vec4.h.

◆ y

float eu::v4::y

Definition at line 19 of file vec4.h.

◆ z

float eu::v4::z

Definition at line 20 of file vec4.h.


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