Changeset 10771 in orxonox.OLD for branches/presentation/src/world_entities/weapons/weapon.h
- Timestamp:
- Jun 27, 2007, 7:01:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/weapons/weapon.h
r10707 r10771 20 20 21 21 #include "sound_buffer.h" 22 23 #define MAX_SEGMENTS 3 24 #define MAX_BARRELS 4 25 26 #define W_LEFT 0 27 #define W_RIGHT 1 22 28 23 29 // FORWARD DECLARATION … … 129 135 // EMISSION 130 136 /** keeping old functions*/ 131 void setEmissionPoint(const Vector& point, int barrel );132 void setEmissionPoint(const Vector& point);137 void setEmissionPoint(const Vector& point, int barrel = 0); 138 // void setEmissionPoint(const Vector& point); 133 139 /** @see void setEmissionPoint(const Vector& point); */ 134 inline void setEmissionPoint(float x, float y, float z, int barrel ) { this->setEmissionPoint(Vector(x, y, z), barrel); };135 inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y, z)); };140 inline void setEmissionPoint(float x, float y, float z, int barrel = 0) { this->setEmissionPoint(Vector(x, y, z), barrel); }; 141 // inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y, z)); }; 136 142 /** @returns the absolute Position of the EmissionPoint */ 137 143 inline const Vector& getEmissionPoint(int barrel) const { return this->emissionPoint[barrel]->getAbsCoor(); }; 138 inline const Vector& getEmissionPoint() const { return this->emissionPoint[ 0]->getAbsCoor(); };144 inline const Vector& getEmissionPoint() const { return this->emissionPoint[this->activeBarrel]->getAbsCoor(); }; 139 145 140 146 … … 182 188 inline void setBarrels(int barrels) { this->barrels = barrels; }; 183 189 inline void setSegs(int segs) { this->segs = segs; }; 184 185 // inline Animation3D* getShootAnim(int barrel, int seg) { return this->shootAnim[barrel][seg]; }; 186 // inline void setShootAnim(int barrel, int seg, PNode* component) { this->shootAnim[barrel][seg] = this->getAnimation(barrel, seg, component); }; 190 inline void setActiveBarrel(int ab) {this->activeBarrel = ab; }; 191 inline int getActiveBarrel() { return this->activeBarrel; }; 192 inline void cycleBarrel() { this->activeBarrel = (this->activeBarrel + 1) % this->barrels; }; 193 194 Animation3D* getShootAnim(int barrel, int seg) { return this->shootAnim[barrel][seg]; }; 195 // void setShootAnim(int barrel, int seg, PNode* component) { this->shootAnim[barrel][seg] = this->getAnimation(barrel, seg, component); }; 187 196 188 197 // void init2(); 189 void deconstr();198 // void deconstr(); 190 199 191 200 inline int getPreferedSide() { return this->preferedSide; } … … 194 203 inline void setEnergyWidgetInitialized(bool b) {this->isEnergyWidgetInitialized = b;}; 195 204 205 inline const Vector& getObjComp(int barrel, int seg) const { return this->objComp[barrel][seg]->getAbsCoor(); }; 206 inline const float getObjCompx(int barrel, int seg) const { return this->objComp[barrel][seg]->getAbsCoor().x; }; 207 inline const float getObjCompy(int barrel, int seg) const { return this->objComp[barrel][seg]->getAbsCoor().y; }; 208 inline const float getObjCompz(int barrel, int seg) const { return this->objComp[barrel][seg]->getAbsCoor().z; }; 196 209 197 210 protected: … … 264 277 OrxSound::SoundBuffer soundBuffers[WA_ACTION_COUNT]; //!< SoundBuffers for all actions @see WeaponAction. 265 278 266 PNode* * emissionPoint; //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default)279 PNode* emissionPoint[MAX_BARRELS]; //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default) 267 280 268 281 bool hideInactive; //!< Hides the Weapon if it is inactive … … 272 285 FastFactory* projectileFactory; //!< A factory, that produces and handles the projectiles. 273 286 274 int barrels; //!< # of barrels 275 int segs; //!< # of segments, one barrel has 276 Animation3D*** shootAnim; 287 int barrels; //!< # of barrels (max 4) 288 int segs; //!< # of segments, one barrel has (max 3) 289 int activeBarrel; 290 Animation3D* shootAnim[MAX_BARRELS][MAX_SEGMENTS]; 291 PNode* objComp[MAX_BARRELS][MAX_SEGMENTS]; 277 292 278 293 int preferedSlot; //!< prefered slot to add 279 294 int preferedSide; //!< prefered side (left/right) to be added 295 int side; //!< describes left/right orientation of the weapon. 280 296 281 297 };
Note: See TracChangeset
for help on using the changeset viewer.