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

jeromela at orxonox.net jeromela at orxonox.net
Thu May 9 09:39:56 CEST 2019


Author: jeromela
Date: 2019-05-09 09:39:55 +0200 (Thu, 09 May 2019)
New Revision: 12339

Modified:
   code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
   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/OrxoBloxCenterpoint.cc
Log:
spielfeldgroesse

Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-03 09:23:15 UTC (rev 12338)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-09 07:39:55 UTC (rev 12339)
@@ -106,13 +106,13 @@
 
     <MovableEntity rotationrate=0 rotationaxis="0,0,1">
       <attached>
-        <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="100,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 battemplate=OrxoBloxbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25 StoneTemplate=OrxoBloxstone WallTemplate=OrxoBloxwall>
         
           <attached>
             <!-- Balken die das Spielfeld begrenzen. -->
-            <Model position="0,0,-50" mesh="cube.mesh" scale3D="50,1,1" />
-            <Model position="50,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
-            <Model position="-50,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
+            <Model position="0,0,-50" mesh="cube.mesh" scale3D="45,1,1" />
+            <Model position="45,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
+            <Model position="-45,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
           </attached>
         </OrxoBloxCenterpoint>
       </attached>

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-03 09:23:15 UTC (rev 12338)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-05-09 07:39:55 UTC (rev 12339)
@@ -142,7 +142,8 @@
 
             // Attach the ball to the centerpoint and set the parameters as specified in the centerpoint, the ball is attached to.
             this->center_->attach(this->ball_);
-            this->ball_->setPosition(0, 0, 40);
+            //Startposition Ball
+            this->ball_->setPosition(0, 0, 50);
             this->ball_->setFieldDimension(this->center_->getFieldDimension());
             this->ball_->setSpeed(0);
             this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc	2019-05-03 09:23:15 UTC (rev 12338)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc	2019-05-09 07:39:55 UTC (rev 12339)
@@ -143,8 +143,15 @@
             velocity.z = -velocity.z;
             // And its position is set as to not overstep the boundary it has just crossed.
             if (position.z > this->fieldHeight_ / 2){
-                ChatManager::message("Ball hat das Feld verlassen");
-                //TODO: ball zerstoeren
+                // Set the ball to be exactly at the boundary.
+                position.z = this-> fieldHeight_ / 2;
+                // Set the velocity to zero
+                this->setSpeed(0); // doesn't work here, why??;
+                //velocity.x = 0;
+                //velocity.y = 0;
+                //velocity.z = 0; 
+                orxout() << "Output" << endl;
+                ChatManager::message("Waiting");
             }
             if (position.z < -this->fieldHeight_ / 2){
                 position.z = -this->fieldHeight_ / 2;
@@ -202,10 +209,10 @@
 
             // Set the speed in the direction of the balls current velocity.
             Vector3 velocity = this->getVelocity();
-            if (velocity.x != 0)
+            //if (velocity.x != 0)
                 velocity.x = sgn(velocity.x) * this->speed_;
-            else // If the balls current velocity is zero, the speed is set in a random direction.
-                velocity.x = this->speed_ * sgn(rnd(-1,1));
+            //else // If the balls current velocity is zero, the speed is set in a random direction.
+            //    velocity.x = this->speed_ * sgn(rnd(-1,1));
             //velocity.y = this->speed_;
             velocity.z = this->speed_;
 

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc	2019-05-03 09:23:15 UTC (rev 12338)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxCenterpoint.cc	2019-05-09 07:39:55 UTC (rev 12339)
@@ -55,8 +55,8 @@
     {
         RegisterObject(OrxoBloxCenterpoint);
 
-        this->width_ = 200;
-        this->height_ = 120;
+        this->width_ = 100;
+        this->height_ = 50;
         this->ballspeed_ = 100;
         this->ballaccfactor_ = 1.0;
         this->batspeed_ = 60;



More information about the Orxonox-commit mailing list