Hauptseite | Liste aller Namensbereiche | Klassenhierarchie | Alphabetische Liste | Datenstrukturen | Auflistung der Dateien | Datenstruktur-Elemente | Datei-Elemente

Planet.cpp

gehe zur Dokumentation dieser Datei
00001 /*
00002 Autor: $Author: kunkel $ State: $State: Exp $
00003 Datum: $Date: 2005/05/30 12:35:25 $
00004 Version: $Revision: 1.1 $
00005 */
00006 
00011 #include "Planet.h"
00012 #include "TextureManager.h"
00013 #include "Window.h"
00014 
00018 void Planet::draw() {
00019     //
00020     drawBegin();
00021 
00023     glColor3f(1.0, 1.0, 1.0);
00024 
00025     GLfloat emission[] = { 0, 0, 0, 1.0 };
00026     // setze Materialeigenschaften
00027     glMaterialfv(GL_FRONT, GL_EMISSION, emission);
00028 
00029     glPushMatrix();
00030 
00031     // distance adaption
00032     Vector adaptedpos = getScaledPos();
00033     glTranslatef(adaptedpos.x,adaptedpos.y,adaptedpos.z);
00034 
00035     //Texturanbringung:
00036     GLUquadricObj *  planetQuadric = gluNewQuadric();
00037 
00038     if(ourConfiguration.showTextures) {
00039         glEnable (GL_TEXTURE_2D);
00040         glBindTexture (GL_TEXTURE_2D, getOpenglTextureNumber());
00041         gluQuadricTexture( planetQuadric, GL_TRUE );
00042     }
00043 
00044     gluSphere( planetQuadric, getScaledRadius(),
00045                ourConfiguration.sphereDetaillevel,
00046                ourConfiguration.sphereDetaillevel );
00047 
00048     glDisable(GL_TEXTURE_2D);
00049 
00050     glPopMatrix();
00051     gluDeleteQuadric(planetQuadric);
00052 
00053     drawEnd();
00054 }
00055 
00056 char * Planet::getType() {
00057     return "planet";
00058 }
00059 
00060 /* EXAMPLE FOR ENHANCING OF WINDOW
00061 void planet::createAttributeWindow(){
00062         createBasisAttributeWindow("planet");
00063         if(editAttributes->additionalInformation != 0) return; //Nothing to do  ...
00064  
00065         GLUI * aw= editAttributes->attributeWindow;     
00066         editAttributes->additionalInformation = (void *)(new int);
00067         
00068         GLUI_Rollout * pO = aw->add_rollout("Planet Options",true);
00069         aw->add_spinner_to_panel(pO,"TESTWERT", GLUI_SPINNER_INT, 
00070                         (int*)(editAttributes->additionalInformation));
00071         
00072         loadAttributes();
00073         aw->sync_live();
00074 }
00075  
00076 void planet::loadAttributes(){
00077         object::loadAttributes();
00078         *((int*) editAttributes->additionalInformation) = TESTWERT ;
00079 }
00080  
00081 void planet::saveAttributes(){
00082         object::saveAttributes();
00083         TESTWERT = *((int *)(editAttributes->additionalInformation));
00084 }
00085  
00086 void planet::deleteAdditionalInformation(void * additionalInformation){
00087         delete((int *)(additionalInformation));
00088 }
00089 */

Erzeugt am Mon May 30 14:31:15 2005 für Sunsystembuildingandsimulation von doxygen 1.3.6