Changeset 3586 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 17, 2005, 2:15:33 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/command_node.cc
r3236 r3586 214 214 while( SDL_PollEvent (&event)) 215 215 { 216 printf("CommandNode::processLocal() =========================got Event\n"); 216 217 memset (cmd.cmd, 0, CMD_LENGHT); 217 218 switch( event.type) … … 267 268 void CommandNode::relay (Command* cmd) 268 269 { 269 270 270 Orxonox *orx = Orxonox::getInstance(); 271 271 if( orx->systemCommand (cmd)) return; … … 281 281 while( entity != NULL) 282 282 { 283 entity->command (cmd); 283 entity->command (cmd); /*no absorbtion of command! strange*/ 284 284 entity = bound->nextElement(); 285 285 } -
orxonox/trunk/src/lib/util/list.h
r3585 r3586 120 120 void tList<T>::add(T* entity) 121 121 { 122 if( entity == NULL) return; 122 123 listElement* el = new listElement; 123 124 el->prev = this->last; … … 136 137 void tList<T>::remove(T* entity) 137 138 { 139 if( entity == NULL) return; 138 140 this->currentEl = this->first; 139 141 listElement* te; … … 200 202 T* tList<T>::enumerate() 201 203 { 202 if(this->last == this->first) return NULL; 204 //if( this->last == this->first == NULL) return NULL; 205 if(this->size == 0) return NULL; 203 206 this->currentEl = this->first; 204 207 return this->currentEl->curr; … … 209 212 T* tList<T>::nextElement() 210 213 { 211 if(this->last == this->first) return NULL; 214 // if( this->last == this->first == NULL) return NULL; 215 if(this->size == 0) return NULL; 212 216 this->currentEl = this->currentEl->next; 213 217 if(this->currentEl == NULL) return NULL; … … 222 226 T* tList<T>::nextElement(T* toEntity) 223 227 { 224 if( this->last == this->first) return NULL; 228 //if( this->last == this->first == NULL) return NULL; 229 if(this->size == 0) return NULL; 225 230 if( toEntity == NULL) return this->first->curr; 226 231 if( toEntity == this->last->curr ) return this->first->curr; -
orxonox/trunk/src/orxonox.conf
r3584 r3586 5 5 RIGHT=right 6 6 SPACE=fire 7 m= weapon_mode7 m=mode 8 8 ESCAPE=quit 9 9 p=pause … … 11 11 BUTTON_LEFT=fire 12 12 BUTTON_RIGHT=altfire 13 b=benscho14 13 x=up_world 15 14 z=down_world -
orxonox/trunk/src/story_entities/world.cc
r3573 r3586 181 181 182 182 //create helper for player 183 HelperParent* hp = new HelperParent ();183 //HelperParent* hp = new HelperParent (); 184 184 /* the player has to be added to this helper */ 185 185 186 186 // create a player 187 WorldEntity* myPlayer = new Player (); 188 myPlayer->setName ("player"); 189 this->spawn (myPlayer); 190 this->localPlayer = myPlayer; 187 this->localPlayer = new Player (); 188 this->localPlayer->setName ("player"); 189 this->spawn (this->localPlayer); 191 190 /*monitor progress*/ 192 191 this->glmis->step(); … … 194 193 // bind input 195 194 Orxonox *orx = Orxonox::getInstance (); 196 orx->getLocalInput()->bind ( myPlayer);195 orx->getLocalInput()->bind (this->localPlayer); 197 196 198 197 // bind camera 199 198 this->localCamera = new Camera(this); 200 199 this->localCamera->setName ("camera"); 201 this->localCamera->bind ( myPlayer);200 this->localCamera->bind (this->localPlayer); 202 201 /*monitor progress*/ 203 202 this->glmis->step(); … … 217 216 this->spawn(env); 218 217 219 /* 220 Vector* es = new Vector (50, 2, 0); 221 Quaternion* qs = new Quaternion (); 222 WorldEntity* pr = new Primitive(PSPHERE); 223 pr->setName("primitive"); 224 this->spawn(pr, this->localPlayer, es, qs, ROTATION); 225 */ 226 218 219 //Vector* es = new Vector (10, 5, 0); 220 //Quaternion* qs = new Quaternion (); 221 //WorldEntity* pr = new Primitive(PSPHERE); 222 //pr->setName("primitive"); 223 //this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE); 224 227 225 228 226 /*monitor progress*/ … … 231 229 // trackManager->setBindSlave(env); 232 230 PNode* tn = trackManager->getTrackNode(); 233 tn->addChild( myPlayer);231 tn->addChild(this->localPlayer); 234 232 235 233 //localCamera->setParent(TrackNode::getInstance()); 236 234 tn->addChild (this->localCamera); 237 myPlayer->setMode(PNODE_ROTATE_AND_MOVE);235 this->localPlayer->setMode(PNODE_ROTATE_AND_MOVE); 238 236 //Vector* cameraOffset = new Vector (0, 5, -10); 239 237 Vector* cameraOffset = new Vector (-10, 5, 0); 240 238 this->localCamera->setRelCoor (cameraOffset); 241 trackManager->condition(2, NEAREST, myPlayer);239 trackManager->condition(2, NEAREST, this->localPlayer); 242 240 243 241 break; … … 267 265 skySphere = new Skysphere("../data/pictures/sky-replace.jpg"); 268 266 this->localPlayer->addChild(this->skySphere); 267 268 Vector* es = new Vector (20, 0, 0); 269 Quaternion* qs = new Quaternion (); 270 WorldEntity* pr = new Primitive(PSPHERE); 271 pr->setName("primitive"); 272 this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE); 269 273 270 274 break; … … 721 725 entity->setRelCoor (relCoor); 722 726 entity->setRelDir (relDir); 727 entity->setMode(parentingMode); 723 728 724 729 this->entities->add (entity); -
orxonox/trunk/src/world_entities/player.cc
r3585 r3586 167 167 //orthDirection = orthDirection.cross (direction); 168 168 169 if( bUp) { accel = accel+(direction*acceleration); }170 if( bDown) { accel = accel-(direction*acceleration); }171 if( bLeft ) { accel = accel - (orthDirection*acceleration); }172 if( bRight ) { accel = accel + (orthDirection*acceleration); }173 if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}174 if( bDescend) {/* FIXME */} /* \todo up and down player movement */169 if( this->bUp) { accel = accel+(direction*acceleration); } 170 if( this->bDown) { accel = accel-(direction*acceleration); } 171 if( this->bLeft ) { accel = accel - (orthDirection*acceleration); } 172 if( this->bRight ) { accel = accel + (orthDirection*acceleration); } 173 if( this->bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */} 174 if( this->bDescend) {/* FIXME */} /* \todo up and down player movement */ 175 175 176 176 Vector move = accel * time; … … 211 211 else if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp; 212 212 else if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp; 213 else if( !strcmp( cmd->cmd, " weapon_mode")) this->bWeaponChange = !cmd->bUp;214 } 213 else if( !strcmp( cmd->cmd, "mode")) this->bWeaponChange = !cmd->bUp; 214 } -
orxonox/trunk/src/world_entities/primitive.cc
r3578 r3586 26 26 27 27 28 29 /** 30 \brief standard constructor 31 */ 28 32 Primitive::Primitive (PRIMITIVE_FORM form) : WorldEntity() 29 33 { 30 this->model = new OBJModel("../data/models/fighter.obj");34 //this->model = new OBJModel("../data/models/fighter.obj"); 31 35 //this->model = new OBJModel(""); 36 this->object = gluNewQuadric(); 37 38 gluQuadricTexture(this->object, GL_TRUE); 39 40 this->material = new Material("Sky"); 41 this->material->setDiffuseMap("../data/pictures/sky-replace.jpg"); 42 this->material->setIllum(3); 43 this->material->setAmbient(1.0, 1.0, 1.0); 32 44 } 33 45 34 46 35 47 /** 48 \brief standard deconstructor 49 */ 36 50 Primitive::~Primitive () 37 51 { 38 52 delete this->material; 53 free(this->object); 39 54 } 40 55 56 /** 57 \brief called, when the object gets hit 58 \param other object, that hits it 59 \param location of impact 60 */ 61 void Primitive::hit (WorldEntity* weapon, Vector* loc) {} 62 63 64 /** 65 \brief object collides 66 */ 67 void Primitive::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} 68 69 70 /** 71 \brief tick singal put everything here, that is timedependent 72 \param time in sec 73 */ 41 74 void Primitive::tick (float time) 42 75 { 43 Vector v(0.0, 0.0, 1.0);44 Quaternion q(10.0, v);76 //Vector v(0.0, 0.0, 1.0); 77 //Quaternion q(10.0, v); 45 78 //this->relDirection = this->relDirection * q; 46 79 } 47 80 48 void Primitive::hit (WorldEntity* weapon, Vector* loc) {} 49 50 51 void Primitive::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} 52 81 /** 82 \brief drawing function of the object 83 */ 53 84 void Primitive::draw () 54 85 { 55 86 glMatrixMode(GL_MODELVIEW); 56 87 glPushMatrix(); 88 57 89 float matrix[4][4]; 58 59 90 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 60 91 //rotate 61 this->getAbsDir().matrix (matrix);62 glMultMatrixf((float*)matrix);63 64 this->model->draw(); 92 //this->getAbsDir().matrix (matrix); 93 //glMultMatrixf((float*)matrix); 94 gluSphere(this->object, 2, 20, 20); 95 65 96 glPopMatrix(); 66 97 } -
orxonox/trunk/src/world_entities/primitive.h
r3578 r3586 19 19 virtual void draw (); 20 20 21 private: 22 GLUquadricObj *object; //!< the object to be rendered 23 Material *material; //!< A Material for the SkySphere. 24 21 25 }; 22 26 -
orxonox/trunk/src/world_entities/skysphere.cc
r3566 r3586 38 38 Skysphere::Skysphere() 39 39 { 40 initialize("../data/pictures/sky-replace.jpg");40 this->initialize("../data/pictures/sky-replace.jpg"); 41 41 } 42 42 … … 48 48 Skysphere::Skysphere(char* fileName) 49 49 { 50 initialize(fileName);50 this->initialize(fileName); 51 51 } 52 52 … … 108 108 109 109 skyMaterial->select(); 110 gluSphere( sphereObj,sphereRadius, 20, 20);110 gluSphere(this->sphereObj, this->sphereRadius, 20, 20); 111 111 glPopMatrix(); 112 112 }
Note: See TracChangeset
for help on using the changeset viewer.