Changeset 6004 in orxonox.OLD for trunk/src/world_entities/npcs
- Timestamp:
- Dec 9, 2005, 11:12:04 PM (19 years ago)
- Location:
- trunk/src/world_entities/npcs
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/npc.cc
r5750 r6004 70 70 } 71 71 } 72 73 74 void NPC::tick(float dt)75 {76 77 }78 79 80 -
trunk/src/world_entities/npcs/npc.h
r5750 r6004 17 17 void addAI(AI* ai); 18 18 19 virtual void tick(float dt);20 21 19 virtual void collidesWith (WorldEntity* entity, const Vector& location); 22 20 -
trunk/src/world_entities/npcs/npc_test.cc
r5750 r6004 33 33 NPC2::NPC2() 34 34 { 35 this->setClassID(CL_NPC , "NPC");35 this->setClassID(CL_NPC_TEST2, "NPC2"); 36 36 37 37 if ((float)rand()/RAND_MAX > .5f) … … 83 83 void NPC2::draw() const 84 84 { 85 glMatrixMode(GL_MODELVIEW);86 glPushMatrix();87 float matrix[4][4];88 89 /* translate */90 glTranslatef (this->getAbsCoor ().x,91 this->getAbsCoor ().y,92 this->getAbsCoor ().z);93 /* rotate */94 this->getAbsDir ().matrix (matrix);95 glMultMatrixf((float*)matrix);96 97 if (this->shader != NULL && this->shader != Shader::getActiveShader())98 shader->activateShader();99 gluSphere(this->obj, 3, 10, 10);100 shader->deactivateShader();101 102 103 / * if (this->model)104 this->model->draw();*/105 glPopMatrix();85 // glMatrixMode(GL_MODELVIEW); 86 // glPushMatrix(); 87 // float matrix[4][4]; 88 // 89 // /* translate */ 90 // glTranslatef (this->getAbsCoor ().x, 91 // this->getAbsCoor ().y, 92 // this->getAbsCoor ().z); 93 // /* rotate */ 94 // this->getAbsDir ().matrix (matrix); 95 // glMultMatrixf((float*)matrix); 96 // 97 // if (this->shader != NULL && this->shader != Shader::getActiveShader()) 98 // shader->activateShader(); 99 // gluSphere(this->obj, 3, 10, 10); 100 // shader->deactivateShader(); 101 // 102 // 103 // /* if (this->model) 104 // this->model->draw();*/ 105 // glPopMatrix(); 106 106 } 107 107 -
trunk/src/world_entities/npcs/npc_test.h
r5750 r6004 3 3 #define _NPC2_H 4 4 5 #include "world_entity.h" 6 #include "physics_interface.h" 7 8 #include "glincl.h" 5 #include "npc.h" 9 6 10 7 class AI; 11 8 class Shader; 12 9 13 class NPC2 : public WorldEntity, public PhysicsInterface{10 class NPC2 : public NPC { 14 11 15 12 public: -
trunk/src/world_entities/npcs/npc_test1.cc
r5750 r6004 32 32 NPCTest1::NPCTest1() 33 33 { 34 this->setClassID(CL_NPC , "NPCTest1");34 this->setClassID(CL_NPC_TEST1, "NPCTest1"); 35 35 36 36 if ((float)rand()/RAND_MAX > .5f) … … 39 39 this->loadModel("models/ships/gobblin.obj", 2); 40 40 41 this->randomRotAxis = VECTOR_RAND(1) ;41 this->randomRotAxis = VECTOR_RAND(1).getNormalized(); 42 42 } 43 43 … … 80 80 void NPCTest1::tick(float dt) 81 81 { 82 // Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());83 84 //if (directin.len() < 100)85 // this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));86 82 this->shiftDir(Quaternion(dt, this->randomRotAxis)); 87 88 83 } 89 84 -
trunk/src/world_entities/npcs/npc_test1.h
r5750 r6004 3 3 #define _NPC_Test1_H 4 4 5 #include "world_entity.h" 6 #include "physics_interface.h" 5 #include "npc.h" 7 6 8 7 class AI; 9 8 10 class NPCTest1 : public WorldEntity, public PhysicsInterface{9 class NPCTest1 : public NPC { 11 10 12 11 public:
Note: See TracChangeset
for help on using the changeset viewer.