Changeset 9172 in orxonox.OLD for branches/presentation/src/world_entities
- Timestamp:
- Jul 4, 2006, 9:45:39 PM (19 years ago)
- Location:
- branches/presentation/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/creatures/fps_player.cc
r9168 r9172 243 243 this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * f, 0.0)); 244 244 245 this->aimingSystem->toList(/*OM_LIST(this->getOMListNumber() + 1)*/ OM_ GROUP_00);245 this->aimingSystem->toList(/*OM_LIST(this->getOMListNumber() + 1)*/ OM_COMMON); 246 246 } 247 247 } … … 399 399 400 400 this->setOnGround(false); 401 401 this->aimingSystem->flushList(); 402 402 } 403 403 -
branches/presentation/src/world_entities/weapons/aiming_system.cc
r9168 r9172 1 /*1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 36 36 AimingSystem::AimingSystem (WorldEntity* entity) 37 37 { 38 this->owner = entity; 39 38 40 this->init(); 39 41 } … … 55 57 this->setName("AimingSystem"); 56 58 57 this->loadModel("models/guns/targeting_system_body.obj"); 59 //this->loadModel("models/guns/targeting_system_body2.obj"); 60 // this->loadModel("models/ships/fighter.obj"); 58 61 59 62 // registering default reactions: 60 63 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY); 64 65 this->range = 1000.0f; 66 this->sideLength = 10.0f; 67 68 // new obb tree 69 this->obbTree = new OBBTree(); 70 this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(this->range, this->sideLength, this->sideLength)); 61 71 } 62 72 … … 69 79 WorldEntity* AimingSystem::getNearestTarget() 70 80 { 81 82 // PRINTF(0)("size: %i\n", this->selectionList.size()); 83 84 71 85 if( this->selectionList.size() == 0) 72 86 return NULL; 73 else if( this->selectionList.size() == 1) 74 return this->selectionList.back(); 87 75 88 76 89 WorldEntity* nearestEntity = NULL; … … 91 104 if( nearestEntity != this->owner) 92 105 return nearestEntity; 93 else return NULL; 106 else 107 return NULL; 94 108 } 95 109 … … 123 137 void AimingSystem::draw() const 124 138 { 125 WorldEntity::draw();139 // WorldEntity::draw(); 126 140 127 if( this->getOBBTree () != NULL) 128 this->getOBBTree()->drawBV(0, 1); 141 glMatrixMode(GL_MODELVIEW); 142 glPushMatrix(); 143 144 /* translate */ 145 glTranslatef (this->getAbsCoor ().x, 146 this->getAbsCoor ().y, 147 this->getAbsCoor ().z); 148 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 149 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 150 151 this->obbTree->drawBV(1, 1); 152 153 glPopMatrix(); 154 129 155 } -
branches/presentation/src/world_entities/weapons/aiming_system.h
r9168 r9172 16 16 class BVTree; 17 17 class Model; 18 class OBBTree; 18 19 19 20 … … 28 29 29 30 WorldEntity* getNearestTarget(); 31 void flushList() { this->selectionList.clear(); } 30 32 31 33 void setRange(float range){this->range = range;}; … … 39 41 private: 40 42 float range; //!< 43 float sideLength; 41 44 std::vector<WorldEntity*> selectionList; //!< the selections 42 45 43 46 WorldEntity* owner; //!< the owner of the targeting system 44 47 48 OBBTree* obbTree; 49 45 50 }; 46 51
Note: See TracChangeset
for help on using the changeset viewer.