Changeset 12366 for code/branches/OrxoBlox_FS19/src
- Timestamp:
- May 9, 2019, 5:15:43 PM (6 years ago)
- Location:
- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
r12361 r12366 4 4 OrxoBloxWall.cc 5 5 OrxoBloxBall.cc 6 OrxoBloxBot.cc7 6 OrxoBloxCenterpoint.cc 8 7 OrxoBloxStones.cc 9 8 OrxoBloxScore.cc 10 9 11 10 … … 20 19 SOURCE_FILES ${OrxoBlox_SRC_FILES} 21 20 ) 21 22 23 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
r12360 r12366 49 49 #include "OrxoBloxCenterpoint.h" 50 50 #include "OrxoBloxBall.h" 51 //#include "OrxoBloxBot.h"//Remove??52 51 #include "OrxoBloxStones.h" 53 52 #include "OrxoBloxWall.h" … … 64 63 Constructor. Registers and initializes the object. 65 64 */ 66 OrxoBlox::OrxoBlox(Context* context) : ::orxonox::Deathmatch::Deathmatch(context)65 OrxoBlox::OrxoBlox(Context* context) : Deathmatch(context) 67 66 { 68 67 RegisterObject(OrxoBlox); … … 147 146 this->ball_->setSpeed(0); 148 147 this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor()); 149 this->ball_->setBatLength(this->center_->getBatLength()); 150 148 151 149 level_=1; 152 150 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
r12364 r12366 65 65 this->speed_ = 0; 66 66 this->accelerationFactor_ = 1.0f; 67 this->bDeleteBats_ = false;67 68 68 this->relMercyOffset_ = 0.05f; 69 69 this->orxoblox_ = this->getOrxoBlox(); … … 77 77 this->defScoreSound_ = new WorldSound(this->getContext()); 78 78 this->defScoreSound_->setVolume(1.0f); 79 this->defBatSound_ = new WorldSound(this->getContext()); 80 this->defBatSound_->setVolume(0.4f); 79 81 80 this->defBoundarySound_ = new WorldSound(this->getContext()); 82 81 this->defBoundarySound_->setVolume(0.5f); … … 85 84 { 86 85 this->defScoreSound_ = nullptr; 87 this->defBatSound_ = nullptr;86 88 87 this->defBoundarySound_ = nullptr; 89 88 } … … 96 95 OrxoBloxBall::~OrxoBloxBall() 97 96 { 98 if (this->isInitialized()) 99 { 100 if (this->bDeleteBats_) 101 102 delete[] this->batID_; 103 } 97 104 98 } 105 99 … … 109 103 SUPER(OrxoBloxBall, XMLPort, xmlelement, mode); 110 104 XMLPortParam(OrxoBloxBall, "defScoreSound", setDefScoreSound, getDefScoreSound, xmlelement, mode); 111 XMLPortParam(OrxoBloxBall, "defBatSound", setDefBatSound, getDefBatSound, xmlelement, mode);105 112 106 XMLPortParam(OrxoBloxBall, "defBoundarySound", setDefBoundarySound, getDefBoundarySound, xmlelement, mode); 113 107 } … … 121 115 registerVariable( this->fieldWidth_ ); 122 116 registerVariable( this->fieldHeight_ ); 123 registerVariable( this->batlength_ );117 124 118 registerVariable( this->speed_ ); 125 119 registerVariable( this->relMercyOffset_ ); … … 275 269 } 276 270 277 void OrxoBloxBall::setDefBatSound(const std::string &OrxoBloxSound) 278 { 279 if( defBatSound_ ) 280 defBatSound_->setSource(OrxoBloxSound); 281 else 282 assert(0); // This should never happen, because soundpointer is only available on master 283 } 284 285 const std::string& OrxoBloxBall::getDefBatSound() 286 { 287 if( defBatSound_ ) 288 return defBatSound_->getSource(); 289 else 290 assert(0); 291 return BLANKSTRING; 292 } 293 271 272 294 273 void OrxoBloxBall::setDefBoundarySound(const std::string &OrxoBloxSound) 295 274 { -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
r12360 r12366 109 109 { return this->accelerationFactor_; } 110 110 111 /** 112 @brief Set the length of the bats. 113 @param batlength The length of the bats (in z-direction) as percentage of the height of the playing field. 114 */ 115 void setBatLength(float batlength) 116 { this->batlength_ = batlength; } 117 /** 118 @brief Get the length of the bats. 119 @return Returns the length of the bats (in z-direction) as percentage of the height of the playing field. 120 */ 121 float getBatLength() const 122 { return this->batlength_; } 123 111 124 112 125 113 void Bounce(OrxoBloxStones* otherObject); … … 130 118 void setDefScoreSound(const std::string& engineSound); 131 119 const std::string& getDefScoreSound(); 132 void setDefBatSound(const std::string& engineSound); 133 const std::string& getDefBatSound(); 120 134 121 void setDefBoundarySound(const std::string& engineSound); 135 122 const std::string& getDefBoundarySound(); … … 146 133 float speed_; //!< The speed (in x-direction) of the ball. 147 134 float accelerationFactor_; //!< The acceleration factor of the ball. 148 float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field. 149 bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not. 135 150 136 unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network. 151 137 float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have. 152 138 WorldSound* defScoreSound_; 153 WorldSound* defBatSound_;154 139 WorldSound* defBoundarySound_; 155 140 OrxoBlox* orxoblox_; -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc
r12339 r12366 60 60 this->ballspeed_ = 100; 61 61 this->ballaccfactor_ = 1.0; 62 this->batspeed_ = 60; 63 this->batlength_ = 0.25; 64 62 65 63 this->checkGametype(); 66 64 } … … 76 74 XMLPortParam(OrxoBloxCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode); 77 75 XMLPortParam(OrxoBloxCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode); 78 XMLPortParam(OrxoBloxCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);79 76 XMLPortParam(OrxoBloxCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode); 80 77 XMLPortParam(OrxoBloxCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode); 81 XMLPortParam(OrxoBloxCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode); 78 82 79 XMLPortParam(OrxoBloxCenterpoint, "stoneTemplate", setStoneTemplate, getStoneTemplate, xmlelement, mode); 83 80 XMLPortParam(OrxoBloxCenterpoint, "WallTemplate", setWallTemplate, getWallTemplate, xmlelement, mode); 84 XMLPortParam(OrxoBloxCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);85 81 } 86 82 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.h
r12307 r12366 139 139 { return this->balltemplate_; } 140 140 141 /** 142 @brief Set the template for the bats. (e.g. to attach the model of the bat, but also to attach CameraPositions to it, to be able to view the game from the bats perspective) 143 @param battemplate The name of the template to be set. 144 */ 145 void setBattemplate(const std::string& battemplate) 146 { this->battemplate_ = battemplate; } 147 /** 148 @brief Get the template of the bats. 149 @return Returns the name of the template of the bats. 150 */ 151 const std::string& getBattemplate() const 152 { return this->battemplate_; } 153 141 154 142 /** 155 143 @brief Set the dimensions of the playing field. … … 191 179 { return this->ballaccfactor_; } 192 180 193 /** 194 @brief Set the speed of the bats. 195 @param batspeed The speed of the bats. 196 */ 197 void setBatSpeed(float batspeed) 198 { this->batspeed_ = batspeed; } 199 /** 200 @brief Get the speed of the bats. 201 @return Returns the speed of the bats. 202 */ 203 float getBatSpeed() const 204 { return this->batspeed_; } 205 206 /** 207 @brief Set the length of the bats. 208 @param batlength The length of the bats (in z-direction) as a percentage of the height of the playing field. 209 */ 210 void setBatLength(float batlength) 211 { this->batlength_ = batlength; } 212 /** 213 @brief Get the length of the bats. 214 @return Returns the length of the bats (in z-direction) as a percentage of the height of the playing field. 215 */ 216 float getBatLength() const 217 { return this->batlength_; } 218 181 219 182 /** 220 183 @brief Set the template for the stones. … … 250 213 251 214 std::string balltemplate_; //!< The template for the ball. 252 std::string battemplate_; //!< The template for the bats.253 215 std::string WallTemplate_; 254 216 std::string stoneTemplate_; … … 256 218 float ballspeed_; //!< The speed of then ball. 257 219 float ballaccfactor_; //!< The acceleration factor of the ball. 258 float batspeed_; //!< The speed of the bat.259 float batlength_; //!< The length of the bat (in z-direction) as a percentage of the height of the playing field.260 261 220 float width_; //!< The height of the playing field. 262 221 float height_; //!< The width of the playing field. -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h
r12359 r12366 43 43 //----------------------------------------------------------------------- 44 44 45 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(O rxoBlox_STATIC_BUILD)46 # ifdef O rxoBlox_SHARED_BUILD45 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXOBLOX_STATIC_BUILD) 46 # ifdef ORXOBLOX_SHARED_BUILD 47 47 # define _OrxoBloxExport __declspec(dllexport) 48 48 # else … … 73 73 class OrxoBloxWall; 74 74 class OrxoBloxStones; 75 class OrxoBloxShip;76 75 class OrxoBloxScore; 77 76 } -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.cc
r12359 r12366 55 55 this->owner_ = nullptr; 56 56 this->player_ = nullptr; 57 57 } 58 58 /** 59 59 @brief
Note: See TracChangeset
for help on using the changeset viewer.