Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11577


Ignore:
Timestamp:
Nov 20, 2017, 4:05:27 PM (7 years ago)
Author:
zarron
Message:

first atempt to set dir of fireballs correctly

Location:
code/branches/SOBv2_HS17/src/modules/superorxobros
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc

    r11575 r11577  
    3939#include "graphics/Camera.h"
    4040#include "graphics/ParticleSpawner.h"
     41#include <OgreMath.h>
    4142
    4243#include "SOBMushroom.h"
     
    156157
    157158        else if (fireball != nullptr && !(fireball->hasCollided_)){
    158             this-> die();
     159            //this-> die();
    159160        }
    160161
     
    197198            ball->addTemplate("fireball");
    198199            ball->setPosition(spawnpos);
    199            
     200            bool direction = ((this->getWorldOrientation().getRoll().valueRadians())>-1.6&&(this->getWorldOrientation().getRoll().valueRadians()<1.6));
     201            ball->setDirection(direction);
     202            orxout() << "Rotation: " << this->getWorldOrientation().getRoll() << " direction: "<< direction <<endl;
     203            //ball->
     204
    200205        }
    201206     }
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc

    r11575 r11577  
    7979
    8080
     81    }
     82
     83    void SOBFireball::setDirection(const bool direction)
     84    {
     85        if(direction)
     86        {
     87            goesRight_=true;
     88        }
     89        else
     90        {
     91            goesRight_=false;
     92        }
    8193    }
    8294
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h

    r11575 r11577  
    5353            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    5454            virtual void tick(float dt) override;
    55 
     55            void setDirection(const bool direction);
    5656         
    5757            bool attachedToFigure_;
Note: See TracChangeset for help on using the changeset viewer.