Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2017, 4:05:01 PM (7 years ago)
Author:
varxth
Message:

Started to implement change of clothes of figure after a power up.

Location:
code/branches/SOBv2_HS17
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SOBv2_HS17/data/levels/SOB.oxw

    r11449 r11517  
    4848
    4949
    50 
    5150        <Template name=sobFigureTemplate>
    5251                <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic" position="0,0,30">
     
    6261
    6362                </SOBFigure>
    64         </Template>
     63        </Template>
     64
     65
     66
     67
     68
    6569
    6670        <Level
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc

    r11491 r11517  
    6565        firePressed_ = false;
    6666        collDisZ_ = 0;
     67
    6768        //Times and turning
    6869        timeSinceLastFire_ = 0.0;
     
    110111            mush->hasCollided_ = true; // needed because of destroyLater takes some time and player should receive points only once
    111112
    112             Vector3 scale = {1.2, 1.2, 1.2};
    113             this->setScale3D(scale);
    114             /*if (this->hasPhysics() && this->collisionShape_ != nullptr)
     113
     114            // now, change the clothes of the Figure to red
     115            std::set<WorldEntity*> attachedObjects = this->getAttachedObjects();
     116            std::set<WorldEntity*>::iterator it;
     117            for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it)
    115118            {
    116              this->collisionShape_->setScale3D(scale);
    117             }*/
    118 
     119                Model* FiguresModel = orxonox_cast<Model*>(*it);
     120                if (FiguresModel != nullptr)
     121                {
     122                    std::string name = "orxo_material_gross";
     123                    FiguresModel->setMaterial(name);
     124                }
     125            }   
    119126        }
    120127        //Check if otherObject is a Gumba (that walking enemies)
     
    136143                    gotPowerUp_ = false;
    137144                   
    138                     Vector3 scale = {1, 1, 1};
    139                     this->setScale3D(scale);
    140                     /*if (this->hasPhysics() && this->collisionShape_ != nullptr)
    141                     {
    142                      this->collisionShape_->setScale3D(scale);
    143                     }*/
    144 
     145                   // TODO: reset to old clothes of figure
     146                       // now, change the clothes of the Figure to red
     147            std::set<WorldEntity*> attachedObjects = this->getAttachedObjects();
     148            std::set<WorldEntity*>::iterator it;
     149            for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it)
     150            {
     151                Model* FiguresModel = orxonox_cast<Model*>(*it);
     152                if (FiguresModel != nullptr)
     153                {
     154                    std::string name = "orxo_material";
     155                    FiguresModel->setMaterial(name);
     156                }
     157            } 
    145158                    gumba->destroyLater();
    146159                    gumba->hasCollided_ = true;
     
    269282
    270283        //If player hits space and collides against an object under him then jump
    271         if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 7.75 && collDisZ_ <+ 8.25)) {
     284        if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 0 && collDisZ_ <+ 10)) {
     285        //if (inputAllowed && firePressed_ && isColliding_ ) {
     286
    272287            gravityAcceleration_ = 100.0;
    273288            velocity.z = 110;
  • code/branches/SOBv2_HS17/src/orxonox/graphics/Model.cc

    r11080 r11517  
    4040#include "graphics/MeshLodInformation.h"
    4141#include "Level.h"
     42
    4243
    4344namespace orxonox
     
    155156        this->mesh_.setMaterial(this->materialName_);
    156157    }
     158
    157159
    158160    void Model::changedShadows()
Note: See TracChangeset for help on using the changeset viewer.