1 #ifndef AWFUL_MATH_VECTOR4F_H_
2 #define AWFUL_MATH_VECTOR4F_H_
6 namespace awful
{ namespace math
18 Vector4f( float x_
, float y_
, float z_
, float w_
) :
26 float& x() { return m_x
; }
27 float& y() { return m_y
; }
28 float& z() { return m_z
; }
29 float& w() { return m_w
; }
30 const float& x() const { return m_x
; }
31 const float& y() const { return m_y
; }
32 const float& z() const { return m_z
; }
33 const float& w() const { return m_w
; }
35 Vector4f
operator+( const Vector4f
& b
) const
37 return Vector4f( m_x
+ b
.m_x
, m_y
+ b
.m_y
, m_z
+ b
.m_z
, m_w
+ b
.m_w
);
40 Vector4f
operator-( const Vector4f
& b
) const
42 return Vector4f( m_x
- b
.m_x
, m_y
- b
.m_y
, m_z
+ b
.m_z
, m_w
+ b
.m_w
);
45 const Vector4f
& operator+=( const Vector4f
& b
)
54 const Vector4f
& operator-=( const Vector4f
& b
)
63 const Vector4f
& operator*=( float f
)
72 bool operator==( const Vector4f
& b
) const
74 // Placeholder, need to do the comparison right
75 return m_x
== b
.m_x
&&
80 bool operator!=( const Vector4f
& b
) const
82 return m_x
!= b
.m_x
||
88 bool operator<( const Vector4f
& b_
) const
90 // TODO: You fail it (it is floating point comparisons)