Main Page Namespace List Class Hierarchy Alphabetical List Data Structures File List Namespace Members Data Fields Globals

# ExCVec3D.h

Go to the documentation of this file.

    00001 /*
    00002  * ExNihilo 3D Engine
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  *
    00018  * Please read AUTHORS file !!!
    00019  *
    00020  * $Id: ExCVec3D.h,v 1.8 2002/11/09 16:09:40 data Exp $
    00021  *
    00022  */
    00023
    00024
    00025 #ifndef __EXCVEC3D_H__
    00026 #define __EXCVEC3D_H__
    00027
    00028 #include "ExDefine.h"
    00029 #include <math.h>
    00030 #include <cmath>
    00031
    00032 class ExCVec3D
    00033 {
    00034 public:
    00035 //--------------------------------
    00036 //Variable
    00037 //--------------------------------
    00038         float m_Vector[3];
    00039 //--------------------------------
    00040 //Constructor // Destructor
    00041 //--------------------------------
    00042         ExCVec3D();
    00043         ExCVec3D(float x,float y,float z);
    00044         ExCVec3D(float x,float y);
    00045         ExCVec3D(float x);
    00046         ExCVec3D(const ExCVec3D &vec);
    00047         ~ExCVec3D();
    00048 //--------------------------------
    00049 //Methode
    00050 //--------------------------------
    00051         float GetVectorLenght(void);
    00052         ExCVec3D GetVecNormale(void);
    00053         void SetValue(float x,float y,float z);
    00054         inline void SetX(float val){m_Vector[0]=val;}
    00055         inline void SetY(float val){m_Vector[1]=val;}
    00056         inline void SetZ(float val){m_Vector[2]=val;}
    00057         inline float GetX(void){return m_Vector[0];}
    00058         inline float GetY(void){return m_Vector[1];}
    00059         inline float GetZ(void){return m_Vector[2];}
    00060 //--------------------------------
    00061 // Operator
    00062 //--------------------------------
    00063         ExCVec3D& operator=(const ExCVec3D& Vec);
    00064         bool  operator==(const ExCVec3D& Vec);
    00065         ExCVec3D  operator+(const ExCVec3D& Vec);
    00066         //ExCVec3D  operator+=(const ExCVec3D& Vec);
    00067         ExCVec3D  operator++();
    00068         ExCVec3D  operator++(int);
    00069         ExCVec3D  operator-(const ExCVec3D& Vec);
    00070         //ExCVec3D  operator-=(const ExCVec3D& Vec);
    00071         ExCVec3D  operator--();
    00072         ExCVec3D  operator--(int);
    00073         ExCVec3D  operator*(const ExCVec3D& Vec);
    00074         //ExCVec3D  operator*=(const ExCVec3D& Vec);
    00075         ExCVec3D  operator*(float scalar);
    00076         //ExCVec3D  operator*=(float scalar);
    00077         ExCVec3D  operator/(const ExCVec3D& Vec);
    00078         //ExCVec3D  operator/=(const ExCVec3D& Vec);
    00079         ExCVec3D  operator/(float scalar);
    00080         //ExCVec3D  operator/=(float scalar);
    00081 //--------------------------------
    00082 // friends
    00083 //--------------------------------
    00084         friend std::ostream& operator<<(std::ostream& s,const ExCVec3D &vec);
    00085         friend std::ostrstream& operator<<(std::ostrstream& s,const ExCVec3D &vec);
    00086 };
    00087
    00088 #endif // __EXCVEC3D_H__
    00089