- Timestamp:
- Jul 4, 2006, 6:50:37 PM (18 years ago)
- Location:
- branches/presentation/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/npcs/npc_test.cc
r9161 r9164 28 28 #include "loading/load_param.h" 29 29 30 #include "effects/explosion.h" 31 30 32 CREATE_FACTORY(NPC2, CL_NPC_TEST2); 31 33 … … 37 39 38 40 if ((float)rand()/RAND_MAX > .5f) 39 this->loadModel("models/ships/bolido.obj", 3);41 this->loadModel("models/ships/bolido.obj", 6); 40 42 else 41 this->loadModel("models/ships/gobblin.obj", 3); 43 this->loadModel("models/ships/gobblin.obj", 6); 44 45 46 42 47 43 48 this->shader = NULL; 44 49 if (likely(Shader::checkShaderAbility())) 45 50 this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag"); 46 47 this->obj = gluNewQuadric();48 51 49 52 this->randomRotAxis = VECTOR_RAND(1); … … 58 61 if (this->shader) 59 62 Shader::unload(this->shader); 60 gluDeleteQuadric(this->obj);61 63 } 62 64 … … 65 67 { 66 68 NPC::loadParams(root); 69 70 } 71 72 73 void NPC2::destroy(WorldEntity* killer) 74 { 75 Explosion::explode(this, Vector(10,10,10)); 76 this->toList(OM_DEAD); 67 77 68 78 } … … 92 102 if (this->shader != NULL && this->shader != Shader::getActiveShader()) 93 103 shader->activateShader(); 94 gluSphere(this->obj, 3, 10, 10); 104 105 this->getModel()->draw(); 95 106 shader->deactivateShader(); 96 107 -
branches/presentation/src/world_entities/npcs/npc_test.h
r9161 r9164 18 18 void addAI(AI* ai); 19 19 20 virtual void destroy(WorldEntity* killer); 21 20 22 virtual void tick(float dt); 21 23 virtual void draw() const; … … 24 26 Vector randomRotAxis; 25 27 Shader* shader; 26 GLUquadricObj* obj;27 28 28 }; 29 29
Note: See TracChangeset
for help on using the changeset viewer.