1 #ifndef AWFUL_MATH_VECTOR3F_H_
2 #define AWFUL_MATH_VECTOR3F_H_
7 namespace awful
{ namespace math
18 Vector3f( float x_
, float y_
, float z_
) :
25 float& x() { return m_x
; }
26 float& y() { return m_y
; }
27 float& z() { return m_z
; }
28 const float& x() const { return m_x
; }
29 const float& y() const { return m_y
; }
30 const float& z() const { return m_z
; }
32 Vector3f
operator+( const Vector3f
& b
) const
34 return Vector3f( m_x
+ b
.m_x
, m_y
+ b
.m_y
, m_z
+ b
.m_z
);
37 Vector3f
operator-( const Vector3f
& b
) const
39 return Vector3f( m_x
- b
.m_x
, m_y
- b
.m_y
, m_z
+ b
.m_z
);
42 const Vector3f
& operator+=( const Vector3f
& b
)
50 const Vector3f
& operator-=( const Vector3f
& b
)
58 bool operator==( const Vector3f
& b
) const
60 return m_x
== b
.m_x
&& m_y
== b
.m_y
&& m_z
== b
.m_z
;
65 return std::sqrt( m_x
* m_x
+ m_y
* m_y
+ m_z
* m_z
);