12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef VECTOR_H
- #define VECTOR_H
- #include <iostream>
- #include "client/math/Matrix.h"
- class Vector final {
- public:
- Vector();
- Vector(float ix, float iy, float iz);
- float getX() const;
- float getY() const;
- float getZ() const;
- void setX(float ix);
- void setY(float iy);
- void setZ(float iz);
- void set(float ix, float iy, float iz);
- void setInverse(const Vector& v);
- void setMul(const Vector& v, float f);
- void setAngles(float lengthAngle, float widthAngle);
- void add(const Vector& v);
- void sub(const Vector& v);
- void mul(float f);
- void mul(const Matrix& m);
- void addMul(const Vector& v, float f);
- void cross(float ix, float iy, float iz);
- void cross(const Vector& v);
- void normalize();
- float squareLength() const;
- float dot(const Vector& v) const;
- float dotInverse(const Vector& v) const;
- private:
- float x;
- float y;
- float z;
- };
- std::ostream& operator<<(std::ostream& os, const Vector& v);
- #endif
|