renderstack::vec4 Class Reference
simple four component float vector
#include <vec4.hpp>
Detailed Description
Definition at line 35 of file vec4.hpp.
Constructor & Destructor Documentation
renderstack::vec4::vec4 |
( |
float |
_x = 0 , |
|
|
float |
_y = 0 , |
|
|
float |
_z = 0 , |
|
|
float |
_w = 0 | |
|
) |
| | [inline] |
Definition at line 38 of file vec4.hpp.
00039 : x(_x)
00040 , y(_y)
00041 , z(_z)
00042 , w(_w)
00043 {
00044 }
renderstack::vec4::vec4 |
( |
vec3 const & |
v3, |
|
|
float |
_w = 0 | |
|
) |
| | [inline] |
Definition at line 46 of file vec4.hpp.
00047 : x(v3.x)
00048 , y(v3.y)
00049 , z(v3.z)
00050 , w(_w)
00051 {
00052 }
Member Function Documentation
vec4 renderstack::vec4::operator+ |
( |
vec4 const & |
v |
) |
const [inline] |
Definition at line 54 of file vec4.hpp.
00055 {
00056 return vec4(x + v.x, y + v.y, z + v.z, w + v.w);
00057 }
vec4& renderstack::vec4::operator+= |
( |
vec4 const & |
v |
) |
[inline] |
Definition at line 59 of file vec4.hpp.
00060 {
00061 x += v.x;
00062 y += v.y;
00063 z += v.z;
00064 w += v.w;
00065 return *this;
00066 }
vec4 renderstack::vec4::operator- |
( |
vec4 const & |
v |
) |
const [inline] |
Definition at line 68 of file vec4.hpp.
00069 {
00070 return vec4(x - v.x, y - v.y, z - v.z, w - v.w);
00071 }
vec4& renderstack::vec4::operator-= |
( |
vec4 const & |
v |
) |
[inline] |
Definition at line 73 of file vec4.hpp.
00074 {
00075 x -= v.x;
00076 y -= v.y;
00077 z -= v.z;
00078 w -= v.w;
00079 return *this;
00080 }
bool renderstack::vec4::operator== |
( |
vec4 const & |
v |
) |
const [inline] |
Definition at line 82 of file vec4.hpp.
00083 {
00084 return
00085 (x == v.x) &&
00086 (y == v.y) &&
00087 (z == v.z) &&
00088 (w == v.w);
00089 }
vec4 renderstack::vec4::operator* |
( |
float |
f |
) |
const [inline] |
Definition at line 90 of file vec4.hpp.
00091 {
00092 return vec4(f * x, f * y, f * z, f * w);
00093 }
vec4& renderstack::vec4::operator*= |
( |
float |
f |
) |
[inline] |
Definition at line 95 of file vec4.hpp.
00096 {
00097 x *= f;
00098 y *= f;
00099 z *= f;
00100 w *= f;
00101 return *this;
00102 }
vec4 renderstack::vec4::operator/ |
( |
float |
f |
) |
const [inline] |
Definition at line 104 of file vec4.hpp.
00105 {
00106 float inv = 1.0f / f;
00107 return vec4(x * inv, y * inv, z * inv, w * inv);
00108 }
vec4& renderstack::vec4::operator/= |
( |
float |
f |
) |
[inline] |
Definition at line 110 of file vec4.hpp.
00111 {
00112 float inv = 1.f / f;
00113 x *= inv;
00114 y *= inv;
00115 z *= inv;
00116 w *= inv;
00117 return *this;
00118 }
vec4 renderstack::vec4::operator- |
( |
|
) |
const [inline] |
float renderstack::vec4::operator[] |
( |
int |
i |
) |
const [inline] |
Definition at line 125 of file vec4.hpp.
00126 {
00127 return (&x)[i];
00128 }
float& renderstack::vec4::operator[] |
( |
int |
i |
) |
[inline] |
Definition at line 130 of file vec4.hpp.
00131 {
00132 return (&x)[i];
00133 }
float renderstack::vec4::length_squared |
( |
|
) |
const [inline] |
float renderstack::vec4::length |
( |
|
) |
const [inline] |
Field Documentation
The documentation for this class was generated from the following file: