[Orxonox-commit 7774] r12366 - in code/branches/OrxoBlox_FS19: data/levels src/modules/OrxoBlox

ahuwyler at orxonox.net ahuwyler at orxonox.net
Thu May 9 17:15:45 CEST 2019


Author: ahuwyler
Date: 2019-05-09 17:15:43 +0200 (Thu, 09 May 2019)
New Revision: 12366

Modified:
   code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.h
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.cc
Log:
Here and there

Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-09 15:15:43 UTC (rev 12366)
@@ -19,7 +19,7 @@
 ?>
 
 <!--Template name=OrxoBloxbatcameras defaults=0>
-  <OrxoBloxBat>
+  <OrxoBloxStones>
     <camerapositions>
       <CameraPosition position="0,150,0"  absolute=true />
       <CameraPosition position="0,50,160" drag=true mouselook=true />
@@ -26,7 +26,7 @@
       <CameraPosition position="0,40,125" drag=true mouselook=true />
       <CameraPosition position="0,30, 90" drag=true mouselook=true />
     </camerapositions>
-  </OrxoBloxBat>
+  </OrxoBloxStones>
 </Template-->
 
 <Template name=OrxoBloxball>
@@ -47,16 +47,10 @@
   </OrxoBloxBall>
 </Template>
 
-<Template name=OrxoBloxStonescameras defaults=0>
-    <OrxoBloxStones>
-      <camerapositions>
-        <CameraPosition position="55,75,200" absolute=true />
-      </camerapositions>
-    </OrxoBloxStones>
-  </Template>
+
   
   <Template name=OrxoBloxstone>
-    <OrxoBloxStones camerapositiontemplate=OrxoBloxStonescameras >
+    <OrxoBloxStones>
       <attached>
         <Model position="0,0,0" mesh="CuboidBody.mesh" scale=4.5 />
         <Model position="0,0,0" mesh="cube_orange.mesh" scale=4.3 />
@@ -64,18 +58,10 @@
     </OrxoBloxStones>
   </Template>
   
-  <Template name=OrxoBloxWallcameras defaults=0>
-    <OrxoBloxWall>
-      <camerapositions>
-        <CameraPosition position="55,75,200" absolute=true />
-        <!--CameraPosition position="0,50,160" drag=true mouselook=true />
-        <CameraPosition position="0,50,0" pitch=-90 drag=true mouselook=true /-->
-      </camerapositions>
-    </OrxoBloxWall>
-  </Template>
   
+  
   <Template name=OrxoBloxwall>
-    <OrxoBloxWall camerapositiontemplate=OrxoBloxWallcameras>
+    <OrxoBloxWall>
     </OrxoBloxWall>
   </Template>
 
@@ -102,7 +88,7 @@
     <!--<Model mesh="axes.mesh" scale=10 position="0,0,0" /> -->
 
 
-    <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="90,100" balltemplate=OrxoBloxball battemplate=OrxoBloxbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25 StoneTemplate=OrxoBloxstone WallTemplate=OrxoBloxwall >
+    <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="90,100" balltemplate=OrxoBloxball  ballspeed=200 ballaccfactor=1.0  StoneTemplate=OrxoBloxstone WallTemplate=OrxoBloxwall >
         
       <attached>
             <!-- Balken die das Spielfeld begrenzen. -->
@@ -112,6 +98,7 @@
       </attached>
     </OrxoBloxCenterpoint>
       
+
   </Scene>
 </Level>
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt	2019-05-09 15:15:43 UTC (rev 12366)
@@ -3,10 +3,9 @@
   OrxoBlox.cc
   OrxoBloxWall.cc
   OrxoBloxBall.cc
-  OrxoBloxBot.cc
   OrxoBloxCenterpoint.cc
   OrxoBloxStones.cc
-  
+  OrxoBloxScore.cc
 
 
 )
@@ -19,3 +18,6 @@
     overlays
   SOURCE_FILES ${OrxoBlox_SRC_FILES}
 )
+
+
+  
\ No newline at end of file

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-09 15:15:43 UTC (rev 12366)
@@ -48,7 +48,6 @@
 
 #include "OrxoBloxCenterpoint.h"
 #include "OrxoBloxBall.h"
-//#include "OrxoBloxBot.h"//Remove??
 #include "OrxoBloxStones.h"
 #include "OrxoBloxWall.h"
 #include "OrxoBloxShip.h"
@@ -63,7 +62,7 @@
     @brief
         Constructor. Registers and initializes the object.
     */
-    OrxoBlox::OrxoBlox(Context* context) : ::orxonox::Deathmatch::Deathmatch(context)
+    OrxoBlox::OrxoBlox(Context* context) : Deathmatch(context)
     {
         RegisterObject(OrxoBlox);
 
@@ -146,8 +145,7 @@
             this->ball_->setFieldDimension(this->center_->getFieldDimension());
             this->ball_->setSpeed(0);
             this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());
-            this->ball_->setBatLength(this->center_->getBatLength());
-
+            
             level_=1;
 
             // Create the first Wall.

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc	2019-05-09 15:15:43 UTC (rev 12366)
@@ -64,7 +64,7 @@
 
         this->speed_ = 0;
         this->accelerationFactor_ = 1.0f;
-        this->bDeleteBats_ = false;
+        
         this->relMercyOffset_ = 0.05f;
         this->orxoblox_ = this->getOrxoBlox();
         this->radius_ = 1.5;
@@ -76,8 +76,7 @@
              {
                  this->defScoreSound_ = new WorldSound(this->getContext());
                  this->defScoreSound_->setVolume(1.0f);
-                 this->defBatSound_ = new WorldSound(this->getContext());
-                 this->defBatSound_->setVolume(0.4f);
+                 
                  this->defBoundarySound_ = new WorldSound(this->getContext());
                  this->defBoundarySound_->setVolume(0.5f);
              }
@@ -84,7 +83,7 @@
              else
              {
                  this->defScoreSound_ = nullptr;
-                 this->defBatSound_ = nullptr;
+                 
                  this->defBoundarySound_ = nullptr;
              }
     }
@@ -95,12 +94,7 @@
     */
     OrxoBloxBall::~OrxoBloxBall()
     {
-        if (this->isInitialized())
-        {
-            if (this->bDeleteBats_)
-
-            delete[] this->batID_;
-        }
+        
     }
 
     //xml port for loading sounds
@@ -108,7 +102,7 @@
     {
         SUPER(OrxoBloxBall, XMLPort, xmlelement, mode);
         XMLPortParam(OrxoBloxBall, "defScoreSound",  setDefScoreSound,  getDefScoreSound,  xmlelement, mode);
-        XMLPortParam(OrxoBloxBall, "defBatSound",  setDefBatSound,  getDefBatSound,  xmlelement, mode);
+        
         XMLPortParam(OrxoBloxBall, "defBoundarySound",  setDefBoundarySound,  getDefBoundarySound,  xmlelement, mode);
     }
 
@@ -120,7 +114,7 @@
     {
         registerVariable( this->fieldWidth_ );
         registerVariable( this->fieldHeight_ );
-        registerVariable( this->batlength_ );
+        
         registerVariable( this->speed_ );
         registerVariable( this->relMercyOffset_ );
     }
@@ -274,23 +268,8 @@
         return BLANKSTRING;
     }
 
-    void OrxoBloxBall::setDefBatSound(const std::string &OrxoBloxSound)
-    {
-        if( defBatSound_ )
-            defBatSound_->setSource(OrxoBloxSound);
-        else
-            assert(0); // This should never happen, because soundpointer is only available on master
-    }
-
-    const std::string& OrxoBloxBall::getDefBatSound()
-    {
-        if( defBatSound_ )
-            return defBatSound_->getSource();
-        else
-            assert(0);
-        return BLANKSTRING;
-    }
-
+    
+    
     void OrxoBloxBall::setDefBoundarySound(const std::string &OrxoBloxSound)
     {
         if( defBoundarySound_ )

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h	2019-05-09 15:15:43 UTC (rev 12366)
@@ -108,20 +108,8 @@
             float getAccelerationFactor() const
                 { return this->accelerationFactor_; }
 
-            /**
-            @brief Set the length of the bats.
-            @param batlength The length of the bats (in z-direction) as percentage of the height of the playing field.
-            */
-            void setBatLength(float batlength)
-                { this->batlength_ = batlength; }
-            /**
-            @brief Get the length of the bats.
-            @return Returns the length of the bats (in z-direction) as percentage of the height of the playing field.
-            */
-            float getBatLength() const
-                { return this->batlength_; }
+        
 
-
             void Bounce(OrxoBloxStones* otherObject);
             void Collides(OrxoBloxStones* otherObject);
 
@@ -129,8 +117,7 @@
 
             void setDefScoreSound(const std::string& engineSound);
             const std::string& getDefScoreSound();
-            void setDefBatSound(const std::string& engineSound);
-            const std::string& getDefBatSound();
+            
             void setDefBoundarySound(const std::string& engineSound);
             const std::string& getDefBoundarySound();
             float getRadius();
@@ -145,12 +132,10 @@
             float fieldHeight_; //!< The height of the playing field.
             float speed_; //!< The speed (in x-direction) of the ball.
             float accelerationFactor_; //!< The acceleration factor of the ball.
-            float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field.
-            bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not.
+            
             unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
             float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
             WorldSound* defScoreSound_;
-            WorldSound* defBatSound_;
             WorldSound* defBoundarySound_;
             OrxoBlox* orxoblox_;
     };

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc	2019-05-09 15:15:43 UTC (rev 12366)
@@ -59,9 +59,7 @@
         this->height_ = 50;
         this->ballspeed_ = 100;
         this->ballaccfactor_ = 1.0;
