Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Added a crosshair overlay.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.