Changeset 3586 in orxonox.OLD for orxonox/trunk/src/world_entities/primitive.cc
- Timestamp:
- Mar 17, 2005, 2:15:33 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.