Changeset 5266 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Sep 27, 2005, 4:10:26 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npc.cc
r5259 r5266 30 30 this->setClassID(CL_NPC, "NPC"); 31 31 32 this->loadModelWithScale("models/ships/bolido.obj", 5);32 this->loadModelWithScale("models/ships/bolido.obj", 2); 33 33 34 34 this->randomRotAxis = VECTOR_RAND(1); -
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()); -
trunk/src/world_entities/npc2.h
r5265 r5266 1 1 2 #ifndef _NPC _H3 #define _NPC _H2 #ifndef _NPC22_H 3 #define _NPC2_H 4 4 5 5 #include "world_entity.h" … … 7 7 8 8 class AI; 9 class Shader; 9 10 10 class NPC : public WorldEntity, public PhysicsInterface {11 class NPC2 : public WorldEntity, public PhysicsInterface { 11 12 12 13 public: 13 NPC ();14 ~NPC ();14 NPC2 (); 15 ~NPC2 (); 15 16 16 17 … … 18 19 19 20 virtual void tick(float dt); 21 virtual void draw(); 20 22 21 23 virtual void collidesWith (WorldEntity* entity, const Vector& location); … … 24 26 private: 25 27 Vector randomRotAxis; 26 27 ;28 Shader* shader; 29 GLUquadricObj* obj; 28 30 29 31 }; 30 32 31 #endif /* _NPC _H */33 #endif /* _NPC2_H */
Note: See TracChangeset
for help on using the changeset viewer.