Page principale | Liste des namespaces | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Composants | Déclarations

Vector3.h

Aller à la documentation de ce fichier.
00001 /*=========================================================================
00002     UberSim Source Code Release
00003     -------------------------------------------------------------------------
00004     Copyright (C) 2002 Manuela Veloso, Brett Browning, Mike Bowling,
00005     James Bruce; {mmv, brettb, mhb, jbruce}@cs.cmu.edu
00006     Erick Tryzelaar {erickt}@andrew.cmu.edu
00007     School of Computer Science, Carnegie Mellon University
00008     -------------------------------------------------------------------------
00009     This software is distributed under the GNU General Public License,
00010     version 2.  If you do not have a copy of this licence, visit
00011     www.gnu.org, or write: Free Software Foundation, 59 Temple Place,
00012     Suite 330 Boston, MA 02111-1307 USA.  This program is distributed
00013     in the hope that it will be useful, but WITHOUT ANY WARRANTY,
00014     including MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00015     -------------------------------------------------------------------------*/
00016 
00017 #ifndef __SIM_VECTOR3_H__
00018 #define __SIM_VECTOR3_H__
00019 
00020 #include "Math.h"
00026 class Vector3
00027 {
00028     public:
00029         static const Vector3 ZERO;
00030         static const Vector3 UNIT_X;
00031         static const Vector3 UNIT_Y;
00032         static const Vector3 UNIT_Z;
00033 
00034     public:
00035         Real x;
00036         Real y;
00037         Real z;
00038 
00039     public:
00040         Vector3  ();
00041         Vector3  (Real x, Real y, Real z);
00042         Vector3  (const Real* vector);
00043         Vector3  (const Vector3& vector);
00044         ~Vector3 ();
00045 
00046     public:
00047         Real& operator [] (const unsigned int i) const;
00048         operator Real* ();
00049 
00050         const bool operator == (const Vector3& vector) const;
00051         const bool operator != (const Vector3& vector) const;
00052 
00053         const Vector3& operator  = (const Vector3& vector);
00054         const Vector3& operator += (const Real     scalar);
00055         const Vector3& operator += (const Vector3& vector);
00056         const Vector3& operator -= (const Real     scalar);
00057         const Vector3& operator -= (const Vector3& vector);
00058         const Vector3& operator *= (const Real     scalar);
00059         const Vector3& operator /= (const Real     scalar);
00060 
00061         const Vector3 operator - () const;
00062         const Vector3 operator + (const Real     scalar) const;
00063         const Vector3 operator + (const Vector3& vector) const;
00064         const Vector3 operator - (const Real     scalar) const;
00065         const Vector3 operator - (const Vector3& vector) const;
00066         const Vector3 operator * (const Real     scalar) const;
00067         const Vector3 operator / (const Real     scalar) const;
00068 
00069         friend const Vector3 operator + (const Real scalar, const Vector3& vector);
00070         friend const Vector3 operator - (const Real scalar, const Vector3& vector);
00071         friend const Vector3 operator * (const Real scalar, const Vector3& vector);
00072 
00073     public:
00074         const Real    dot           (const Vector3& vector) const;
00075         const Vector3 cross         (const Vector3& vector) const;
00076         const Real    lengthSquared () const;
00077         const Real    length        () const;
00078         const Vector3 unit          () const;
00079         void          normalize     ();
00080     static bool is3DPointBelongTo3DLine(Vector3 thePoint, Vector3 firstPoint, Vector3 secondPoint);
00081     static bool is3DPointBelongTo3DSegment(Vector3 thePoint, Vector3 firstPoint, Vector3 secondPoint);
00082     static bool isEqual(Vector3 aVector, Vector3 anotherVector);
00083 
00084 };
00085 
00086 #endif

Généré le Mon Mar 1 01:29:41 2004 par doxygen 1.3.3