Changeset 3586 in orxonox.OLD for orxonox/trunk/src/world_entities
- Timestamp:
- Mar 17, 2005, 2:15:33 AM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.