float3 Struct Reference

Represents a 3D vector of floats for use on both the CPU and GPU. More...

Functions

 float3 (float m_x, float m_y, float m_z)
 Constructor : Creates a float3 whose elements have the specified values. More...
 
float3 add (float3 b)
 Returns the addition of two float3 More...
 
float3 sub (float3 b)
 Returns the substraction of two float3 More...
 
void divide (float a)
 Divides the float3 by a specified scalar value More...
 
float3 multiply (float a)
 Multiplies the float3 by a specified scalar value More...
 
float norm ()
 Returns the length of the float3 More...
 
float dot (float3 b)
 Returns the dot product of two vectors. More...
 
float3 cross (float3 b)
 Returns the cross product of two vectors More...
 

Attributes

float x
 The x component of the float3. More...
 
float y
 the y component of the float3. More...
 
float z
 the z component of the float3. More...
 

Detailed Description

Represents a 3D vector of floats for use on both the CPU and GPU.

Constructor and Destructor

◆ float3()

float3 ( float  m_x,
float  m_y,
float  m_z 
)
inline

Constructor : Creates a float3 whose elements have the specified values.

Parameters
m_xvalue to assign to the x field.
m_yvalue to assign to the y field.
m_zvalue to assign to the z field

Referenced by float3.add(), float3.cross(), float3.multiply(), and float3.sub().

Functions

◆ add()

float3 add ( float3  b)
inline

Returns the addition of two float3

Parameters
b
Returns
The second vector to add.

◆ sub()

float3 sub ( float3  b)
inline

Returns the substraction of two float3

Parameters
bThe second vector.
Returns

◆ divide()

void divide ( float  a)
inline

Divides the float3 by a specified scalar value

Parameters
aThe scalar value

◆ multiply()

float3 multiply ( float  a)
inline

Multiplies the float3 by a specified scalar value

Parameters
aThe scalar value
Returns

◆ norm()

float norm ( )
inline

Returns the length of the float3

Returns

◆ dot()

float dot ( float3  b)
inline

Returns the dot product of two vectors.

Parameters
bThe second vector
Returns

◆ cross()

float3 cross ( float3  b)
inline

Returns the cross product of two vectors

Parameters
bThe second vector
Returns

Variables

◆ x

◆ y

◆ z