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