25 #ifndef __I6ENGINE_MATH_I6EVECTOR_H__
26 #define __I6ENGINE_MATH_I6EVECTOR_H__
49 static const double EPSILON;
57 i6eVector() : _x(0.0), _y(0.0), _z(0.0), _valid(false) {
63 i6eVector(
const double x,
const double y,
const double z) : _x(x), _y(y), _z(z), _valid(true) {
71 explicit i6eVector(
const Ogre::Vector3 & ogre);
78 explicit i6eVector(
const btVector3 & bullet);
85 explicit i6eVector(
const std::string & s);
93 i6eVector(
const std::map<std::string, std::string> & params,
const std::string & prefix);
145 return i6eVector(_y * b._z - _z * b._y, _z * b._x - _x * b._z, _x * b._y - _y * b._x);
152 return i6eVector(_x * b, _y * b, _z * b);
159 return a._x * b._x + a._y * b._y + a._z * b._z;
166 return i6eVector(getX() / b, getY() / b, getZ() / b);
173 setX(getX() + b.
getX());
174 setY(getY() + b.
getY());
175 setZ(getZ() + b.
getZ());
198 return !(*
this == b);
210 return i6eVector(a._y * b._z - a._z * b._y, a._z * b._x - a._x * b._z, a._x * b._y - a._y * b._x);
233 void insertInMap(
const std::string & prefix, std::map<std::string, std::string> & map)
const;
250 bool isValid()
const;
251 void setValid(
bool b);
256 double length()
const;
263 Ogre::Vector3 toOgre()
const;
270 Ogre::Vector2 toOgre2()
const;
277 btVector3 toBullet()
const;
284 std::string toString()
const;
289 template<
class Archive>
bool operator!=(const i6eVector &b) const
Operator '!=' for Vector.
i6e::math::i6eVector Vec3
void serialize(Archive &ar, const unsigned int)
serializer for the vector
i6eVector operator/(const double b) const
Operator '/' for Vectors with a scalar.
std::enable_if< std::is_integral< T >::value, bool >::type operator==(const i6eVector2< T > &first, const i6eVector2< T > &second)
static double scalProd(const i6eVector &a, const i6eVector &b)
operator '*' for vectors
static i6eVector crossProd(const i6eVector &a, const i6eVector &b)
Operator '*' for Vectors (cross product)
i6eVector operator*(const double b) const
operator '*' for scalars
Implements 3-dimensional vectors.
void setZ(const double z)
void setY(const double y)
i6eVector operator-(const i6eVector &b) const
Operator '-' for Vectors.
i6eVector()
Creates a new vector with all values set to 0.
static const i6eVector ZERO
i6eVector operator+(const i6eVector &b) const
Operator '+' for Vectors.
i6eVector(const double x, const double y, const double z)
Creates a new vector with all values set to the given values.
i6eVector operator*(const i6eVector &b) const
operator '*' for vectors
void mulComponents(const i6eVector &b)
muliplies two Vectors per component
i6eVector operator-=(const i6eVector &b)
Operator '-=' for Vectors.
double getX() const
getters for the values of the Vector
ISIXE_MATH_API std::ostream & operator<<(std::ostream &stream, const i6eQuaternion &q)
stream operator for quaternion
void setX(const double x)
setters for the values of the Vector
i6eVector operator+=(const i6eVector &b)
Operator '+=' for Vectors.