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

# ExCVertex.cpp

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: ExCVertex.cpp,v 1.4 2002/06/16 00:51:08 binny Exp $
    00021  *
    00022  */
    00023
    00024 #include "ExCVertex.h"
    00025
    00026 ExCVertex::ExCVertex(void)
    00027 {
    00028         m_dA=0.0f;
    00029         m_dB=0.0f;
    00030         m_dG=0.0f;
    00031         m_dR=0.0f;
    00032         m_dU=0.0f;
    00033         m_dV=0.0f;
    00034         m_dX=0.0f;
    00035         m_dY=0.0f;
    00036         m_dZ=0.0f;
    00037 }
    00038
    00039 ExCVertex::ExCVertex(double x,double y,double z)
    00040 {
    00041         SetA(0.0f);
    00042         SetB(0.0f);
    00043         SetG(0.0f);
    00044         SetR(0.0f);
    00045         SetU(0.0f);
    00046         SetV(0.0f);
    00047         SetX(x);
    00048         SetY(y);
    00049         SetZ(z);
    00050 }
    00051
    00052 ExCVertex::ExCVertex(double x,double y,double z,double u,double v)
    00053 {
    00054         m_dA=0.0f;
    00055         m_dB=0.0f;
    00056         m_dG=0.0f;
    00057         m_dR=0.0f;
    00058         m_dU=u;
    00059         m_dV=v;
    00060         m_dX=x;
    00061         m_dY=y;
    00062         m_dZ=z;
    00063 }
    00064
    00065 ExCVertex::ExCVertex(double x,double y,double z,double r,double g,double b,double a)
    00066 {
    00067         m_dA=a;
    00068         m_dB=b;
    00069         m_dG=g;
    00070         m_dR=r;
    00071         m_dU=0.0f;
    00072         m_dV=0.0f;
    00073         m_dX=x;
    00074         m_dY=y;
    00075         m_dZ=z;
    00076 }
    00077
    00078 ExCVertex::ExCVertex(double x,double y,double z,double u,double v,double r,double g,double b,double a)
    00079 {
    00080         m_dA=a;
    00081         m_dB=b;
    00082         m_dG=g;
    00083         m_dR=r;
    00084         m_dU=u;
    00085         m_dV=v;
    00086         m_dX=x;
    00087         m_dY=y;
    00088         m_dZ=z;
    00089 }
    00090
    00091 /*ExCVertex::ExCVertex(ExCVertex& copy)
    00092 {
    00093         m_dA=copy.GetA();
    00094         m_dB=copy.GetB();
    00095         m_dG=copy.GetG();
    00096         m_dR=copy.GetR();
    00097         m_dU=copy.GetU();
    00098         m_dV=copy.GetV();
    00099         m_dX=copy.GetX();
    00100         m_dY=copy.GetY();
    00101         m_dZ=copy.GetZ();
    00102 }*/
    00103
    00104 ExCVertex::~ExCVertex(void)
    00105 {
    00106 }
    00107 /*
    00108 ExCVertex& ExCVertex::operator =(const ExCVertex&  vertex)
    00109 {
    00110         m_dA=vertex->GetA();
    00111         m_dB=vertex->GetB();
    00112         m_dG=vertex->GetG();
    00113         m_dR=vertex->GetR();
    00114         m_dU=vertex->GetU();
    00115         m_dV=vertex->GetV();
    00116         m_dX=vertex->GetX();
    00117         m_dY=vertex->GetY();
    00118         m_dZ=vertex->GetZ();
    00119         return *this;
    00120 }
    00121
    00122 ExCVertex ExCVertex::operator +(ExCVertex a)
    00123 {
    00124         SetA(a.GetA());
    00125         SetB(a.GetB());
    00126         SetG(a.GetG());
    00127         SetR(a.GetR());
    00128         SetU(a.GetU());
    00129         SetV(a.GetV());
    00130         SetX(a.GetX()+GetX());
    00131         SetY(a.GetY()+GetY());
    00132         SetZ(a.GetZ()+GetZ());
    00133         return this;
    00134 }
    00135
    00136 ExCVertex ExCVertex::operator -(ExCVertex a)
    00137 {
    00138         SetA(a.GetA());
    00139         SetB(a.GetB());
    00140         SetG(a.GetG());
    00141         SetR(a.GetR());
    00142         SetU(a.GetU());
    00143         SetV(a.GetV());
    00144         SetX(GetX()-a.GetX());
    00145         SetY(GetY()-a.GetY());
    00146         SetZ(GetZ()-a.GetZ());
    00147         return this;
    00148 }
    00149
    00150 bool ExCVertex::operator ==(const ExCVertex a)
    00151 {
    00152         if(a.GetA()==GetB()&&
    00153                 a.GetB()==GetB()&&
    00154                 a.GetG()==GetG()&&
    00155                 a.GetR()==GetR()&&
    00156                 a.GetU()==GetU()&&
    00157                 a.GetV()==GetV()&&
    00158                 a.GetX()==GetX()&&
    00159                 a.GetY()==GetY()&&
    00160                 a.GetZ()==GetZ())
    00161         {
    00162                 return true;
    00163         }else
    00164         {
    00165                 return false;
    00166         }
    00167 }*/