Changeset 10669 in orxonox.OLD
- Timestamp:
- Jun 3, 2007, 10:17:15 PM (17 years ago)
- Location:
- branches/vs-enhencements/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/lib/collision_detection/aabb_tree_node.cc
r10013 r10669 740 740 741 741 /* DRAW POLYGONS */ 742 if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL || drawMode & DRAW_BV_BLENDED)742 if( (drawMode & DRAW_BV_POLYGON) || (drawMode & DRAW_ALL) || (drawMode & DRAW_BV_BLENDED)) 743 743 { 744 744 if (top) -
branches/vs-enhencements/src/util/track/track.cc
r10642 r10669 100 100 } 101 101 LOAD_PARAM_END_CYCLE(element); 102 102 103 103 LoadParam(root, "ActionBox", this, Track, addActionBox ); 104 104 } -
branches/vs-enhencements/src/world_entities/effects/blink.cc
r10618 r10669 67 67 this->bBoard->setTexture("textures/light/blink.png"); 68 68 69 // /Standard values69 //!< Standard values 70 70 this->bBoard->setAbsCoor(0, 0, 0); 71 71 // default position if not set in xml -
branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc
r10667 r10669 158 158 this->secWeaponMan.setParentEntity( this); 159 159 160 this-> setWMSlotCount(1,8);161 this->se tWMSlotCount(2,6);162 163 this-> createWeaponSlot(1, 0, Vector(3.006, 1.028, .155), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);164 this-> createWeaponSlot(1, 1, Vector(3.006, 1.028, -.155), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);165 this-> createWeaponSlot(1, 2, Vector(4.03, .063, .876), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);166 this-> createWeaponSlot(1, 3, Vector(4.03, -.063, -.876), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);167 this-> createWeaponSlot(1, 4, Vector(1.431, -.612, 2.691), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);168 this-> createWeaponSlot(1, 5, Vector(1.431, -.612, -2.691), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);169 this-> createWeaponSlot(1, 6, Vector(1.431, -.612, 3.254), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);170 this-> createWeaponSlot(1, 7, Vector(1.431, -.612, -3.254), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);171 172 173 this-> addWeaponToSlot(1,0, 0, "RFCannon");174 this-> addWeaponToSlot(1,0, 1, "RFCannon");175 this-> addWeaponToSlot(1,0, 2, "RFCannon");176 this-> addWeaponToSlot(1,0, 3, "RFCannon");177 this-> addWeaponToSlot(1,1, 0, "RFCannon");178 this-> addWeaponToSlot(1,1, 1, "RFCannon");179 this-> addWeaponToSlot(1,1, 2, "RFCannon");180 this-> addWeaponToSlot(1,1, 3, "RFCannon");181 182 this-> addWeaponToSlot(1,0, 4, "NadionLaser");183 this-> addWeaponToSlot(1,0, 5, "NadionLaser");184 this-> addWeaponToSlot(1,2, 4, "NadionLaser");185 this-> addWeaponToSlot(1,2, 5, "NadionLaser");186 187 this-> addWeaponToSlot(1,0, 6, "Disruptor");188 this-> addWeaponToSlot(1,0, 7, "Disruptor");189 this-> addWeaponToSlot(1,3, 6, "Disruptor");190 this-> addWeaponToSlot(1,3, 7, "Disruptor");191 192 193 this-> createWeaponSlot(2, 0, Vector(1.5, 3, 0), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);194 this-> createWeaponSlot(2, 1, Vector(2.6, 0, 3.0), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);195 this-> createWeaponSlot(2, 2, Vector(1.5, 0, -.5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);196 this-> createWeaponSlot(2, 3, Vector(1.5, 0, .5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);197 this-> createWeaponSlot(2, 4, Vector(1.5, 0, .5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);198 this-> createWeaponSlot(2, 5, Vector(1.5, 0, -.5), WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);199 200 this-> addWeaponToSlot(2,0, 2, "SwarmLauncher");160 this->weaponMan.setSlotCount(8); 161 this->secWeaponMan.setSlotCount(6); 162 163 this->weaponMan.createWeaponSlot(0, 3.006, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 164 this->weaponMan.createWeaponSlot(1, 3.006, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 165 this->weaponMan.createWeaponSlot(2, 4.03, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 166 this->weaponMan.createWeaponSlot(3, 4.03, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 167 this->weaponMan.createWeaponSlot(4, 1.431, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 168 this->weaponMan.createWeaponSlot(5, 1.431, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 169 this->weaponMan.createWeaponSlot(6, 1.431, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 170 this->weaponMan.createWeaponSlot(7, 1.431, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 171 172 173 this->weaponMan.addWeaponToSlot(0, 0, "RFCannon"); 174 this->weaponMan.addWeaponToSlot(0, 1, "RFCannon"); 175 this->weaponMan.addWeaponToSlot(0, 2, "RFCannon"); 176 this->weaponMan.addWeaponToSlot(0, 3, "RFCannon"); 177 this->weaponMan.addWeaponToSlot(1, 0, "RFCannon"); 178 this->weaponMan.addWeaponToSlot(1, 1, "RFCannon"); 179 this->weaponMan.addWeaponToSlot(1, 2, "RFCannon"); 180 this->weaponMan.addWeaponToSlot(1, 3, "RFCannon"); 181 182 this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser"); 183 this->weaponMan.addWeaponToSlot(0, 5, "NadionLaser"); 184 this->weaponMan.addWeaponToSlot(2, 4, "NadionLaser"); 185 this->weaponMan.addWeaponToSlot(2, 5, "NadionLaser"); 186 187 this->weaponMan.addWeaponToSlot(0, 6, "Disruptor"); 188 this->weaponMan.addWeaponToSlot(0, 7, "Disruptor"); 189 this->weaponMan.addWeaponToSlot(3, 6, "Disruptor"); 190 this->weaponMan.addWeaponToSlot(3, 7, "Disruptor"); 191 192 193 this->secWeaponMan.createWeaponSlot(0, 1.5, 3, 0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 194 this->secWeaponMan.createWeaponSlot(1, 2.6, 0, 3.0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 195 this->secWeaponMan.createWeaponSlot(2, 1.5, 0, -.5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 196 this->secWeaponMan.createWeaponSlot(3, 1.5, 0, .5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 197 this->secWeaponMan.createWeaponSlot(4, 1.5, 0, .5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 198 this->secWeaponMan.createWeaponSlot(5, 1.5, 0, -.5, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 199 200 this->secWeaponMan.addWeaponToSlot(0, 2, "SwarmLauncher"); 201 201 202 202 … … 231 231 this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 232 232 233 // widget handling 234 /* 235 this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical(); 236 this->electronicWidget->setDisplayedName(std::string(this->getClassName()) + " Electronics:"); 237 this->electronicWidget->setSize2D(30,400); 238 this->electronicWidget->setAbsCoor2D(150,200); 239 this->electronicWidget->shiftDir2D(270); 240 this->updateElectronicWidget(); 241 this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical(); 242 this->shieldWidget->setDisplayedName(std::string(this->getClassName()) + " Shield:"); 243 this->shieldWidget->setSize2D(30,400); 244 this->shieldWidget->setAbsCoor2D(200,200); 245 this->shieldWidget->shiftDir2D(270); 246 this->updateShieldWidget(); 247 if (this->hasPlayer()) 248 { 249 State::getPlayer()->hud().setShiledWidget(this->shieldWidget); 250 State::getPlayer()->hud().setEnergyWidget(this->electronicWidget); 251 } 252 */ 233 253 234 this->electronicWidget = NULL; 254 235 this->shieldWidget = NULL; … … 308 289 this->setSupportedPlaymodes(Playable::Horizontal | Playable::Vertical); 309 290 310 /// FIXME311 // this->trail = new Trail( 5, 10, .2, this);312 // this->trail->setTexture( "textures/engine.png");313 //314 // this->trailL = new Trail( 5, 10, .2, this);315 // this->trailL->setTexture( "textures/engine.png");316 //317 // this->trailR = new ( 5, 10, .2, this);318 // this->trailR->setTexture( "textures/engine.png");319 320 291 321 292 this->toList(OM_GROUP_00); 322 323 //FIXME Just testaddition to show the wobblegrid324 /*325 this->test = new Wobblegrid(5);326 test->setTexture("textures/blub.png");327 328 test->setAbsCoor( this->getAbsCoor() + Vector(0, 2, 0));329 test->setParent( this);330 */331 332 293 } 333 294 … … 350 311 State::getCamera()->setParent(this); 351 312 352 LoadParam(root, "reactor", this, SpaceShip, setReactor); 353 LoadParam(root, "shield", this, SpaceShip, setShield); 354 LoadParam(root, "armor", this, SpaceShip, setArmor); 355 LoadParam(root, "electronic", this, SpaceShip, setElectronic); 356 LoadParam(root, "engine", this, SpaceShip, setEngine); 357 LoadParam(root, "energyshare", this, SpaceShip, setEnergyShare); 358 LoadParam(root, "weapon", this, SpaceShip, setWeapon); 359 313 LoadParam(root, "setReactor", this, SpaceShip, setReactor) 314 .describe("set reactor output"); 315 LoadParam(root, "setShield", this, SpaceShip, setShield) 316 .describe("set shield parameters: current strenght , max strenght, threshhold value (0..1), regeneration rate"); 317 LoadParam(root, "setArmor", this, SpaceShip, setArmor) 318 .describe("set armor/health parameters: current strenght , max strenght"); 319 LoadParam(root, "setElectronic", this, SpaceShip, setElectronic) 320 .describe("set electronics parameters: current strenght , max strenght, threshhold value (0..1), regeneration rate"); 321 LoadParam(root, "setEngine", this, SpaceShip, setEngine) 322 .describe("set base speed"); 323 LoadParam(root, "setEnergyShare", this, SpaceShip, setEnergyShare) 324 .describe("set energy partitioning: shield, weapons, engine (sum should be 1)"); 325 LoadParam(root, "setWeapon", this, SpaceShip, setWeapon) 326 .describe("set weapon regeneration"); 327 328 /* 329 LOAD_PARAM_START_CYCLE(root, element); 330 { 331 LoadParamXML_CYCLE(element, "weaponMan", this->weaponMan, WeaponManager, loadWeapons) 332 .describe("loads Weapons"); 333 } 334 LOAD_PARAM_END_CYCLE(element); 335 336 LOAD_PARAM_START_CYCLE(root, element); 337 { 338 LoadParamXML_CYCLE(element, "secWeaponMan", this->secWeaponMan, WeaponManager, loadWeapons) 339 .describe("loads Weapons"); 340 } 341 LOAD_PARAM_END_CYCLE(element);*/ 360 342 } 361 343 … … 370 352 bForward = bBackward = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = bFire = bSecFire = false; 371 353 372 //xMouse = yMouse = 0; 373 374 this->setHealth(80); 354 355 // this->armorCur = this->armorMax; 356 this->setHealth(this->getHealthMax()); 357 this->shieldCur = this->shieldMax; 358 this->shieldActive = true; 359 this->electronicCur = this->electronicMax; 360 // this->updateHealth(); 375 361 this->velocity = Vector(0.0, 0.0, 0.0); 376 362 } … … 383 369 State::getPlayer()->hud().setRadarCenterNode(this->travelNode); 384 370 State::getPlayer()->hud().setOverlayActive(true); 385 //dynamic_cast <OrxGui::GLGuiEnergyWidgetVertical*> (State::getPlayer()->hud().getArmorWidget())->setDisplayedName("Armor");386 //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true);387 //this->attachCamera();388 // this->setPlaymode(Playable::Horizontal);389 371 } 390 372 … … 396 378 State::getCamera()->setEventHandling(true); 397 379 State::getPlayer()->hud().setRadarCenterNode(NULL); 398 //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( false);399 //this->detachCamera();400 380 } 401 381 … … 408 388 if(this->hasPlayer()) 409 389 Playable::postSpawn(); 410 411 //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));412 390 } 413 391 … … 695 673 pDamage += this->shieldCur; 696 674 if( !this->shieldActive) { 697 this-> armorCur -= pDamage / 2; // remaining damages hits armor at half rate675 this->decreaseHealth( pDamage / 2); // remaining damages hits armor at half rate 698 676 this->electronicCur -= eDamage; 699 677 } … … 701 679 } 702 680 else { 703 this-> armorCur = this->armorCur - pDamage;681 this->decreaseHealth(pDamage); 704 682 this->electronicCur = this->electronicCur - eDamage; 705 683 } 706 if( this-> armorCur<= 0) { /* FIXME implement shipcrash*/ }684 if( this->getHealth() <= 0) { /* FIXME implement shipcrash*/ } 707 685 this->destroy(this); 708 686 … … 710 688 updateShieldWidget(); 711 689 712 this->setHealth( this->armorCur);690 // this->setHealth( this->armorCur); 713 691 } 714 692 715 693 716 694 void SpaceShip::regen(float time){ 717 float tmp;718 if ( this->armorCur != this->armorMax || this->armorRegen != 0){719 tmp = this->armorCur + this->armorRegen * time;720 if ( tmp > electronicMax)721 this->armorCur = this->armorMax;695 static float tmp, armorCur, armorMax; 696 if (armorCur != armorMax || this->armorRegen != 0){ 697 tmp = armorCur + armorRegen * time; 698 if ( tmp > armorMax) 699 armorCur = armorMax; 722 700 else 723 this->armorCur = tmp;701 armorCur = tmp; 724 702 } 725 703 if (this->shieldCur != this->shieldMax || this->shieldRegen != 0){ … … 1205 1183 }; 1206 1184 1207 void SpaceShip::addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName){1208 if (wm == 1) { this->weaponMan.addWeapon( Weapon::createWeapon( weaponName ), config, slot); }1209 if (wm == 1) { this->weaponMan.addWeapon( Weapon::createWeapon( weaponName ), config, slot); }1210 else return;1211 }1212 1185 // void SpaceShip::addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName){ 1186 // if (wm == 1) { this->weaponMan.addWeapon( Weapon::createWeapon( weaponName ), config, slot); } 1187 // if (wm == 1) { this->weaponMan.addWeapon( Weapon::createWeapon( weaponName ), config, slot); } 1188 // else return; 1189 // } 1190 -
branches/vs-enhencements/src/world_entities/space_ships/space_ship.h
r10661 r10669 67 67 inline void setShield(float cur, float max, float th, float regen) 68 68 { this->shieldCur = cur; this->shieldMax = max; this->shieldTH = th; this->shieldRegen = regen;}; 69 inline void setArmor(float cur, float max) { this-> armorCur = cur; this->armorMax = max; updateHealth(); };69 inline void setArmor(float cur, float max) { this->setHealth(cur); this->setHealthMax(max); }; 70 70 inline void setElectronic(float cur, float max, float th, float regen) 71 71 { this->electronicCur = cur; this->electronicMax = max; this->electronicTH = th; this->electronicRegen = regen; }; … … 80 80 81 81 //!< Resynchonizes armor with health in WE!! 82 inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); }; 83 84 inline void setWMSlotCount(int wm, int slot) { 85 if (wm == 1) { this->weaponMan.setSlotCount(slot); } 86 if (wm == 2) { this->secWeaponMan.setSlotCount(slot); } 87 else return; }; 88 inline void createWeaponSlot(int wm, int slot, Vector location, long capability) { 89 if (wm == 1) { 90 this->weaponMan.setSlotPosition(slot, location); 91 this->weaponMan.setSlotCapability(slot, capability); } 92 if (wm == 2) { 93 this->secWeaponMan.setSlotPosition(slot, location); 94 this->secWeaponMan.setSlotCapability(slot, capability); } 95 else return; }; 82 // inline void updateHealth() { this->setHealth(this->armorCur); this->setHealthMax(this->armorMax); }; 96 83 97 84 void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName); … … 101 88 inline float getShieldMax() { return this->shieldMax; }; //!< returns maximum shield value 102 89 103 inline float getArmorCur() { return this-> armorCur; }; //!< returns current armor value104 inline float getArmorMax() { return this-> armorMax; }; //!< returns current armor value90 inline float getArmorCur() { return this->getHealth(); }; //!< returns current armor value 91 inline float getArmorMax() { return this->getHealthMax(); }; //!< returns current armor value 105 92 106 93 inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value … … 157 144 OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar 158 145 159 float armorCur; //!< current armor160 float armorMax; //!< maximum armor146 // float armorCur; //!< current armor 147 // float armorMax; //!< maximum armor 161 148 float armorRegen; //!< armor regeneration per tick (usable on bioships?) 162 149 //note that the armor widget is set on the health- widget in world- entity (see in player.cc) -
branches/vs-enhencements/src/world_entities/tools/mount_point.cc
r10618 r10669 22 22 23 23 #include "weapons/weapon_slot.h" 24 #include "weapons/weapon.h" 24 25 25 26 #include "particles/particle_system.h" … … 36 37 * construct 37 38 */ 38 MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name)39 MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name) 39 40 { 40 41 // PRINTF(0)("Created mount point %s\n", name.c_str()); … … 153 154 this->getRelDir()*Quaternion(M_PI, Vector(0,1,0))); 154 155 } 156 155 157 } 156 158 } -
branches/vs-enhencements/src/world_entities/weapons/weapon_manager.cc
r10544 r10669 1 2 1 /* 3 2 orxonox - the future of 3D-vertical-scrollers … … 146 145 BaseObject::loadParams(root); 147 146 148 LoadParam(root, "slot -count", this, WeaponManager, setSlotCount)147 LoadParam(root, "slotCount", this, WeaponManager, setSlotCount) 149 148 .describe("how many slots(cannons) the WeaponManager can handle"); 149 150 150 151 151 LOAD_PARAM_START_CYCLE(root, element); … … 156 156 } 157 157 LOAD_PARAM_END_CYCLE(element); 158 159 158 160 } 159 161 … … 357 359 * @param slotCapability the capability @see WeaponSlotCapability 358 360 */ 359 void WeaponManager::setSlotCapability(int slot, long slotCapability)361 void WeaponManager::setSlotCapability(int slot, unsigned long slotCapability) 360 362 { 361 363 if (slot > slotCount) -
branches/vs-enhencements/src/world_entities/weapons/weapon_manager.h
r10437 r10669 60 60 // setting up the WeaponManager with the following functions 61 61 void setSlotPosition(int slot, const Vector& position, PNode* parent = NULL); 62 // inline void setSlotPosition(float slot, float x, float y,float z) {setSlotPosition((int)slot, Vector(x,y,z));}; 62 63 void setSlotDirection(int slot, const Quaternion& rotation); 63 64 /** @param slot the slot to get the relative position from @returns the relative position of the Carrier to the Slot */ 64 65 const Vector& getSlotPosition(int slot) const; 65 void setSlotCapability(int slot, long slotCapability);66 void setSlotCapability(int slot, unsigned long slotCapability); 66 67 /** @param slot the slot to get the capabilities from @returns the capabilies */ 67 68 long getSlotCapability(int slot) const; … … 76 77 bool addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 77 78 void removeWeapon(Weapon* weapon, int configID = -1); 79 80 inline void createWeaponSlot(int slot, float x, float y, float z, long capability) { 81 this->setSlotPosition(slot, Vector( x, y, z)); 82 this->setSlotCapability(slot, capability); }; 83 84 inline void addWeaponToSlot(int config, int slot, const std::string& weaponName){ 85 this->addWeapon( Weapon::createWeapon( weaponName ), config, slot); }; 86 78 87 79 88 Weapon* getWeapon(int slotID) const; -
branches/vs-enhencements/src/world_entities/weapons/weapon_slot.cc
r10534 r10669 42 42 43 43 WeaponSlot::~WeaponSlot() 44 {} 44 { 45 } 45 46 46 47 … … 55 56 56 57 LoadParam(root, "slot", this, WeaponSlot, setWeaponConfig) 57 58 .describe("sets the weapon slot"); 58 59 } 59 60 … … 63 64 void WeaponSlot::setWeaponClass() 64 65 { 65 66 66 } 67 67 -
branches/vs-enhencements/src/world_entities/world_entity.h
r10540 r10669 199 199 200 200 201 202 203 201 protected: 202 std::vector<MountPoint*> mountPoints; //!< A list with mount points for this model 203 std::map<int, MountPoint*> mountPointMap; 204 204 205 205
Note: See TracChangeset
for help on using the changeset viewer.