-        this->batspeed_ = 60;
-        this->batlength_ = 0.25;
-
+        
         this->checkGametype();
     }
 
@@ -75,13 +73,11 @@
 
         XMLPortParam(OrxoBloxCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode);
         XMLPortParam(OrxoBloxCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode);
-        XMLPortParam(OrxoBloxCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
         XMLPortParam(OrxoBloxCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
         XMLPortParam(OrxoBloxCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode);
-        XMLPortParam(OrxoBloxCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
+
         XMLPortParam(OrxoBloxCenterpoint, "stoneTemplate", setStoneTemplate, getStoneTemplate, xmlelement, mode);
         XMLPortParam(OrxoBloxCenterpoint, "WallTemplate", setWallTemplate, getWallTemplate, xmlelement, mode);
-        XMLPortParam(OrxoBloxCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
     }
 
     /**

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.h	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.h	2019-05-09 15:15:43 UTC (rev 12366)
@@ -138,20 +138,8 @@
             const std::string& getBalltemplate() const
                 { return this->balltemplate_; }
 
+        
             /**
-            @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)
-            @param battemplate The name of the template to be set.
-            */
-            void setBattemplate(const std::string& battemplate)
-                { this->battemplate_ = battemplate; }
-            /**
-            @brief Get the template of the bats.
-            @return Returns the name of the template of the bats.
-            */
-            const std::string& getBattemplate() const
-                { return this->battemplate_; }
-
-            /**
             @brief Set the dimensions of the playing field.
             @param dimension A vector with the width of the playing field as first component and the height as second.
             */
@@ -190,33 +178,8 @@
             float getBallAccelerationFactor() const
                 { return this->ballaccfactor_; }
 
+    
             /**
-            @brief Set the speed of the bats.
-            @param batspeed The speed of the bats.
-            */
-            void setBatSpeed(float batspeed)
-                { this->batspeed_ = batspeed; }
-            /**
-            @brief Get the speed of the bats.
-            @return Returns the speed of the bats.
-            */
-            float getBatSpeed() const
-                { return this->batspeed_; }
-
-            /**
-            @brief Set the length of the bats.
-            @param batlength The length of the bats (in z-direction) as a percentage of the height of the playing field.
-            */
-            void setBatLength(float batlength)
-                { this->batlength_ = batlength; }
-            /**
-            @brief Get the length of the bats.
-            @return Returns the length of the bats (in z-direction) as a percentage of the height of the playing field.
-            */
-            float getBatLength() const
-                { return this->batlength_; }
-
-            /**
             @brief Set the template for the stones.
             @param templateName The template name to be applied to each stone.
             */
@@ -249,15 +212,11 @@
             void checkGametype(); //!< Checks whether the gametype is OrxoBlox and if it is, sets its centerpoint.
 
             std::string balltemplate_; //!< The template for the ball.
-            std::string battemplate_; //!< The template for the bats.
             std::string WallTemplate_;
             std::string stoneTemplate_;
 
             float ballspeed_; //!< The speed of then ball.
             float ballaccfactor_; //!< The acceleration factor of the ball.
-            float batspeed_; //!< The speed of the bat.
-            float batlength_; //!< The length of the bat (in z-direction) as a percentage of the height of the playing field.
-
             float width_; //!< The height of the playing field.
             float height_; //!< The width of the playing field.
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h	2019-05-09 15:15:43 UTC (rev 12366)
@@ -42,8 +42,8 @@
 // Shared library settings
 //-----------------------------------------------------------------------
 
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(OrxoBlox_STATIC_BUILD)
-#  ifdef OrxoBlox_SHARED_BUILD
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXOBLOX_STATIC_BUILD)
+#  ifdef ORXOBLOX_SHARED_BUILD
 #    define _OrxoBloxExport __declspec(dllexport)
 #  else
 #    if defined( __MINGW32__ )
@@ -72,7 +72,6 @@
     class OrxoBloxCenterpoint;
     class OrxoBloxWall;
     class OrxoBloxStones;
-    class OrxoBloxShip;
     class OrxoBloxScore;
 }
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.cc	2019-05-09 14:24:20 UTC (rev 12365)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.cc	2019-05-09 15:15:43 UTC (rev 12366)
@@ -54,7 +54,7 @@
 
         this->owner_ = nullptr;
         this->player_ = nullptr;
-
+    }
     /**
     @brief
         Destructor.



More information about the Orxonox-commit mailing list