00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00031 #include <list>
00032 #include <string>
00033 #include <iostream>
00034
00036 #ifndef WIN32
00037 #include <GL/gl.h>
00038 #include <GL/glu.h>
00039 #endif
00040
00042 #include "Noeuds.h"
00043 #include "Scene.h"
00044
00045
00046
00047
00051 Scene::Scene(std::string Fichier_Param)
00052 {
00053
00054
00055 Param(Fichier_Param);
00056 }
00057
00058
00059
00063 void Scene::attache(Noeud *n)
00064 {
00065 _enfants.push_back(n);
00066 }
00067
00068
00072 void Scene::getName()
00073 {
00074 ListeNoeuds::iterator e;
00075 std::cout << "----------------- Objets de la scene : " ;
00076
00077 for(e=_enfants.begin(); e!=_enfants.end(); e++)
00078 {
00079 std::cout << (*e)->getName() << " " ;
00080 }
00081
00082 std::cout << " " << std::endl;
00083 }
00084
00085
00089 void Scene::init()
00090 {
00091
00092 ListeNoeuds::iterator e;
00093
00094 for(e=_enfants.begin(); e!=_enfants.end(); e++)
00095 {
00096 (*e)->init();
00097 }
00098 }
00099
00100
00104 void Scene::affiche()
00105 {
00106
00107 ListeNoeuds::iterator e;
00108
00109 for(e=_enfants.begin(); e!=_enfants.end(); e++)
00110 {
00111 (*e)->affiche();
00112 }
00113 }
00114
00115
00116
00120 void Scene::Simulation(int Tps)
00121 {
00122
00123 ListeNoeuds::iterator e;
00124
00125 for(e=_enfants.begin(); e!=_enfants.end(); e++)
00126 {
00127 (*e)->Simulation(_g, _visco, Tps);
00128 }
00129 }
00130
00131
00132
00133
00134
00135 void Scene::setGravite(Coord g)
00136 {
00137
00138 _g.setX(g.getX());
00139 _g.setY(g.getY());
00140 _g.setZ(g.getZ());
00141 }
00142
00143
00144
00145
00146
00147 void Scene::setVisco(float visco)
00148 {
00149
00150 _visco = visco;
00151 }