Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (14 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/controllers/HumanController.cc

    r5929 r6417  
    3636#include "infos/PlayerInfo.h"
    3737#include "overlays/Map.h"
    38 #include "graphics/Camera.h"
    39 #include "sound/SoundManager.h"
    4038#include "Radar.h"
    4139#include "Scene.h"
     
    5654    SetConsoleCommand(HumanController, mouseLook,     true);
    5755    SetConsoleCommand(HumanController, suicide,       true);
     56    SetConsoleCommand(HumanController, toggleGodMode, true);
    5857    SetConsoleCommand(HumanController, addBots,       true).defaultValues(1);
    5958    SetConsoleCommand(HumanController, killBots,      true).defaultValues(0);
     
    7170        RegisterObject(HumanController);
    7271
     72        controlPaused_ = false;
     73
    7374        HumanController::localController_s = this;
    7475    }
     
    8384        if (GameMode::playsSound() && HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    8485        {
    85             // Update sound listener
    8686            Camera* camera = HumanController::localController_s->controllableEntity_->getCamera();
    87             if (camera)
    88             {
    89                 SoundManager::getInstance().setListenerPosition(camera->getWorldPosition());
    90                 SoundManager::getInstance().setListenerOrientation(camera->getWorldOrientation());
    91             }
    92             else
     87            if (!camera)
    9388                COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl;
    9489        }
     
    9792    void HumanController::moveFrontBack(const Vector2& value)
    9893    {
     94        if (HumanController::localController_s)
     95            HumanController::localController_s->frontback(value);
     96    }
     97
     98    void HumanController::frontback(const Vector2& value)
     99    {
    99100        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    100101            HumanController::localController_s->controllableEntity_->moveFrontBack(value);
     
    113114    }
    114115
    115     void HumanController::rotateYaw(const Vector2& value)
     116    void HumanController::yaw(const Vector2& value)
    116117    {
    117118        //Hack to enable mouselook in map
     
    125126    }
    126127
    127     void HumanController::rotatePitch(const Vector2& value)
     128    void HumanController::pitch(const Vector2& value)
    128129    {
    129130        //Hack to enable mouselook in map
     
    137138    }
    138139
     140    void HumanController::rotateYaw(const Vector2& value)
     141    {
     142        if (HumanController::localController_s)
     143            HumanController::localController_s->yaw(value);
     144    }
     145
     146    void HumanController::rotatePitch(const Vector2& value)
     147    {
     148        if (HumanController::localController_s)
     149            HumanController::localController_s->pitch(value);
     150    }
     151
    139152    void HumanController::rotateRoll(const Vector2& value)
    140153    {
     
    144157
    145158    void HumanController::fire(unsigned int firemode)
     159    {
     160        if (HumanController::localController_s)
     161            HumanController::localController_s->doFire(firemode);
     162    }
     163
     164    void HumanController::doFire(unsigned int firemode)
    146165    {
    147166        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
     
    191210    }
    192211
     212    void HumanController::toggleGodMode()
     213    {
     214        HumanController::getLocalControllerSingleton()->setGodMode( !HumanController::getLocalControllerSingleton()->getGodMode() );
     215    }
     216
    193217    void HumanController::useItem()
    194218    {
     
    234258            HumanController::localController_s->controllableEntity_->getScene()->getRadar()->releaseFocus();
    235259    }
     260
     261    void HumanController::pauseControl()
     262    {
     263        if (HumanController::localController_s)
     264            HumanController::localController_s->doPauseControl();
     265    }
     266
     267    void HumanController::resumeControl()
     268    {
     269        if (HumanController::localController_s)
     270            HumanController::localController_s->doResumeControl();
     271    }
    236272}
Note: See TracChangeset for help on using the changeset viewer.