[Orxonox-commit 6896] r11517 - in code/branches/SOBv2_HS17: . BlenderFilesSOB data/levels src/modules/superorxobros src/orxonox/graphics

varxth at orxonox.net varxth at orxonox.net
Mon Oct 30 16:05:01 CET 2017


Author: varxth
Date: 2017-10-30 16:05:01 +0100 (Mon, 30 Oct 2017)
New Revision: 11517

Added:
   code/branches/SOBv2_HS17/BlenderFilesSOB/
   code/branches/SOBv2_HS17/BlenderFilesSOB/orxo.png
   code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend
   code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend1
   code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend2
   code/branches/SOBv2_HS17/BlenderFilesSOB/orxo8.blend
   code/branches/SOBv2_HS17/BlenderFilesSOB/orxo_texturegross.xcf
Modified:
   code/branches/SOBv2_HS17/data/levels/SOB.oxw
   code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
   code/branches/SOBv2_HS17/src/orxonox/graphics/Model.cc
Log:
Started to implement change of clothes of figure after a power up.

Added: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo.png
===================================================================
(Binary files differ)

Index: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo.png
===================================================================
--- code/branches/SOBv2_HS17/BlenderFilesSOB/orxo.png	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/BlenderFilesSOB/orxo.png	2017-10-30 15:05:01 UTC (rev 11517)

Property changes on: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend
===================================================================
(Binary files differ)

Index: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend
===================================================================
--- code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend	2017-10-30 15:05:01 UTC (rev 11517)

Property changes on: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend1
===================================================================
(Binary files differ)

Index: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend1
===================================================================
--- code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend1	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend1	2017-10-30 15:05:01 UTC (rev 11517)

Property changes on: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend1
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend2
===================================================================
(Binary files differ)

Index: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend2
===================================================================
--- code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend2	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend2	2017-10-30 15:05:01 UTC (rev 11517)

Property changes on: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo7.blend2
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo8.blend
===================================================================
(Binary files differ)

Index: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo8.blend
===================================================================
--- code/branches/SOBv2_HS17/BlenderFilesSOB/orxo8.blend	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/BlenderFilesSOB/orxo8.blend	2017-10-30 15:05:01 UTC (rev 11517)

Property changes on: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo8.blend
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo_texturegross.xcf
===================================================================
(Binary files differ)

Index: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo_texturegross.xcf
===================================================================
--- code/branches/SOBv2_HS17/BlenderFilesSOB/orxo_texturegross.xcf	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/BlenderFilesSOB/orxo_texturegross.xcf	2017-10-30 15:05:01 UTC (rev 11517)

Property changes on: code/branches/SOBv2_HS17/BlenderFilesSOB/orxo_texturegross.xcf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: code/branches/SOBv2_HS17/data/levels/SOB.oxw
===================================================================
--- code/branches/SOBv2_HS17/data/levels/SOB.oxw	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/data/levels/SOB.oxw	2017-10-30 15:05:01 UTC (rev 11517)
@@ -47,7 +47,6 @@
 
 
 
-
 	<Template name=sobFigureTemplate>
 		<SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic" position="0,0,30">
 			<attached>
@@ -61,8 +60,13 @@
 
 
 		</SOBFigure>
-	</Template>
+	</Template> 
 
+
+
+
+
+
 	<Level
 		plugins = "superorxobros"
 		gametype = "SOB"

Modified: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc	2017-10-30 15:05:01 UTC (rev 11517)
@@ -64,6 +64,7 @@
         moveDownPressed_ = false;
         firePressed_ = false;
         collDisZ_ = 0;
+
         //Times and turning
         timeSinceLastFire_ = 0.0;
         lastSpeed_z = 0.0;
@@ -109,13 +110,19 @@
             SOBGame->addMushroom(); // Tell the gametype to increase points
             mush->hasCollided_ = true; // needed because of destroyLater takes some time and player should receive points only once
 
-            Vector3 scale = {1.2, 1.2, 1.2};
-            this->setScale3D(scale);
-            /*if (this->hasPhysics() && this->collisionShape_ != nullptr)
+
+            // now, change the clothes of the Figure to red
+            std::set<WorldEntity*> attachedObjects = this->getAttachedObjects();
+            std::set<WorldEntity*>::iterator it;
+            for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it)
             {
-             this->collisionShape_->setScale3D(scale);
-            }*/
-
+                Model* FiguresModel = orxonox_cast<Model*>(*it);
+                if (FiguresModel != nullptr)
+                {
+                    std::string name = "orxo_material_gross";
+                    FiguresModel->setMaterial(name);
+                }
+            }   
         }
         //Check if otherObject is a Gumba (that walking enemies)
 
@@ -135,13 +142,19 @@
                 } else{
                     gotPowerUp_ = false;
                     
-                    Vector3 scale = {1, 1, 1};
-                    this->setScale3D(scale);
-                    /*if (this->hasPhysics() && this->collisionShape_ != nullptr)
-                    {
-                     this->collisionShape_->setScale3D(scale);
-                    }*/
-
+                   // TODO: reset to old clothes of figure
+                       // now, change the clothes of the Figure to red
+            std::set<WorldEntity*> attachedObjects = this->getAttachedObjects();
+            std::set<WorldEntity*>::iterator it;
+            for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it)
+            {
+                Model* FiguresModel = orxonox_cast<Model*>(*it);
+                if (FiguresModel != nullptr)
+                {
+                    std::string name = "orxo_material";
+                    FiguresModel->setMaterial(name);
+                }
+            }  
                     gumba->destroyLater();
                     gumba->hasCollided_ = true;
                 }
@@ -268,7 +281,9 @@
 
 
         //If player hits space and collides against an object under him then jump
-        if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 7.75 && collDisZ_ <+ 8.25)) {
+        if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 0 && collDisZ_ <+ 10)) {
+        //if (inputAllowed && firePressed_ && isColliding_ ) {
+
             gravityAcceleration_ = 100.0;
             velocity.z = 110; 
         }

Modified: code/branches/SOBv2_HS17/src/orxonox/graphics/Model.cc
===================================================================
--- code/branches/SOBv2_HS17/src/orxonox/graphics/Model.cc	2017-10-30 15:04:29 UTC (rev 11516)
+++ code/branches/SOBv2_HS17/src/orxonox/graphics/Model.cc	2017-10-30 15:05:01 UTC (rev 11517)
@@ -40,6 +40,7 @@
 #include "graphics/MeshLodInformation.h"
 #include "Level.h"
 
+
 namespace orxonox
 {
     RegisterClass(Model);
@@ -155,6 +156,7 @@
         this->mesh_.setMaterial(this->materialName_);
     }
 
+
     void Model::changedShadows()
     {
         this->mesh_.setCastShadows(this->bCastShadows_);



More information about the Orxonox-commit mailing list