mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
30 lines
605 B
C++
30 lines
605 B
C++
#ifndef _VECTOR_H_
|
|
#define _VECTOR_H_
|
|
|
|
class Vector
|
|
{
|
|
public:
|
|
Vector();
|
|
Vector(float x, float y, float z);
|
|
Vector(const float *point);
|
|
Vector(const float *p1, const float *p2);
|
|
~Vector() { };
|
|
|
|
float Dot(const Vector& vec);
|
|
float Angle(const Vector& vec);
|
|
Vector& Cross(const Vector& v1, const Vector& v2);
|
|
Vector& operator+=(const Vector& add);
|
|
Vector& operator-=(const Vector& sub);
|
|
Vector& operator*=(float scalar);
|
|
|
|
operator const float*() const
|
|
{ return m_fPoint; }
|
|
void ToFloat(float *point);
|
|
float Length();
|
|
void Normalize();
|
|
|
|
protected:
|
|
float m_fPoint[3];
|
|
};
|
|
|
|
#endif // _VECTOR_H_
|