Changeset 9975 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Nov 29, 2006, 5:15:10 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/WorldEntities.am
r9971 r9975 54 54 \ 55 55 world_entities/space_ships/space_ship.cc \ 56 world_entities/space_ships/playership.cc \57 56 world_entities/space_ships/helicopter.cc \ 58 57 world_entities/space_ships/hover.cc \ … … 162 161 \ 163 162 space_ships/space_ship.h \ 164 space_ships/playership.h \165 163 space_ships/helicopter.h \ 166 164 space_ships/hover.h \ -
branches/playability/src/world_entities/player.cc
r9971 r9975 23 23 24 24 #include "debug.h" 25 26 #include "world_entities/space_ships/playership.h"27 25 28 26 ObjectListDefinition(Player); … … 130 128 } 131 129 132 PlayerShip* Player::getPlayerShip()133 {134 return this->playership;135 }136 130 137 void Player::setPlayerShip(PlayerShip* playership)138 {139 this->playership = playership;140 }141 142 -
branches/playability/src/world_entities/player.h
r9971 r9975 10 10 11 11 #include "util/hud.h" 12 #include "world_entities/space_ships/playership.h"13 12 14 13 /* Forward Declaration */ … … 32 31 bool setPlayable(Playable* controllalble); 33 32 bool eject(); 34 void setPlayerShip(PlayerShip playership);35 PlayerShip* getPlayerShip();36 33 inline Playable* getPlayable() const { return this->playable; }; 37 34 … … 50 47 Playable* playable; //!< The one we controll or NULL if none 51 48 Hud _hud; //!< The HUD to be displayed for this Player. 52 PlayerShip playership;53 49 }; 54 50 -
branches/playability/src/world_entities/space_ships/space_ship.cc
r9970 r9975 691 691 692 692 } 693 694 void SpaceShip::enterPlaymode(Playable::Playmode playmode) 695 { 696 } 697 698 void SpaceShip::movement (float dt) 699 { 700 } -
branches/playability/src/world_entities/space_ships/space_ship.h
r9971 r9975 151 151 float rotation; 152 152 153 / *153 // FIXME until other fixme removal needed 154 154 Quaternion mouseDir; //!< the direction where the player wants to fly 155 155 Quaternion oldMouseDir; //!< the direction where the player wanted to fly … … 159 159 Quaternion pitchDir; 160 160 float dogdeSpeed; //!< the dogde Speed of the ship. 161 */161 // FIXME 162 162 163 163 Quaternion direction; //!< the direction of the ship. -
branches/playability/src/world_entities/weapons/heavy_blaster.cc
r9972 r9975 1 1 #include "heavy_blaster.h" 2 #include "world_entities/projectiles/projectile.h" 3 4 #include "world_entity.h" 5 #include "static_model.h" 6 #include "weapon_manager.h" 7 #include "util/loading/factory.h" 8 9 #include "animation3d.h" 10 11 #include "loading/fast_factory.h" 12 13 CREATE_FACTORY(HeavyBlaster); 14 /** 15 * Standard constructor 16 */ 17 HeavyBlaster::HeavyBlaster () 18 : Weapon() 19 { 20 this->init(); 21 } 2 22 3 23 HeavyBlaster::HeavyBlaster (const TiXmlElement* root = NULL) 4 24 : Weapon() 5 25 { 6 26 this->init(); 7 27 if (root != NULL) 8 28 this->loadParams(root); 9 29 } 10 30 11 31 /** … … 13 33 */ 14 34 HeavyBlaster::~HeavyBlaster() 15 35 { 16 36 // model will be deleted from WorldEntity-destructor 17 } 37 } 38 39 void HeavyBlaster::loadParams(const TiXmlElement* root) 40 { 41 Weapon::loadParams(root); 42 } 43 44 void HeavyBlaster::init() 45 { 46 //this->registerObject(this, HeavyBlaster::_objectList); 47 48 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); 49 50 this->loadModel("models/guns/plasmadriver_#.obj", 1.0); 51 52 53 this->setStateDuration(WS_SHOOTING, 0.05); 54 this->setStateDuration(WS_RELOADING, 0); 55 this->setStateDuration(WS_ACTIVATING, .5); 56 this->setStateDuration(WS_DEACTIVATING, 1); 57 58 this->setEnergyMax(5000); 59 this->increaseEnergy(5000); 60 //this->minCharge = 2; 61 62 this->setActionSound(WA_SHOOT, "sound/laser.wav"); 63 this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav"); 64 this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav"); 65 66 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 67 this->setProjectileTypeC("RailProjectile"); // FIXME temp project type until the blaste class exist 68 this->prepareProjectiles(100); 69 70 Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this); 71 Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this); 72 73 animation2->setInfinity(ANIM_INF_CONSTANT); 74 animation3->setInfinity(ANIM_INF_CONSTANT); 75 76 this->setEmissionPoint(3.8, 1.2, 0); 77 78 animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 79 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL); 80 81 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL); 82 animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 83 } 18 84 19 85 86 void HeavyBlaster::fire() 87 { 88 Projectile* pj = this->getProjectile(); 89 if (pj == NULL) 90 return; 91 92 // set the owner 93 pj->setOwner(this->getOwner()); 94 95 pj->setParent(PNode::getNullParent()); 96 97 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5)); 98 99 pj->setAbsCoor(this->getEmissionPoint()); 100 pj->setAbsDir(this->getAbsDir()); 101 pj->activate(); 102 } 103 104 /** 105 * this activates the weapon 106 */ 107 void HeavyBlaster::activate() 108 { 109 } 110 111 /** 112 * this deactivates the weapon 113 */ 114 void HeavyBlaster::deactivate() 115 { 116 } 117 118 void HeavyBlaster::draw() const 119 { 120 } -
branches/playability/src/world_entities/weapons/heavy_blaster.h
r9972 r9975 12 12 class HeavyBlaster : public Weapon 13 13 { 14 ObjectListDeclaration(HeavyBlaster);14 //ObjectListDeclaration(HeavyBlaster); 15 15 public: 16 16 HeavyBlaster(); -
branches/playability/src/world_entities/weapons/light_blaster.cc
r9972 r9975 44 44 void LightBlaster::init() 45 45 { 46 this->registerObject(this, LightBlaster::_objectList);46 //this->registerObject(this, LightBlaster::_objectList); 47 47 48 48 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); … … 90 90 return; 91 91 92 // set the owner 93 pj->setOwner(this->getOwner()); 94 92 95 pj->setParent(PNode::getNullParent()); 93 96 94 pj->setVelocity(this->get Velocity() + this->getAbsDir().apply(Vector(1,0,0))*15+VECTOR_RAND(5));97 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5)); 95 98 96 99 pj->setAbsCoor(this->getEmissionPoint()); … … 112 115 { 113 116 } 117 118 void LightBlaster::draw() const 119 { 120 } -
branches/playability/src/world_entities/weapons/light_blaster.h
r9972 r9975 12 12 class LightBlaster : public Weapon 13 13 { 14 ObjectListDeclaration(LightBlaster);14 //ObjectListDeclaration(LightBlaster); 15 15 public: 16 16 LightBlaster (); -
branches/playability/src/world_entities/weapons/medium_blaster.cc
r9972 r9975 1 1 #include "medium_blaster.h" 2 #include "world_entities/projectiles/projectile.h" 3 4 #include "world_entity.h" 5 #include "static_model.h" 6 #include "weapon_manager.h" 7 #include "util/loading/factory.h" 8 9 #include "animation3d.h" 10 11 #include "loading/fast_factory.h" 12 13 CREATE_FACTORY(MediumBlaster); 14 /** 15 * Standard constructor 16 */ 17 MediumBlaster::MediumBlaster () 18 : Weapon() 19 { 20 this->init(); 21 } 2 22 3 23 MediumBlaster::MediumBlaster (const TiXmlElement* root = NULL) 4 24 : Weapon() 5 25 { 6 26 this->init(); 7 27 if (root != NULL) 8 28 this->loadParams(root); 9 29 } 10 30 11 31 /** … … 13 33 */ 14 34 MediumBlaster::~MediumBlaster() 15 35 { 16 36 // model will be deleted from WorldEntity-destructor 17 } 37 } 38 39 void MediumBlaster::loadParams(const TiXmlElement* root) 40 { 41 Weapon::loadParams(root); 42 } 43 44 void MediumBlaster::init() 45 { 46 //this->registerObject(this, MediumBlaster::_objectList); 47 48 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); 49 50 this->loadModel("models/guns/plasmadriver_#.obj", 1.0); 51 52 53 this->setStateDuration(WS_SHOOTING, 0.05); 54 this->setStateDuration(WS_RELOADING, 0); 55 this->setStateDuration(WS_ACTIVATING, .5); 56 this->setStateDuration(WS_DEACTIVATING, 1); 57 58 this->setEnergyMax(5000); 59 this->increaseEnergy(5000); 60 //this->minCharge = 2; 61 62 this->setActionSound(WA_SHOOT, "sound/laser.wav"); 63 this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav"); 64 this->setActionSound(WA_RELOAD, "sound/spawn/alien_generator.wav"); 65 66 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 67 this->setProjectileTypeC("RailProjectile"); // FIXME temp project type until the blaste class exist 68 this->prepareProjectiles(100); 69 70 Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this); 71 Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this); 72 73 animation2->setInfinity(ANIM_INF_CONSTANT); 74 animation3->setInfinity(ANIM_INF_CONSTANT); 75 76 this->setEmissionPoint(3.8, 1.2, 0); 77 78 animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 79 animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL); 80 81 animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL); 82 animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); 83 } 18 84 19 85 86 void MediumBlaster::fire() 87 { 88 Projectile* pj = this->getProjectile(); 89 if (pj == NULL) 90 return; 91 92 // set the owner 93 pj->setOwner(this->getOwner()); 94 95 pj->setParent(PNode::getNullParent()); 96 97 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5)); 98 99 pj->setAbsCoor(this->getEmissionPoint()); 100 pj->setAbsDir(this->getAbsDir()); 101 pj->activate(); 102 } 103 104 /** 105 * this activates the weapon 106 */ 107 void MediumBlaster::activate() 108 { 109 } 110 111 /** 112 * this deactivates the weapon 113 */ 114 void MediumBlaster::deactivate() 115 { 116 } 117 118 void MediumBlaster::draw() const 119 { 120 } -
branches/playability/src/world_entities/weapons/medium_blaster.h
r9972 r9975 12 12 class MediumBlaster : public Weapon 13 13 { 14 ObjectListDeclaration(MediumBlaster);14 //ObjectListDeclaration(MediumBlaster); 15 15 public: 16 16 MediumBlaster();
Note: See TracChangeset
for help on using the changeset viewer.