Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc @ 6316

Last change on this file since 6316 was 6316, checked in by scheusso, 14 years ago

fixed NHC behaviour in rocket mode

  • Property svn:eol-style set to native
File size: 23.6 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Michael Wirth
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#include "NewHumanController.h"
30
31#include <cmath>
32#include <OgreRay.h>
33#include <OgreSceneQuery.h>
34#include <OgreCamera.h>
35#include <OgreSceneManager.h>
36
37#include "core/CoreIncludes.h"
38#include "core/ConsoleCommand.h"
39#include "worldentities/ControllableEntity.h"
40#include "worldentities/pawns/Pawn.h"
41#include "infos/PlayerInfo.h"
42#include "overlays/OrxonoxOverlay.h"
43#include "graphics/Camera.h"
44#include "sound/SoundManager.h"
45#include "Scene.h"
46#include "tools/BulletConversions.h"
47#include "bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
48
49namespace orxonox
50{
51    SetConsoleCommand(NewHumanController, changeMode,          false).keybindMode(KeybindMode::OnPress);
52    SetConsoleCommand(NewHumanController, accelerate,          false).keybindMode(KeybindMode::OnPress);
53    SetConsoleCommand(NewHumanController, decelerate,          false).keybindMode(KeybindMode::OnPress);
54    SetConsoleCommand(NewHumanController, unfire,              true).keybindMode(KeybindMode::OnRelease);
55
56    CreateUnloadableFactory(NewHumanController);
57
58    NewHumanController* NewHumanController::localController_s = 0;
59
60    NewHumanController::NewHumanController(BaseObject* creator)
61        : HumanController(creator)
62        , crossHairOverlay_(NULL)
63        , centerOverlay_(NULL)
64    {
65        RegisterObject(NewHumanController);
66
67        overlaySize_ = 0.08;
68        arrowsSize_ = 0.4;
69
70        damageOverlayTime_ = 0.6;
71
72        controlMode_ = 0;
73        acceleration_ = 0;
74        accelerating_ = false;
75        firemode_ = -1;
76
77        showArrows_ = true;
78        showOverlays_ = false;
79        showDamageOverlay_ = true;
80
81        //currentPitch_ = 1;
82        //currentYaw_ = 1;
83
84        if (GameMode::showsGraphics())
85        {
86            crossHairOverlay_ = new OrxonoxOverlay(this);
87            crossHairOverlay_->setBackgroundMaterial("Orxonox/Crosshair3");
88            crossHairOverlay_->setSize(Vector2(overlaySize_, overlaySize_));
89            crossHairOverlay_->hide();
90            //crossHairOverlay_->setAspectCorrection(true); not working
91
92            centerOverlay_ = new OrxonoxOverlay(this);
93            centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay");
94            centerOverlay_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
95            centerOverlay_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
96            centerOverlay_->hide();
97
98            if ( showDamageOverlay_ )
99            {
100                damageOverlayTop_ = new OrxonoxOverlay(this);
101                damageOverlayTop_->setBackgroundMaterial("Orxonox/DamageOverlayTop");
102                damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
103                damageOverlayTop_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
104                damageOverlayTop_->hide();
105
106                damageOverlayRight_ = new OrxonoxOverlay(this);
107                damageOverlayRight_->setBackgroundMaterial("Orxonox/DamageOverlayRight");
108                damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
109                damageOverlayRight_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
110                damageOverlayRight_->hide();
111
112                damageOverlayBottom_ = new OrxonoxOverlay(this);
113                damageOverlayBottom_->setBackgroundMaterial("Orxonox/DamageOverlayBottom");
114                damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
115                damageOverlayBottom_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
116                damageOverlayBottom_->hide();
117
118                damageOverlayLeft_ = new OrxonoxOverlay(this);
119                damageOverlayLeft_->setBackgroundMaterial("Orxonox/DamageOverlayLeft");
120                damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
121                damageOverlayLeft_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
122                damageOverlayLeft_->hide();
123            }
124
125            if ( showArrows_ )
126            {
127                arrowsOverlay1_ = new OrxonoxOverlay(this);
128                arrowsOverlay1_->setBackgroundMaterial("Orxonox/DirectionArrows1");
129                arrowsOverlay1_->setSize(Vector2(0.02727, 0.36 * arrowsSize_));
130                arrowsOverlay1_->setPickPoint(Vector2(0.5, 0.5));
131                arrowsOverlay1_->setPosition(Vector2(0.5, 0.5));
132                arrowsOverlay1_->hide();
133   
134                arrowsOverlay2_ = new OrxonoxOverlay(this);
135                arrowsOverlay2_->setBackgroundMaterial("Orxonox/DirectionArrows2");
136                arrowsOverlay2_->setSize(Vector2(0.02727, 0.59 * arrowsSize_));
137                arrowsOverlay2_->setPickPoint(Vector2(0.5, 0.5));
138                arrowsOverlay2_->setPosition(Vector2(0.5, 0.5));
139                arrowsOverlay2_->hide();
140   
141                arrowsOverlay3_ = new OrxonoxOverlay(this);
142                arrowsOverlay3_->setBackgroundMaterial("Orxonox/DirectionArrows3");
143                arrowsOverlay3_->setSize(Vector2(0.02727, 0.77 * arrowsSize_));
144                arrowsOverlay3_->setPickPoint(Vector2(0.5, 0.5));
145                arrowsOverlay3_->setPosition(Vector2(0.5, 0.5));
146                arrowsOverlay3_->hide();
147   
148                arrowsOverlay4_ = new OrxonoxOverlay(this);
149                arrowsOverlay4_->setBackgroundMaterial("Orxonox/DirectionArrows4");
150                arrowsOverlay4_->setSize(Vector2(0.02727, arrowsSize_));
151                arrowsOverlay4_->setPickPoint(Vector2(0.5, 0.5));
152                arrowsOverlay4_->setPosition(Vector2(0.5, 0.5));
153                arrowsOverlay4_->hide();
154            }
155        }
156
157        // HACK: Define which objects are targetable when considering the creator of an orxonox::Model
158        this->targetMask_.exclude(ClassByString("BaseObject"));
159        this->targetMask_.include(ClassByString("WorldEntity"));
160        this->targetMask_.exclude(ClassByString("Projectile"));
161
162        NewHumanController::localController_s = this;
163
164        controlPaused_ = false;
165
166//HumanController::localController_s->getControllableEntity()->getCamera()->setDrag(true);
167    }
168
169    NewHumanController::~NewHumanController()
170    {
171        if (this->isInitialized())
172        {
173            if (this->crossHairOverlay_)
174                this->crossHairOverlay_->destroy();
175            if (this->centerOverlay_)
176                this->centerOverlay_->destroy();
177
178            if (showArrows_)
179            {
180                if (this->arrowsOverlay1_)
181                    this->arrowsOverlay1_->destroy();
182                if (this->arrowsOverlay2_)
183                    this->arrowsOverlay2_->destroy();
184                if (this->arrowsOverlay3_)
185                    this->arrowsOverlay3_->destroy();
186                if (this->arrowsOverlay4_)
187                    this->arrowsOverlay4_->destroy();
188            }
189        }
190    }
191
192    void NewHumanController::tick(float dt)
193    {
194        if (GameMode::showsGraphics())
195        {
196
197            if( this->controllableEntity_ && !this->controllableEntity_->isInMouseLook() )
198            {
199                this->updateTarget();
200
201                if ( !controlPaused_ ) {
202                    if (this->getControllableEntity() && (this->getControllableEntity()->getIdentifier()->getName() == "SpaceShip" || this->getControllableEntity()->getIdentifier()->getName() == "Rocket"))
203                        this->showOverlays();
204
205                    this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));
206
207                    if ( this->controlMode_ == 0 || ( this->controlMode_ == 1 && this->firemode_ == 1 ) )
208                    {
209                        if ( this->showOverlays_ && this->showArrows_)
210                            alignArrows();
211                    }
212                    else
213                        hideArrows();
214
215                    if ( this->showDamageOverlay_ && ( this->damageOverlayTT_ > 0 || this->damageOverlayTR_ > 0 || this->damageOverlayTB_ > 0 || this->damageOverlayTL_ > 0 ) ) {
216                        this->damageOverlayTT_ -= dt;
217                        this->damageOverlayTR_ -= dt;
218                        this->damageOverlayTB_ -= dt;
219                        this->damageOverlayTL_ -= dt;
220                        if ( this->damageOverlayTT_ <= 0 )
221                            this->damageOverlayTop_->hide();
222                        if ( this->damageOverlayTR_ <= 0 )
223                            this->damageOverlayRight_->hide();
224                        if ( this->damageOverlayTB_ <= 0 )
225                            this->damageOverlayBottom_->hide();
226                        if ( this->damageOverlayTL_ <= 0 )
227                            this->damageOverlayLeft_->hide();
228                    }
229                }
230            }
231            else
232                this->hideOverlays();
233
234            if ( this->acceleration_ > 0 )
235            {
236/*
237if (this->controllableEntity_ && this->controllableEntity_->getEngine()) {
238    std::cout << this->controllableEntity_->getEngine()->getAccelerationFront() << endl;
239}
240*/
241                if ( this->accelerating_ )
242                    HumanController::moveFrontBack(Vector2(1, 0));
243                else
244                    HumanController::moveFrontBack(Vector2(this->acceleration_, 0)); 
245                this->accelerating_ = false;
246                //HumanController::moveFrontBack(Vector2(clamp(this->acceleration_ + this->currentAcceleration_, 0.0f, 1.0f), 0));
247            }
248        }
249
250        HumanController::tick(dt);
251    }
252
253    /*void NewHumanController::tick(float dt)
254    {
255        if (GameMode::playsSound() && NewHumanController::localController_s && NewHumanController::localController_s->controllableEntity_)
256        {
257            // Update sound listener
258            Camera* camera = NewHumanController::localController_s->controllableEntity_->getCamera();
259            if (camera)
260            {
261                SoundManager::getInstance().setListenerPosition(camera->getWorldPosition());
262                SoundManager::getInstance().setListenerOrientation(camera->getWorldOrientation());
263            }
264            else
265                COUT(3) << "NewHumanController, Warning: Using a ControllableEntity without Camera" << std::endl;
266        }
267    }*/
268   
269    void NewHumanController::doFire(unsigned int firemode)
270    {
271        if ( !this->controllableEntity_ )
272            return;
273        //if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) {
274
275/*
276        // Get results, create a node/entity on the position
277        for ( itr = result.begin(); itr != result.end(); itr++ )
278        {
279            if (itr->movable && itr->movable->getName() == "Head")
280            {
281                soundMgr->StopSound( &jaguarSoundChannel );
282                soundMgr->PlaySound( jaguarSound, headNode, &jaguarSoundChannel );
283                break;
284            } // if
285        }
286*/
287
288        this->firemode_ = firemode;
289
290        if (firemode == 1 && this->controlMode_ == 1)
291        {
292            //unlocked steering, steer on right mouse click
293            HumanController::yaw(Vector2(this->currentYaw_, 0));
294            HumanController::pitch(Vector2(this->currentPitch_, 0));
295        }
296        else
297            HumanController::localController_s->getControllableEntity()->fire(firemode);
298
299    }
300
301    void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {
302        if ( this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook() ) {
303            Vector3 posA;
304            if ( originator )
305                posA = originator->getWorldPosition();
306            else
307                posA = multi_cast<Vector3>(contactpoint.getPositionWorldOnA());
308            //Vector3 posB = multi_cast<Vector3>(contactpoint.getPositionWorldOnB());
309            //posA and posB are almost identical
310
311            Vector3 relativeHit = this->getControllableEntity()->getWorldOrientation().UnitInverse() * (this->getControllableEntity()->getWorldPosition() - posA);
312
313            //back is z positive
314            //x is left positive
315            //y is down positive
316            relativeHit.normalise();
317            COUT(0) << relativeHit << endl;
318
319            float threshold = 0.3;
320            // && abs(relativeHit.y) < 0.5
321            if ( relativeHit.x > threshold) // Left
322            {
323                this->damageOverlayLeft_->show();
324                this->damageOverlayTL_ = this->damageOverlayTime_;
325                //this->damageOverlayLeft_->setBackgroundAlpha(0.3);
326            }
327            if ( relativeHit.x < -threshold) //Right
328            {
329                this->damageOverlayRight_->show();
330                this->damageOverlayTR_ = this->damageOverlayTime_;
331                //this->damageOverlayRight_->setBackgroundAlpha(0.3);
332            }
333            if ( relativeHit.y > threshold) //Top
334            {
335                this->damageOverlayBottom_->show();
336                this->damageOverlayTB_ = this->damageOverlayTime_;
337                //this->damageOverlayTop_->setBackgroundAlpha(0.3);
338            }
339            if ( relativeHit.y < -threshold) //Bottom
340            {
341                this->damageOverlayTop_->show();
342                this->damageOverlayTT_ = this->damageOverlayTime_;
343                //this->damageOverlayBottom_->setBackgroundAlpha(0.3);
344            }
345
346        }
347    }
348
349    void NewHumanController::unfire()
350    {
351        if (NewHumanController::localController_s)
352            NewHumanController::localController_s->doUnfire();
353    }
354
355    void NewHumanController::doUnfire()
356    {
357        this->firemode_ = -1;
358        hideArrows();
359    }
360
361    void NewHumanController::updateTarget()
362    {
363        Ogre::RaySceneQuery * rsq = HumanController::localController_s->getControllableEntity()->getScene()->getSceneManager()->createRayQuery(Ogre::Ray());
364
365        Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getOgreCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5, static_cast<float>(this->currentPitch_)/2*-1+.5);
366
367        rsq->setRay(mouseRay);
368        rsq->setSortByDistance(true);
369
370        /*
371        Distance of objects:
372        ignore everything under 200 maybe even take 1000 as min distance to shoot at
373
374        shots are regularly traced and are entities!!!!!!!!! this is the biggest problem
375        they vanish only after a distance of 10'000
376        */
377
378
379        Ogre::RaySceneQueryResult& result = rsq->execute();
380        Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
381
382        Ogre::RaySceneQueryResult::iterator itr;
383        for (itr = result.begin(); itr != result.end(); ++itr)
384        {
385            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 500)
386            {
387                // Try to cast the user pointer
388                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(itr->movable->getUserObject());
389                if (wePtr)
390                {
391                    // go through all parents of object and look wheter they are Sightable or not
392                    bool isSightable = false;
393                    WorldEntity* parent = wePtr->getParent();
394                    while( parent )
395                    {
396                        if (this->targetMask_.isExcluded(parent->getIdentifier()))
397                        {
398                            parent = parent->getParent();
399                            continue;
400                        }
401                        else
402                        {
403                            isSightable = true;
404                            break;
405                        }
406                    }
407                    if ( !isSightable )
408                        continue;
409                }
410
411                if ( this->getControllableEntity() && this->getControllableEntity()->getTarget() != wePtr )
412                {
413                    this->getControllableEntity()->setTarget(wePtr);
414                }
415
416                if( pawn )
417                {
418                    pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance );
419                }
420
421                //itr->movable->getParentSceneNode()->showBoundingBox(true);
422                //std::cout << itr->movable->getParentSceneNode()->_getDerivedPosition() << endl;
423                //return mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance; //or itr->movable->getParentSceneNode()->_getDerivedPosition()
424                return;
425            }
426
427        }
428        if ( pawn )
429        {
430            pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * 1200 );
431        }
432
433        if( this->getControllableEntity() && this->getControllableEntity()->getTarget() != 0 )
434            this->getControllableEntity()->setTarget( 0 );
435   
436
437        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getWorldOrientation() * Vector3::NEGATIVE_UNIT_Z * 2000);
438        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getCamera()->getOgreCamera()->getOrientation() * Vector3::NEGATIVE_UNIT_Z);
439    }
440
441    void NewHumanController::frontback(const Vector2& value)
442    {
443        this->accelerating_ = true;
444
445        //if (this->acceleration_ == 0)
446            HumanController::frontback(value);
447    }
448
449    void NewHumanController::yaw(const Vector2& value)
450    {
451//         SUPER(NewHumanController, yaw, value);
452        if (this->controlMode_ == 0 || ( this->controllableEntity_ && this->controllableEntity_->isInMouseLook() ) )
453            HumanController::yaw(value);
454
455        this->currentYaw_ = value.x;
456    }
457
458    void NewHumanController::pitch(const Vector2& value)
459    {
460//         SUPER(NewHumanController, pitch, value);
461        if (this->controlMode_ == 0 || ( this->controllableEntity_ && this->controllableEntity_->isInMouseLook() ) )
462            HumanController::pitch(value);
463
464        this->currentPitch_ = value.x;
465    }
466
467    void NewHumanController::changeMode()
468    {
469        if (NewHumanController::localController_s && NewHumanController::localController_s->controlMode_ == 0)
470        {
471                NewHumanController::localController_s->controlMode_ = 1;
472                NewHumanController::localController_s->hideArrows();
473        }
474        else
475            NewHumanController::localController_s->controlMode_ = 0;
476    }
477
478    void NewHumanController::changedControllableEntity()
479    {
480        if( this->getControllableEntity() )
481            CCOUT(0) << "changed controllable entity to: " << this->getControllableEntity()->getIdentifier()->getName() << endl;
482        else
483            CCOUT(0) << "changed controllable entity to: " << this->getControllableEntity() << endl;
484        this->controlMode_ = 0;
485        this->currentYaw_ = 0;
486        this->currentPitch_ = 0;
487        if (this->getControllableEntity() && ( this->getControllableEntity()->getIdentifier()->getName() == "SpaceShip" || this->getControllableEntity()->getIdentifier()->getName() == "Rocket" ))
488        {
489            this->showOverlays_ = true;
490            if( !this->controlPaused_ )
491            {
492                this->showOverlays();
493                this->alignArrows();
494            }
495        }
496        else
497        {
498            this->showOverlays_ = false;
499            this->hideOverlays();
500        }
501    }
502
503    void NewHumanController::accelerate()
504    {
505        if ( NewHumanController::localController_s )
506        {
507            NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ + 0.2f, 0.00f, 1.0f);
508        }
509    }
510
511    void NewHumanController::decelerate()
512    {
513        if ( NewHumanController::localController_s )
514        {
515            NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ - 0.1f, 0.0f, 1.0f);
516        }
517    }
518
519    void NewHumanController::doResumeControl() {
520        this->controlPaused_ = false;
521        if( this->showOverlays_ ) {
522            this->showOverlays();
523        }
524    }
525
526    void NewHumanController::doPauseControl() {
527        this->controlPaused_ = true;
528        COUT(0) << "pause control" << endl;
529        this->hideOverlays();
530    }
531
532    void NewHumanController::alignArrows() {
533        if (showArrows_) {
534            hideArrows();
535   
536            float distance = sqrt(pow(static_cast<float>(this->currentYaw_)/2*-1,2) + pow(static_cast<float>(this->currentPitch_)/2*-1,2));
537   
538            if ( distance > 0.04 && distance <= 0.59 * arrowsSize_ / 2.0 ) {
539                this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
540   
541                this->arrowsOverlay1_->show();
542            }
543            else if ( distance > 0.59 * arrowsSize_ / 2.0 && distance <= 0.77 * arrowsSize_ / 2.0 ) {
544                this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
545   
546                this->arrowsOverlay2_->show();
547            }
548            else if ( distance > 0.77 * arrowsSize_ / 2.0 && distance <= arrowsSize_ / 2.0 ) {
549                this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
550   
551                this->arrowsOverlay3_->show();
552            }
553            else if ( distance > arrowsSize_ / 2.0 ) {
554                this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
555   
556                this->arrowsOverlay4_->show();
557            }
558        }
559    }
560
561    void NewHumanController::showOverlays() {
562        this->crossHairOverlay_->show();
563        this->centerOverlay_->show();
564
565        if (showArrows_) {
566            this->arrowsOverlay1_->show();
567            this->arrowsOverlay2_->show();
568            this->arrowsOverlay3_->show();
569            this->arrowsOverlay4_->show();
570        }
571    }
572
573    void NewHumanController::hideOverlays() {
574        this->crossHairOverlay_->hide();
575        this->centerOverlay_->hide();
576
577        if ( showDamageOverlay_ ) {
578            this->damageOverlayTop_->hide();
579            this->damageOverlayRight_->hide();
580            this->damageOverlayBottom_->hide();
581            this->damageOverlayLeft_->hide();
582        }
583
584        this->hideArrows();
585    }
586
587    void NewHumanController::hideArrows() {
588        if (showArrows_) {
589            this->arrowsOverlay1_->hide();
590            this->arrowsOverlay2_->hide();
591            this->arrowsOverlay3_->hide();
592            this->arrowsOverlay4_->hide();
593        }
594    }
595}
Note: See TracBrowser for help on using the repository browser.