54 |
v[3] = w; |
v[3] = w; |
55 |
} |
} |
56 |
|
|
57 |
|
//! \brief Index operator |
58 |
|
//! \param index Index of component. |
59 |
|
T |
60 |
|
operator[] (int index) const |
61 |
|
{ |
62 |
|
return v[index]; |
63 |
|
} |
64 |
|
|
65 |
//! \brief Output stream operator |
//! \brief Output stream operator |
66 |
friend std::ostream& |
friend std::ostream& |
67 |
operator << (std::ostream& out, const Vector4& vector) |
operator << (std::ostream& out, const Vector4& vector) |
222 |
//! \brief Returns cross product |
//! \brief Returns cross product |
223 |
//! \param[in] rhs Right operand. |
//! \param[in] rhs Right operand. |
224 |
T |
T |
225 |
cross(const Vector4& rhs) |
cross(const Vector4& rhs) const |
226 |
{ |
{ |
227 |
return Vector4(v[1] * rhs.v[2] - v[2] * rhs.v[1], |
return Vector4(v[1] * rhs.v[2] - v[2] * rhs.v[1], |
228 |
v[2] * rhs.v[0] - v[0] * rhs.v[2], |
v[2] * rhs.v[0] - v[0] * rhs.v[2], |