Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 28, 2009, 2:38:10 PM (15 years ago)
Author:
wirthmi
Message:

Added a crosshair overlay.

Location:
code/branches/steering/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/steering/src/orxonox/controllers/NewHumanController.cc

    r5993 r6001  
    5252    {
    5353        RegisterObject(NewHumanController);
     54
     55        CrossHairOverlay = new OrxonoxOverlay(this);
     56        CrossHairOverlay->setBackgroundMaterial("Orxonox/Crosshair3");
     57        CrossHairOverlay->setSize(Vector2(0.08,0.08));
     58        CrossHairOverlay->show();
    5459    }
    5560
     
    5964        {
    6065        }
     66    }
     67
     68    void NewHumanController::tick(float dt) {
     69        CrossHairOverlay->setPosition(Vector2(static_cast<float>(this->currentYaw_), static_cast<float>(this->currentPitch_)));
     70
     71        HumanController::tick(dt);
    6172    }
    6273
     
    8394       
    8495        this->currentYaw_ = value.x;
    85         std::cout << "X: " << static_cast<float>(this->currentPitch_) << " Y: " << static_cast<float>(this->currentYaw_) << endl;
     96        std::cout << "Y: " << static_cast<float>(this->currentPitch_) << " X: " << static_cast<float>(this->currentYaw_) << endl;
    8697    }
    8798    void NewHumanController::pitch(const Vector2& value)
     
    91102       
    92103        this->currentPitch_ = value.x;
    93         std::cout << "X: " << static_cast<float>(this->currentPitch_) << " Y: " << static_cast<float>(this->currentYaw_) << endl;
     104        std::cout << "Y: " << static_cast<float>(this->currentPitch_) << " X: " << static_cast<float>(this->currentYaw_) << endl;
    94105    }
    95106
  • code/branches/steering/src/orxonox/controllers/NewHumanController.h

    r5993 r6001  
    3333
    3434#include "HumanController.h"
     35#include "overlays/OrxonoxOverlay.h"
    3536
    3637namespace orxonox
     
    4243            virtual ~NewHumanController();
    4344
    44 //             virtual void tick(float dt);
     45            virtual void tick(float dt);
    4546           
    4647            virtual void yaw(const Vector2& value);
     
    5051            float                       currentYaw_;
    5152            float                       currentPitch_;
     53            OrxonoxOverlay              *CrossHairOverlay;
    5254    };
    5355}
Note: See TracChangeset for help on using the changeset viewer.