- Timestamp:
- Dec 9, 2005, 11:12:04 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/class_id.h
r6002 r6004 162 162 CL_GUIDED_MISSILE = 0x00000245, 163 163 164 CL_NPC_TEST1 = 0x00000301, 165 CL_NPC_TEST2 = 0x00000302, 166 167 164 168 // gamePlay (range from 0x00000500 0x000005ff) 165 169 CL_EVENT = 0x00000501, -
trunk/src/lib/coord/p_node.cc
r5915 r6004 679 679 } 680 680 681 if( this->children.size() > 0)681 if(!this->children.empty()) 682 682 { 683 683 list<PNode*>::iterator child; -
trunk/src/lib/sound/sound_engine.cc
r5996 r6004 290 290 // INITIALIZING THE DEVICE: 291 291 292 #if def AL_VERSION_1_1292 #ifndef AL_VERSION_1_1 293 293 ALubyte deviceName[] = 294 294 #else -
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: -
trunk/src/world_entities/world_entity.cc
r6002 r6004 118 118 119 119 if (this->models[modelNumber] != NULL) 120 { 120 { 121 121 Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(this->models[modelNumber]); 122 122 if (resource != NULL) … … 127 127 this->models[modelNumber] = model; 128 128 129 // if (this->model != NULL) 129 // if (this->model != NULL) 130 130 // this->buildObbTree(4); 131 131 } … … 233 233 glMatrixMode(GL_MODELVIEW); 234 234 glPushMatrix(); 235 float matrix[4][4];236 235 237 236 /* translate */ … … 239 238 this->getAbsCoor ().y, 240 239 this->getAbsCoor ().z); 241 /* rotate */ // FIXME: devise a new Way to rotate this 242 this->getAbsDir ().matrix (matrix); 243 glMultMatrixf((float*)matrix); 244 240 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 241 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 242 243 244 // This Draws the LOD's 245 245 float cameraDistance = (State::getCamera()->getAbsCoor() - this->getAbsCoor()).len(); 246 if (this->isA(CL_HELICOPTER)) 247 printf("Test %f %d\n", cameraDistance, this->models.size()); 248 if (cameraDistance > 100 && this->models.size() >= 3 && this->models[2] != NULL) 246 if (cameraDistance > 30 && this->models.size() >= 3 && this->models[2] != NULL) 249 247 { 250 if (this->isA(CL_HELICOPTER))printf("====== 2 ===\n");251 248 this->models[2]->draw(); 252 } 253 else if (cameraDistance > 50 && this->models.size() >= 2 && this->models[1] != NULL)249 } 250 else if (cameraDistance > 10 && this->models.size() >= 2 && this->models[1] != NULL) 254 251 { 255 if (this->isA(CL_HELICOPTER))printf("====== 1 ===\n");256 252 this->models[1]->draw(); 257 } 258 else if (this->models.size() >= 1 && this->models[0] != NULL) 253 } 254 else if (this->models.size() >= 1 && this->models[0] != NULL) 259 255 { 260 if (this->isA(CL_HELICOPTER))printf("====== 0 ===\n");261 256 this->models[0]->draw(); 262 257 }
Note: See TracChangeset
for help on using the changeset viewer.