summaryrefslogtreecommitdiff
path: root/common/vector.h
diff options
context:
space:
mode:
authorleo2006-03-02 18:29:08 +0000
committerleo2006-03-02 18:29:08 +0000
commitb18cb77e8c9acf8c1d5ee351477e8adb4ffbae9f (patch)
treea8dc6089f661b0d099bfc095c64a7e423e413ca2 /common/vector.h
parentb7c522acf840dd211e54141f1dbda5b5c268971e (diff)
Removed a few old math functions.
git-svn-id: http://svn.leocad.org/trunk@504 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/vector.h')
-rw-r--r--common/vector.h59
1 files changed, 20 insertions, 39 deletions
diff --git a/common/vector.h b/common/vector.h
index defce45..2458e30 100644
--- a/common/vector.h
+++ b/common/vector.h
@@ -1,49 +1,30 @@
-// Vector.h: interface for the Vector class.
-//
-//////////////////////////////////////////////////////////////////////
-
#ifndef _VECTOR_H_
#define _VECTOR_H_
-class Vector
+class Vector
{
- public:
- Vector ();
- Vector (float x, float y, float z);
- Vector (const float *point);
- Vector (const float *p1, const float *p2);
- virtual ~Vector ();
-
- float X ()
- { return m_fPoint[0]; }
- float Y ()
- { return m_fPoint[1]; }
- float Z ()
- { return m_fPoint[2]; }
+public:
+ Vector();
+ Vector(float x, float y, float z);
+ Vector(const float *point);
+ Vector(const float *p1, const float *p2);
+ ~Vector() { };
- float Dot (Vector& vec);
- float Angle (Vector& vec);
- Vector& Cross (Vector& v1, Vector& v2);
- void Add (const float *point);
- void Add (float x, float y, float z);
- Vector& operator+=(Vector& add);
- Vector& operator-=(Vector& sub);
- Vector& operator*=(float scalar);
- Vector& operator=(Vector& source);
- Vector& operator=(const float *point);
- bool operator==(Vector& vec);
+ float Dot(Vector& vec);
+ float Angle(Vector& vec);
+ Vector& Cross(Vector& v1, Vector& v2);
+ Vector& operator+=(Vector& add);
+ Vector& operator-=(Vector& sub);
+ Vector& operator*=(float scalar);
- operator const float* () const
- { return m_fPoint; }
- void ToFloat (float *point);
- void FromFloat (const float *point);
- void FromFloat (float x, float y, float z);
- float Length ();
- void Normalize ();
- void Scale (float scale);
+ operator const float*() const
+ { return m_fPoint; }
+ void ToFloat(float *point);
+ float Length();
+ void Normalize();
- protected:
- float m_fPoint[3];
+protected:
+ float m_fPoint[3];
};
#endif // _VECTOR_H_