Changeset 10362 in orxonox.OLD for branches/playability.new/src/world_entities/space_ships/space_ship.h
- Timestamp:
- Jan 25, 2007, 3:05:01 AM (17 years ago)
- Location:
- branches/playability.new
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability.new
- Property svn:ignore
-
old new 10 10 autom4te.cache 11 11 aclocal.m4 12 tags 13 test.bmp 14 config.sub 15 config.guess 16 OrxonoxPlayability.kdevses 17 OrxonoxPlayability.kdevelop.pcs
-
- Property svn:ignore
-
branches/playability.new/src/world_entities/space_ships/space_ship.h
r9869 r10362 2 2 * @file space_ship.h 3 3 * Implements the Control of a Spaceship 4 * Space Ships are the core class for all types of ships in Orxonox 5 * By default is on OM_GROUP_00 6 * If player boards the ship, it is moved to OM_GROUP_01 4 7 */ 5 8 … … 16 19 class ParticleEmitter; 17 20 class ParticleSystem; 21 class Trail; 22 class Wobblegrid; 18 23 19 24 class SpaceShip : public Playable … … 29 34 30 35 virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); 36 /* 37 void setTravelHeight(float travelHeight); 38 void setTravelDistance(const Vector2D& distance); 39 void setTravelDistance(float x, float y); 40 */ 41 42 //void setAirFriction(float friction) { this->airFriction = friction; }; 31 43 32 44 virtual void enter(); … … 41 53 virtual void respawn(); 42 54 43 virtual void collidesWith(WorldEntity* entity, const Vector& location); 55 inline Vector getVelocity() { return this->velocity; }; 56 44 57 virtual void tick(float time); 45 58 virtual void draw() const; 46 59 47 60 virtual void process(const Event &event); 61 // virtual void hit (WorldEntity* entity, float damage); 62 63 inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; }; 64 65 //Functions for GUI 66 inline float getShieldCur() { return this->shieldCur; }; //!< returns current shield value 67 inline float getShieldMax() { return this->shieldMax; }; //!< returns maximum shield value 68 69 inline float getArmorCur() { return this->armorCur; }; //!< returns current armor value 70 inline float getArmorMax() { return this->armorMax; }; //!< returns current armor value 71 72 inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value 73 inline float getElectronicMax() { return this->electronicMax; }; //!< returns current electronic value 74 75 inline PNode* getTravelNode() { return this->travelNode; }; 76 77 //damage handler 78 virtual void damage(float pDamage, float eDamage); //!< pDamage physical damage, eDamage electronic damage 79 80 //included by Michel: 81 virtual void enterPlaymode(Playable::Playmode playmode); 82 void setPlaymodeXML(const std::string& playmode); //recieves the playmode from a string (useful for script implementation) 83 void setActionWidthPercentage(int i); 84 void updateTravelDistance(); 85 virtual void movement (float dt); 86 87 // 88 89 void nextWeaponConfig(); 90 void previousWeaponConfig(); 91 92 virtual void hit(float damage, WorldEntity* killer); 48 93 49 94 private: 50 95 void init(); 51 96 52 void calculateVelocity(float time); 53 54 bool bUp; //!< up button pressed. 55 bool bDown; //!< down button pressed. 97 //void calculateVelocity(float time); 98 99 void regen(float time); //!< handler for shield and electronic regeneration 100 101 void weaponRegen(float time); //!< weapon energy regeneration 102 103 inline bool systemFailure() { return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); }; 104 105 void updateElectronicWidget(); 106 void updateShieldWidget(); 107 108 //WeaponManager weaponMan; //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping 109 WeaponManager secWeaponMan; //!< the secondary weapon manager: managing a list of special weapons to weapon-slot mapping 110 short supportedPlaymodes; //!< What Playmodes are Supported in this Playable. 111 Playable::Playmode playmode; //!< The current playmode. 112 113 //ship atributes 114 float shieldCur; //!< current shield 115 float shieldMax; //!< maximum shield 116 float shieldEnergyShare; //!< percentage of reactor output 117 float shieldRegen; //!< shield regeneration rate per second 118 float shieldTH; //!< shield threshhold for reactivation 119 bool shieldActive; //!< wheather the shield is working 120 OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar 121 122 float armorCur; //!< current armor 123 float armorMax; //!< maximum armor 124 float armorRegen; //!< armor regeneration per tick (usable on bioships?) 125 //note that the armor widget is set on the health- widget in world- entity (see in player.cc) 126 127 float electronicCur; //!< current electronic 128 float electronicMax; //!< maximum electronic 129 float electronicRegen; //!< electronic regenration rate per tick 130 float electronicTH; //!< Threshhold for electronic failure 131 OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar 132 133 float engineSpeedCur; //!< speed output for movement = speed base + energy share part 134 float engineSpeedBase; //!< speed base 135 int enginePowerConsume; //!< energy needed 136 float engineEnergyShare; //!< percentage of reactor output 137 138 int weaponEnergySlot; //!< number of energy weapon slots 139 int weaponEnergyUsed; 140 float weaponEnergyShare; 141 float weaponEnergyRegen; 142 int weaponSpecialSlot; //!< number of special weapon slots 143 int weaponSpecialUsed; 144 145 float reactorOutput; //!< reactor output 146 float reactorCapacity; //!< reactor capacity 147 148 int curWeaponPrimary; //!< current primary weapon config 149 int curWeaponSecondary; //!< current secondary weapon config 150 151 bool bForward; //!< up button pressed. 152 bool bBackward; //!< down button pressed. 56 153 bool bLeft; //!< left button pressed. 57 154 bool bRight; //!< right button pressed. 58 155 bool bAscend; //!< ascend button pressed. 59 156 bool bDescend; //!< descend button presses. 60 // bool bFire; //!< fire button pressed.(moved to playable)61 157 bool bRollL; //!< rolling button pressed (left) 62 158 bool bRollR; //!< rolling button pressed (right) 63 159 bool bSecFire; //!< second fire button pressed 160 161 /* 64 162 float xMouse; //!< mouse moved in x-Direction 65 163 float yMouse; //!< mouse moved in y-Direction … … 68 166 int controlVelocityX; 69 167 int controlVelocityY; 70 // float cycle; //!< hovercycle 168 */ 71 169 72 170 Vector velocity; //!< the velocity of the player. 73 Vector oldVelocity; //!< the velocity the player had last synced 171 Vector oldPos; 172 173 // 2D-traveling 174 PNode* travelNode; 175 float travelSpeed; //!< the current speed of the Ship (to make soft movement) 176 Vector travelVelocity; //!< object internal velocity vector for relative movement to the track node 177 Vector2D travelDistancePlus; //!< Travel-Distance away from the TravelNode 178 Vector2D travelDistanceMinus; 179 bool isTravelDistanceInit; 180 181 float actionWidthPercentage; 182 183 // Camera 184 PNode cameraNode; 185 float cameraLook; 186 float rotation; 187 float cameraSpeed; 188 189 void setCameraDistance(float dist); 190 void setCameraFovy(float fovy); 191 192 /* 74 193 Quaternion mouseDir; //!< the direction where the player wants to fly 75 194 Quaternion oldMouseDir; //!< the direction where the player wanted to fly … … 77 196 Quaternion rotQuat; 78 197 Quaternion pitchDir; 79 float travelSpeed; //!< the current speed of the player (to make soft movement) 80 float acceleration; //!< the acceleration of the player. 81 82 float airViscosity; 198 float dogdeSpeed; //!< the dogde Speed of the ship. 199 */ 200 201 //Quaternion direction; //!< the direction of the ship. 202 float acceleration; //!< the acceleration of the ship. 203 //float airFriction; //!< AirFriction. 204 //float airViscosity; 83 205 84 206 byte oldMask; //!< used for synchronisation 85 207 86 ParticleEmitter* burstEmitter; 87 ParticleSystem* burstSystem; 208 Trail* trail; //!< Burst trail 209 Trail* trailL; //!< Burst trail 210 Trail* trailR; //!< Burst trail 211 212 88 213 }; 89 214
Note: See TracChangeset
for help on using the changeset viewer.