Changeset 4969 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons
- Timestamp:
- Aug 4, 2005, 11:19:29 AM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities/weapons
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/test_bullet.cc
r4948 r4969 40 40 this->energyMin = 1; 41 41 this->energyMax = 10; 42 this->remove(); 42 43 } 43 44 -
orxonox/trunk/src/world_entities/weapons/turret.cc
r4967 r4969 42 42 this->setClassID(CL_TURRET, "Turret"); 43 43 44 this-> model = (Model*)ResourceManager::getInstance()->load("models/turret1.obj", OBJ, RP_CAMPAIGN);44 this->loadModel("models/turret1.obj"); 45 45 46 46 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); … … 95 95 Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor(); 96 96 direction.normalize(); 97 Quaternion quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 98 99 this->setAbsDir(quat); 97 if (likely (this->getParent() != NULL)) 98 { 99 Quaternion quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 100 this->setAbsDir(quat); 101 } 102 else 103 { 104 Quaternion quat = Quaternion(direction, this->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ; 105 this->setAbsDir(quat); 106 } 100 107 } 101 108 102 /**103 * fires the weapon104 105 this is called from the player.cc, when fire-button is been pushed106 */107 109 void Turret::fire() 108 110 { … … 126 128 127 129 128 /**129 * is called, when the weapon is destroyed130 131 this is in conjunction with the hit function, so when a weapon is able to get132 hit, it can also be destoryed.133 */134 130 void Turret::destroy () 135 131 {} 136 132 137 133 /** 138 * this will draw the weapon134 * draws the Turret 139 135 */ 140 136 void Turret::draw () -
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4959 r4969 161 161 this->currentSlotConfig[slot].position.setRelCoor(position); 162 162 } 163 164 void WeaponManager::setSlotDirection(int slot, const Quaternion& rotation) 165 { 166 if (slot < this->slotCount) 167 this->currentSlotConfig[slot].position.setRelDir(rotation); 168 } 169 163 170 164 171 /** -
orxonox/trunk/src/world_entities/weapons/weapon_manager.h
r4964 r4969 57 57 // setting up the WeaponManager with the following functions 58 58 void setSlotPosition(int slot, const Vector& position); 59 void setSlotDirection(int slot, const Quaternion& rotation); 59 60 /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */ 60 61 const Vector& getSlotPosition(int slot) const { return this->currentSlotConfig[slot].position.getRelCoor(); };
Note: See TracChangeset
for help on using the changeset viewer.