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

# ExCMeshSmogEffect.cpp

Aller à la documentation de ce fichier.

    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
    00021  *
    00022  */
    00023
    00024 #include "ExCMeshSmogEffect.h"
    00025
    00026 ExCMeshSmogEffect::ExCMeshSmogEffect()
    00027 {
    00028 Guard(ExCMeshSmogEffect::ExCMeshSmogEffect())
    00029         SetName("ExCMeshSmogEffect");
    00030         SetType(typeid(this).name());
    00031         m_CurrentAnimationTexture=0;
    00032         m_Size=0.1;
    00033 UnGuard
    00034 }
    00035
    00036 ExCMeshSmogEffect::~ExCMeshSmogEffect()
    00037 {
    00038 Guard(ExCMeshSmogEffect::~ExCMeshSmogEffect())
    00039 UnGuard
    00040 }
    00041
    00042 void ExCMeshSmogEffect::Draw(void)
    00043 {
    00044 Guard(void ExCMeshSmogEffect::Draw(void))
    00045 if(!m_Visible)return;
    00046         ExCVec3D v1,v2,v3,v4,up,right;
    00047         GLfloat viewMatrix[16];
    00048         glPushMatrix();
    00049         glGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix);
    00050
    00051         right.SetValue(viewMatrix[0],viewMatrix[4],viewMatrix[8]);
    00052         up.SetValue(viewMatrix[1],viewMatrix[5],viewMatrix[9]);
    00053         v1=m_Position+(right+up)*-m_Size;
    00054         v2=m_Position+(right-up)*m_Size;
    00055         v3=m_Position+(right+up)*m_Size;
    00056         v4=m_Position+(up-right)*m_Size;
    00057
    00058         ManagerTexture->SetCurrentObject("wave.dds");
    00059         glPushAttrib(GL_ALL_ATTRIB_BITS);
    00060         glEnable(GL_TEXTURE_2D);
    00061         glDisable(GL_LIGHTING);
    00062         glColor4f(1.0f,1.0f,1.0f,1.0f);
    00063
    00064         glRotatef(90,0,0,1);
    00065
    00066         glBegin(GL_QUADS);
    00067                 glTexCoord2f(0.0f, 0.0f); glVertex3fv(v1.m_Vector);
    00068                 glTexCoord2f(1.0f, 0.0f); glVertex3fv(v2.m_Vector);
    00069                 glTexCoord2f(1.0f, 1.0f); glVertex3fv(v3.m_Vector);
    00070                 glTexCoord2f(0.0f, 1.0f); glVertex3fv(v4.m_Vector);
    00071         glEnd();
    00072
    00073                 glPopAttrib();
    00074         glPopMatrix();
    00075 UnGuard
    00076 }
    00077
    00078 bool ExCMeshSmogEffect::Load(std::string FileName)
    00079 {
    00080 Guard(bool ExCMeshSmogEffect::Load(std::string FileName))
    00081         ManagerTexture->Add("wave.dds");
    00082 UnGuard
    00083 }