Changeset 5266 in orxonox.OLD for trunk/src/world_entities/npc2.cc
- Timestamp:
- Sep 27, 2005, 4:10:26 PM (19 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npc2.cc
r5265 r5266 17 17 18 18 19 #include "npc .h"19 #include "npc2.h" 20 20 #include "obb_tree.h" 21 21 22 #include "shader.h" 22 23 #include "state.h" 23 24 #include "list.h" … … 26 27 27 28 28 NPC ::NPC()29 NPC2::NPC2() 29 30 { 30 31 this->setClassID(CL_NPC, "NPC"); 31 32 32 this->loadModelWithScale("models/ships/bolido.obj", 5); 33 this->loadModelWithScale("models/ships/bolido.obj", 3); 34 this->shader = new Shader("toon.vert", "toon.frag"); 35 // this->shader->activateShader(); 36 //exit(-1); 37 38 this->obj = gluNewQuadric(); 33 39 34 40 this->randomRotAxis = VECTOR_RAND(1); … … 36 42 37 43 38 NPC ::~NPC() {}44 NPC2::~NPC2 () {} 39 45 40 46 41 void NPC ::collidesWith(WorldEntity* entity, const Vector& location)47 void NPC2::collidesWith(WorldEntity* entity, const Vector& location) 42 48 { 43 49 if (entity->isA(CL_PROJECTILE)) … … 56 62 57 63 58 void NPC::tick(float dt) 64 /** 65 * the entity is drawn onto the screen with this function 66 * 67 * This is a central function of an entity: call it to let the entity painted to the screen. 68 * Just override this function with whatever you want to be drawn. 69 */ 70 void NPC2::draw() 71 { 72 glMatrixMode(GL_MODELVIEW); 73 glPushMatrix(); 74 float matrix[4][4]; 75 76 /* translate */ 77 glTranslatef (this->getAbsCoor ().x, 78 this->getAbsCoor ().y, 79 this->getAbsCoor ().z); 80 /* rotate */ 81 this->getAbsDir ().matrix (matrix); 82 glMultMatrixf((float*)matrix); 83 84 shader->activateShader(); 85 gluSphere(this->obj, 3, 20, 20); 86 shader->deactivateShader(); 87 88 89 /* if (this->model) 90 this->model->draw();*/ 91 glPopMatrix(); 92 } 93 94 95 void NPC2::tick(float dt) 59 96 { 60 97 // Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
Note: See TracChangeset
for help on using the changeset viewer.