- Timestamp:
- Mar 21, 2019, 2:19:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
r12210 r12212 50 50 This class manages the ball for @ref orxonox::OrxoBlox "OrxoBlox". 51 51 52 It is responsible for both the movement of the ball in the x, y-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint") and the @ref orxonox::OrxoBloxBlocks "OrxoBloxBlocks". Or more precisely, it makes the ball bounce off then left and right delimiters of the playing field, it makes the ball bounce off the blocks, damages them and also detects when it reaches the lower boundand takes appropriate measures.52 It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint") and the @ref orxonox::OrxoBloxBat "OrxoBloxBats". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures. 53 53 54 54 @author … … 76 76 /** 77 77 @brief Get the dimensions of the playing field. 78 @param dimension A vector with the width as the first and height as the second 78 @param dimension A vector with the width as the first and height as the second component. 79 79 */ 80 80 void setFieldDimension(const Vector2& dimension) … … 82 82 /** 83 83 @brief Get the dimensions of the playing field. 84 @return Returns a vector with the width as the first and height as the second 84 @return Returns a vector with the width as the first and height as the second component. 85 85 */ 86 86 Vector2 getFieldDimension() const … … 109 109 110 110 /** 111 @brief Set the length of the b locks.112 @param batlength The length of the b locks (in x-direction) as percentage of the heightof the playing field.111 @brief Set the length of the bats. 112 @param batlength The length of the bats (in z-direction) as percentage of the height of the playing field. 113 113 */ 114 void setB lockLength(float blocklength)115 { this->b locklength_ = blocklength; }114 void setBatLength(float batlength) 115 { this->batlength_ = batlength; } 116 116 /** 117 @brief Get the length of the b locks.118 @return Returns the length of the b locks as percentage of the height of the playingfield.117 @brief Get the length of the bats. 118 @return Returns the length of the bats (in z-direction) as percentage of the height of the playing field. 119 119 */ 120 float getB lockLength() const121 { return this->blocklength_; }120 float getBatLength() const 121 { return this->batlength_; } 122 122 123 void setB lock(WeakPtr<OrxoBloxBlock>* block); //!< Set the blocks for the ball.124 void applyB lock(); //!< Get the blockover the network.123 void setBats(WeakPtr<OrxoBloxBat>* bats); //!< Set the bats for the ball. 124 void applyBats(); //!< Get the bats over the network. 125 125 126 126 static const float MAX_REL_Z_VELOCITY; … … 138 138 float fieldWidth_; //!< The width of the playing field. 139 139 float fieldHeight_; //!< The height of the playing field. 140 float speedX_; //!< The speed (in x-direction) of the ball. 141 float speedY_; //!< The speed (in y-direction) of the ball. 140 float speed_; //!< The speed (in x-direction) of the ball. 142 141 float accelerationFactor_; //!< The acceleration factor of the ball. 143 float blocklength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field. 144 WeakPtr<OrxoBloxBlock>* block_; //!< An array with the blocks. 145 bool bDeleteBlock_; //!< Bool, to keep track, of whether this->block_ exists or not. 146 unsigned int* blockID_; //!< The object IDs of the blocks, to be able to synchronize them over the network. 142 float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field. 143 WeakPtr<OrxoBloxBat>* bat_; //!< An array with the two bats. 144 bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not. 145 unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network. 146 float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have. 147 147 WorldSound* defScoreSound_; 148 148 WorldSound* defBatSound_;
Note: See TracChangeset
for help on using the changeset viewer.