[Orxonox-commit 7017] r11636 - code/branches/CampaignMap_HS17/src/orxonox/controllers
fanconic at orxonox.net
fanconic at orxonox.net
Mon Dec 4 16:15:59 CET 2017
Author: fanconic
Date: 2017-12-04 16:15:59 +0100 (Mon, 04 Dec 2017)
New Revision: 11636
Removed:
code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.cc
code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.h
Log:
Camera can now move freely, with mpressing the arrows.
Deleted: code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.cc
===================================================================
--- code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.cc 2017-12-04 15:13:24 UTC (rev 11635)
+++ code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.cc 2017-12-04 15:15:59 UTC (rev 11636)
@@ -1,159 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Fabian 'x3n' Landau
- * Co-authors:
- * ...
- *
- */
-
-#include "StoryModeController.h"
-
-#include "core/CoreIncludes.h"
-#include "core/command/ConsoleCommandIncludes.h"
-#include "worldentities/ControllableEntity.h"
-#include "worldentities/pawns/Pawn.h"
-#include "gametypes/Gametype.h"
-#include "infos/PlayerInfo.h"
-#include "Radar.h"
-#include "Scene.h"
-
-namespace orxonox
-{
- extern const std::string __CC_fire_name = "fire";
- extern const std::string __CC_suicide_name = "suicide";
-
- SetConsoleCommand("StoryModeController", "moveFrontBack", &StoryModeController::moveFrontBack ).addShortcut().setAsInputCommand();
- SetConsoleCommand("StoryModeController", "moveRightLeft", &StoryModeController::moveRightLeft ).addShortcut().setAsInputCommand();
- SetConsoleCommand("StoryModeController", "moveUpDown", &StoryModeController::moveUpDown ).addShortcut().setAsInputCommand();
- SetConsoleCommand("StoryModeController", "myposition", &StoryModeController::myposition ).addShortcut();
-
- RegisterUnloadableClass(StoryModeController);
-
- StoryModeController* StoryModeController::localController_s = nullptr;
-
- StoryModeController::StoryModeController(Context* context) : FormationController(context)
- {
- RegisterObject(StoryModeController);
-
- this->controlPaused_ = false;
- StoryModeController::localController_s = this;
- }
-
- StoryModeController::~StoryModeController()
- {
- if (StoryModeController::localController_s)
- {
- StoryModeController::localController_s->removeFromFormation();
- }
- StoryModeController::localController_s = nullptr;
- }
-
- void StoryModeController::tick(float dt)
- {
- if (GameMode::playsSound() && StoryModeController::localController_s && StoryModeController::localController_s->controllableEntity_)
- {
- Camera* camera = StoryModeController::localController_s->controllableEntity_->getCamera();
- if (!camera)
- orxout(internal_warning) << "StoryModeController, Warning: Using a ControllableEntity without Camera" << endl;
- }
-
- // commandslaves when Master of a formation
- if (StoryModeController::localController_s && StoryModeController::localController_s->state_==MASTER && FormationController::slaves_.size() > 0)
- {
- if (StoryModeController::localController_s->formationMode_ != ATTACK)
- StoryModeController::localController_s->commandSlaves();
- }
- }
-
- void StoryModeController::moveFrontBack(const Vector2& value)
- {
- if (StoryModeController::localController_s)
- StoryModeController::localController_s->frontback(value);
- }
-
-
- void StoryModeController::moveRightLeft(const Vector2& value)
- {
- if (StoryModeController::localController_s && StoryModeController::localController_s->controllableEntity_)
- StoryModeController::localController_s->controllableEntity_->moveRightLeft(value);
- }
-
- void StoryModeController::moveUpDown(const Vector2& value)
- {
- if (StoryModeController::localController_s && StoryModeController::localController_s->controllableEntity_)
- StoryModeController::localController_s->controllableEntity_->moveUpDown(value);
- }
-
- void StoryModeController::fire(unsigned int firemode)
- {
- if (StoryModeController::localController_s)
- StoryModeController::localController_s->doFire(firemode);
- }
-
- void StoryModeController::doFire(unsigned int firemode)
- {
- if (StoryModeController::localController_s && StoryModeController::localController_s->controllableEntity_)
- {
- StoryModeController::localController_s->controllableEntity_->fire(firemode);
- //if human fires, set slaves free. See FormationController::forceFreeSlaves()
- if (StoryModeController::localController_s->state_==MASTER && StoryModeController::localController_s->formationMode_ == NORMAL)
- {
- StoryModeController::localController_s->forceFreeSlaves();
- }
- }
- }
-
-
- void StoryModeController::myposition()
- {
- if (StoryModeController::localController_s && StoryModeController::localController_s->controllableEntity_)
- {
- const Vector3& position = StoryModeController::localController_s->controllableEntity_->getPosition();
- const Quaternion& orientation = StoryModeController::localController_s->controllableEntity_->getOrientation();
-
- orxout(message) << "position=\"" << position.x << ", " << position.y << ", " << position.z << "\" "
- << "orientation=\"" << orientation.w << ", " << orientation.x << ", " << orientation.y << ", " << orientation.z << "\"" << endl;
- }
- }
-
-
- Pawn* StoryModeController::getLocalControllerEntityAsPawn()
- {
- if (StoryModeController::localController_s)
- return orxonox_cast<Pawn*>(StoryModeController::localController_s->getControllableEntity());
- else
- return nullptr;
- }
-
- void StoryModeController::pauseControl()
- {
- if (StoryModeController::localController_s)
- StoryModeController::localController_s->doPauseControl();
- }
-
- void NewStoryModeController::doPauseControl()
- {
- this->controlPaused_ = true;
- this->hideOverlays();
- }
-}
Deleted: code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.h
===================================================================
--- code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.h 2017-12-04 15:13:24 UTC (rev 11635)
+++ code/branches/CampaignMap_HS17/src/orxonox/controllers/StoryModeController.h 2017-12-04 15:15:59 UTC (rev 11636)
@@ -1,76 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Fabian 'x3n' Landau
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _HumanController_H__
-#define _HumanController_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "tools/Timer.h"
-#include "tools/interfaces/Tickable.h"
-#include "FormationController.h"
-
-// tolua_begin
-namespace orxonox
-{
- class _OrxonoxExport HumanController
-// tolua_end
- : public FormationController, public Tickable
- { // tolua_export
- public:
- HumanController(Context* context);
- virtual ~HumanController();
-
- virtual void tick(float dt) override;
-
- static void moveFrontBack(const Vector2& value);
- static void moveRightLeft(const Vector2& value);
- static void moveUpDown(const Vector2& value);
-
- static void fire(unsigned int firemode);
- virtual void doFire(unsigned int firemode);
-
- static void myposition();
-
- static void pauseControl(); // tolua_export
- virtual void doPauseControl() {};
-
- static inline HumanController* getLocalControllerSingleton()
- { return HumanController::localController_s; }
- static Pawn* getLocalControllerEntityAsPawn();
- //friend class, for mouselook
- friend class Map;
- static HumanController* localController_s;
-
- protected:
- bool controlPaused_;
-
- }; // tolua_export
-} // tolua_export
-
-#endif /* _HumanController_H__ */
More information about the Orxonox-commit
mailing list