1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef VECTOR3D_H
- #define VECTOR3D_H
- #include <iostream>
- class Vector3D
- {
- public:
- Vector3D();
- Vector3D(float ix, float iy, float iz);
- Vector3D(const Vector3D& orig);
- virtual ~Vector3D();
-
- 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 set(const Vector3D& v);
- void setInverse(const Vector3D& v);
- void setMul(const Vector3D& v, float f);
- void setAngles(float lengthAngle, float widthAngle);
-
- void add(const Vector3D& v);
- void sub(const Vector3D& v);
- void mul(float f);
- void addMul(const Vector3D& v, float f);
-
- void cross(float ix, float iy, float iz);
- void cross(const Vector3D& v);
-
- void normalize();
- float length() const;
-
- float dot(const Vector3D& v) const;
- float dotInverse(const Vector3D& v) const;
- private:
- float x;
- float y;
- float z;
- };
- std::ostream& operator<<(std::ostream& os, const Vector3D& v);
- #endif
|