1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #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;
- 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 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
|