Changeset 6507 in orxonox.OLD for branches/avi_play/src/world_entities
- Timestamp:
- Jan 15, 2006, 3:33:54 PM (19 years ago)
- Location:
- branches/avi_play/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/world_entities/movie_entity.cc
r6489 r6507 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 12 10 13 11 ### File Specific: 14 main-programmer: hdavid, stefalie12 main-programmer: David Hasenfratz, Stefan Lienhard 15 13 co-programmer: 16 14 */ 17 15 18 16 #include "movie_entity.h" 19 #include "fast_factory.h" 17 18 #include "media_container.h" 19 #include "load_param.h" 20 #include "factory.h" 21 #include "material.h" 22 23 #include "network_game_manager.h" 24 #include "converter.h" 20 25 21 26 using namespace std; 22 27 23 CREATE_FA ST_FACTORY_STATIC(MovieEntity, CL_MOVIE_ENTITY);28 CREATE_FACTORY(MovieEntity, CL_MOVIE_ENTITY); 24 29 25 30 /** … … 30 35 this->setClassID(CL_MOVIE_ENTITY, "MovieEntity"); 31 36 37 media_container = new MediaContainer("/home/david/Desktop/Crash.mpg"); 38 39 this->material = new Material; 40 this->material->setDiffuseMap("maps/radialTransparency.png"); 41 42 this->toList(OM_COMMON); 43 44 this->loadParams(root); 45 32 46 counter = 0; 33 47 timer = 0; 34 //this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);48 fps = media_container->getFPS(); 35 49 } 36 50 … … 40 54 MovieEntity::~MovieEntity () 41 55 { 56 delete this->material; 57 delete this->media_container; 42 58 } 43 59 60 void MovieEntity::loadParams(const TiXmlElement* root) 61 { 62 static_cast<WorldEntity*>(this)->loadParams(root); 63 } 64 65 void MovieEntity::loadMovie(const char* filename) 66 { 67 68 } 44 69 45 70 /** … … 51 76 void MovieEntity::tick(float time) 52 77 { 78 timer += time; 53 79 80 if(counter != fps * timer) 81 { 82 counter = fps * timer; 83 84 if (counter >= media_container->getFrameCount()) 85 { 86 timer = 0; 87 counter = 0; 88 } 89 } 54 90 } 55 91 … … 63 99 { 64 100 65 } 101 glPushMatrix(); 102 glTranslatef (this->getAbsCoor ().x, 103 this->getAbsCoor ().y, 104 this->getAbsCoor ().z); 66 105 67 void MovieEntity::loadParams(const TiXmlElement* root) 68 { 106 this->material->select(); 107 glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter)); 108 109 glBegin(GL_QUADS); 110 // Front Face 111 glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad 112 glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad 113 glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 1.0f); // Top Right Of The Texture and Quad 114 glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Texture and Quad 115 glEnd(); 116 117 glPopMatrix(); 69 118 70 119 } 71 72 void MovieEntity::loadMovie(const char* filename)73 {74 75 }76 -
branches/avi_play/src/world_entities/movie_entity.h
r6489 r6507 8 8 9 9 #include "world_entity.h" 10 #include "comincl.h"11 #include "resource_manager.h"12 10 13 11 14 12 class MediaContainer; 15 class Model;16 13 class Material; 17 class FastFactory;18 14 19 20 //! Basic class from which all interactive stuff in the world is derived from21 15 class MovieEntity : public WorldEntity 22 16 { 23 17 private: 24 MediaContainer* media_container; 25 Model* model; 26 Material* material; 27 28 static FastFactory* fastFactory; 18 MediaContainer* media_container; 19 Material* material; 29 20 30 21 int counter; … … 41 32 void loadMovie(const char* filename); 42 33 43 44 45 34 }; 46 35
Note: See TracChangeset
for help on using the changeset viewer.