33 #ifndef __I6ENGINE_MATH_I6EVECTOR4_H__
34 #define __I6ENGINE_MATH_I6EVECTOR4_H__
57 static const double EPSILON;
69 i6eVector4(
const double w,
const double x,
const double y,
const double z) : _w(w), _x(x), _y(y), _z(z) {
77 explicit i6eVector4(
const Ogre::Vector4 & ogre);
92 i6eVector4(
const std::map<std::string, std::string> & params,
const std::string & prefix);
143 return i6eVector4(_w + other._w, _x + other._x, _y + other._y, _z + other._z);
150 return i6eVector4(_w - other._w, _x - other._x, _y - other._y, _z - other._z);
157 return i6eVector4(_w * d, _x * d, _y * d, _z * d);
164 return std::abs(_x - b.
getX()) < EPSILON && std::abs(_y - b.
getY()) < EPSILON && std::abs(_z - b.
getZ()) < EPSILON && std::abs(_w - b.
getW()) < EPSILON;
171 return !(*
this == other);
179 Ogre::Vector4 toOgre()
const;
186 btVector4 toBullet()
const;
191 void insertInMap(
const std::string & prefix, std::map<std::string, std::string> & map)
const;
196 std::string toString()
const;
201 template<
class Archive>
210 double _w, _x, _y, _z;
Implements 4-dimensional vectors.
bool operator==(const i6eVector4 &b) const
Operator '==' for Vector4.
double getW() const
getters for the values of the Vector
i6eVector4 operator*(double d) const
operator
void setW(const double w)
setters for the values of the Vector
i6e::math::i6eVector4 Vec4
i6eVector4(const double w, const double x, const double y, const double z)
Creates a new vector with all values set to the given values.
void setZ(const double z)
void setX(const double x)
i6eVector4()
Creates a new vector with all values set to 0.
void serialize(Archive &ar, const unsigned int)
serializer for the vector
ISIXE_MATH_API std::ostream & operator<<(std::ostream &stream, const i6eQuaternion &q)
stream operator for quaternion
void setY(const double y)
i6eVector4 operator+(const i6eVector4 &other) const
operator
bool operator!=(const i6eVector4 &other) const
Operator '!=' for Vector4 calls == and negatiates result.
i6eVector4 operator-(const i6eVector4 &other) const
operator