[Orxonox-commit 2241] r6957 - in code/branches/presentation3/src: modules/weapons/weaponmodes orxonox/controllers orxonox/gametypes orxonox/worldentities
scheusso at orxonox.net
scheusso at orxonox.net
Fri May 21 14:11:48 CEST 2010
Author: scheusso
Date: 2010-05-21 14:11:47 +0200 (Fri, 21 May 2010)
New Revision: 6957
Removed:
code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.cc
code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.h
code/branches/presentation3/src/orxonox/controllers/DroneController.cc
code/branches/presentation3/src/orxonox/controllers/DroneController.h
code/branches/presentation3/src/orxonox/gametypes/Testgame.cc
code/branches/presentation3/src/orxonox/gametypes/Testgame.h
code/branches/presentation3/src/orxonox/worldentities/Drone.cc
code/branches/presentation3/src/orxonox/worldentities/Drone.h
code/branches/presentation3/src/orxonox/worldentities/RocketDrone.cc
code/branches/presentation3/src/orxonox/worldentities/RocketDrone.h
Modified:
code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt
code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt
Log:
deleting some unnesseccary files
Deleted: code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.cc
===================================================================
--- code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.cc 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.cc 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,74 +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:
- * Oliver Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#include "DroneFire.h"
-
-#include "util/Math.h"
-#include "core/CoreIncludes.h"
-#include "worldentities/RocketDrone.h"
-
-#include "weaponsystem/Weapon.h"
-#include "weaponsystem/WeaponPack.h"
-#include "weaponsystem/WeaponSystem.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
- CreateFactory(DroneFire);
-
- DroneFire::DroneFire(BaseObject* creator) : WeaponMode(creator)
- {
- RegisterObject(DroneFire);
-
- // this->reloadTime_ = 2f;
- //this->bParallelReload_ = false;
- //this->damage_ = 100;
- //this->speed_ = 100;
-
- this->setMunitionName("LaserMunition");
- // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
- }
-
- DroneFire::~DroneFire()
- {
- }
-
- void DroneFire::fire()
- {
- RocketDrone* rocket = new RocketDrone(this);
-
- //this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
- //rocket->setOrientation(this->getMuzzleOrientation());
- //rocket->setPosition(this->getMuzzlePosition());
- //rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
- //rocket->scale(2);
-
- //rocket->setOwner(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
- //rocket->setDamage(this->getDamage());
- }
-}
Deleted: code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.h
===================================================================
--- code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.h 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/modules/weapons/weaponmodes/DroneFire.h 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,50 +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:
- * Oliver Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _DroneFire_H__
-#define _DroneFire_H__
-
-#include "weapons/WeaponsPrereqs.h"
-#include "weaponsystem/WeaponMode.h"
-
-namespace orxonox
-{
- class _WeaponsExport DroneFire : public WeaponMode
- {
- public:
- DroneFire(BaseObject* creator);
- virtual ~DroneFire();
-
- virtual void fire();
-
- private:
- float speed_;
- };
-}
-
-#endif /* _DroneFire_H__ */
Modified: code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt 2010-05-21 12:11:47 UTC (rev 6957)
@@ -7,5 +7,4 @@
ScriptController.cc
WaypointController.cc
WaypointPatrolController.cc
- DroneController.cc
)
Deleted: code/branches/presentation3/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/DroneController.cc 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/controllers/DroneController.cc 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,78 +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:
- * Oli Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#include "DroneController.h"
-#include "worldentities/Drone.h"
-#include "util/Math.h"
-
-
-namespace orxonox
-{
- /**
- @brief
- Constructor.
- */
- DroneController::DroneController(BaseObject* creator) : Controller(creator)
- {
- RegisterObject(DroneController);
- // Place your code here:
- // - make sure to register the object in the factory
- // - do any kind of initialisation
-
- // this checks that our creator really is a drone
- // and saves the pointer to the drone for the controlling commands
- assert(dynamic_cast<Drone*>(creator)!=0);
- this->setControllableEntity(dynamic_cast<Drone*>(creator));
- this->counter=0;
- }
-
- DroneController::~DroneController()
- {
- }
-
- /**
- @brief
- The controlling happens here. This method defines what the controller has to do each tick.
- @param dt
- The duration of the tick.
- */
- void DroneController::tick(float dt)
- {
- this->counter++;
- // Place your code here:
- // - steering commands
- Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
- // you can use the following commands for steering
- // - moveFrontBack, moveRightLeft, moveUpDown
- // - rotatePitch, rotateYaw, rotateRoll
- // - apply the to myDrone (e.g. myDrone->rotateYaw(..) )
- myDrone->rotatePitch(0.08);
- myDrone->moveFrontBack(1);
-
- }
-}
Deleted: code/branches/presentation3/src/orxonox/controllers/DroneController.h
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/DroneController.h 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/controllers/DroneController.h 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,60 +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:
- * Oli Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _DroneController_H__
-#define _DroneController_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "Controller.h"
-#include "tools/interfaces/Tickable.h"
-
-namespace orxonox
-{
- /**
- @brief
- Controller for the Drone of the PPS tutorial.
- @author
- Oli Scheuss
- */
- class _OrxonoxExport DroneController : public Controller, public Tickable
- {
- public:
- DroneController(BaseObject* creator);
- virtual ~DroneController();
-
- virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick.
-
- protected:
-
- private:
- int counter;
- };
-}
-
-#endif /* _DroneController_H__ */
Deleted: code/branches/presentation3/src/orxonox/gametypes/Testgame.cc
===================================================================
--- code/branches/presentation3/src/orxonox/gametypes/Testgame.cc 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/gametypes/Testgame.cc 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,87 +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:
- * Aurelian Jaggi
- * Co-authors:
- * ...
- *
- */
-
-#include "Asteroids.h"
-
-#include "core/CoreIncludes.h"
-#include "network/Host.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
- CreateUnloadableFactory(Asteroids);
-
- Asteroids::Asteroids(BaseObject* creator) : Gametype(creator)
- {
- RegisterObject(Asteroids);
- this->firstCheckpointReached_ = false;
- }
-
- void Asteroids::tick(float dt)
- {
- SUPER(Asteroids, tick, dt);
-
- if (firstCheckpointReached_ && !this->timerIsActive_)
- {
- this->startTimer();
- }
-
- if (this->time_ < 0 && !this->hasEnded() && this->timerIsActive_)
- {
- this->gtinfo_->sendAnnounceMessage("Time's up - you have lost the match!");
- this->end();
- }
- }
-
- void Asteroids::pawnKilled(Pawn* victim, Pawn* killer)
- {
- if (victim && victim->getPlayer())
- {
- this->gtinfo_->sendAnnounceMessage("You're dead - you have lost the match!");
- this->end();
- }
- }
-
- void Asteroids::start()
- {
- Gametype::start();
-
- std::string message("The match has started! Reach the first chekpoint within 15 seconds! But be aware, there may be pirates around...");
- COUT(0) << message << std::endl;
- Host::Broadcast(message);
- }
-
- void Asteroids::end()
- {
- Gametype::end();
-
- std::string message("The match has ended.");
- COUT(0) << message << std::endl;
- Host::Broadcast(message);
- }
-}
Deleted: code/branches/presentation3/src/orxonox/gametypes/Testgame.h
===================================================================
--- code/branches/presentation3/src/orxonox/gametypes/Testgame.h 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/gametypes/Testgame.h 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,60 +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:
- * Aurelian Jaggi
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _Asteroids_H__
-#define _Asteroids_H__
-
-#include "OrxonoxPrereqs.h"
-#include "Gametype.h"
-
-namespace orxonox
-{
- class _OrxonoxExport Asteroids : public Gametype
- {
- public:
- Asteroids(BaseObject* creator);
- virtual ~Asteroids() {}
-
- virtual void tick(float dt);
-
- virtual void start();
- virtual void end();
-
- inline void firstCheckpointReached(bool reached)
- { this->firstCheckpointReached_ = reached; }
-
- protected:
- virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
-
- private:
- bool firstCheckpointReached_;
- bool gameEnded_;
- };
-}
-
-#endif /* _Asteroids_H__ */
Modified: code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt 2010-05-21 12:11:47 UTC (rev 6957)
@@ -11,7 +11,6 @@
CameraPosition.cc
SpawnPoint.cc
TeamSpawnPoint.cc
- Drone.cc
)
ADD_SUBDIRECTORY(pawns)
Deleted: code/branches/presentation3/src/orxonox/worldentities/Drone.cc
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/Drone.cc 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/worldentities/Drone.cc 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,185 +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:
- * Oli Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#include "Drone.h"
-
-#include "core/XMLPort.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-
-namespace orxonox
-{
- CreateFactory(Drone);
- // put your code in here:
- // create the factory for the drone
-
- /**
- @brief
- Constructor. Registers the object and initializes some default values.
- */
- Drone::Drone(BaseObject* creator) : ControllableEntity(creator)
- {
- RegisterObject(Drone);
- // put your code in here:
- // - register the drone class to the core
- this->myController_ = 0;
-
- this->localLinearAcceleration_.setValue(1, 1, 1);
- this->localAngularAcceleration_.setValue(0, 0, 0);
- this->primaryThrust_ = 100;
- this->auxilaryThrust_ = 100;
- this->rotationThrust_ = 10;
-
- this->setCollisionType(WorldEntity::Dynamic);
-
- myController_ = new DroneController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
- }
-
- /**
- @brief
- Destructor. Destroys controller, if present.
- */
- Drone::~Drone()
- {
- if( this->isInitialized() && this->myController_ )
- delete this->myController_;
- }
-
- /**
- @brief
- Method for creating a Drone through XML.
- */
- void Drone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- // this calls the XMLPort function of the parent class
- SUPER(Drone, XMLPort, xmlelement, mode);
-
- // put your code in here:
- // make sure you add the variables primaryThrust_, auxilaryThrust_ and rotationThrust_ to xmlport
- // make sure that the set- and get-functions exist.
- // variables can be added by the following command
- // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
- XMLPortParam(Drone, "primaryThrust_", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
- XMLPortParam(Drone, "auxilaryThrust_", setAuxilaryThrust, getAuxilaryThrust, xmlelement, mode);
- XMLPortParam(Drone, "rotationThrust_", setRotationThrust, getRotationThrust, xmlelement, mode);
-
- }
-
- /**
- @brief
- Defines which actions the Drone has to take in each tick.
- @param dt
- The length of the tick.
- */
- void Drone::tick(float dt)
- {
- SUPER(Drone, tick, dt);
-
- //if (this->hasLocalController())
- //{
- this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
- this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
- if (this->localLinearAcceleration_.z() > 0)
- this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
- else
- this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
- this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
- this->localLinearAcceleration_.setValue(0, 0, 0);
-
- this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
- this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
- this->localAngularAcceleration_.setValue(0, 0, 0);
- //}
- }
-
- /**
- @brief
- Moves the Drone in the negative z-direction (Front/Back) by an amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the movement.
- */
- void Drone::moveFrontBack(const Vector2& value)
- {
- this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
- }
-
- /**
- @brief
- Moves the Drone in the x-direction (Right/Left) by an amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the movement.
- */
- void Drone::moveRightLeft(const Vector2& value)
- {
- this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
- }
-
- /**
- @brief
- Moves the Drone in the y-direction (Up/Down) by an amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the movement.
- */
- void Drone::moveUpDown(const Vector2& value)
- {
- this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
- }
-
- /**
- @brief
- Rotates the Drone around the y-axis by the amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the angular movement.
- */
- void Drone::rotateYaw(const Vector2& value)
- {
- this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
- }
-
- /**
- @brief
- Rotates the Drone around the x-axis by the amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the angular movement.
- */
- void Drone::rotatePitch(const Vector2& value)
- {
- this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
- }
-
- /**
- @brief
- Rotates the Drone around the z-axis by the amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the angular movement.
- */
- void Drone::rotateRoll(const Vector2& value)
- {
- this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
- }
-
-}
Deleted: code/branches/presentation3/src/orxonox/worldentities/Drone.h
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/Drone.h 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/worldentities/Drone.h 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,137 +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:
- * Oli Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _Drone_H__
-#define _Drone_H__
-
-#include "OrxonoxPrereqs.h"
-#include "worldentities/ControllableEntity.h"
-#include "controllers/DroneController.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- Drone, that is made to move upon a specified pattern.
- This class was constructed for the PPS tutorial.
- @author
- Oli Scheuss
- */
- class _OrxonoxExport Drone : public ControllableEntity
- {
- public:
- Drone(BaseObject* creator);
- virtual ~Drone();
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Drone through XML.
- virtual void tick(float dt); //!< Defines which actions the Drone has to take in each tick.
-
-
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
- virtual void moveUpDown(const Vector2& value);
-
- virtual void rotateYaw(const Vector2& value);
- virtual void rotatePitch(const Vector2& value);
- virtual void rotateRoll(const Vector2& value);
-
- /**
- @brief Moves the Drone in the Front/Back-direction by the specifed amount.
- @param value The amount by which the drone is to be moved.
- */
- inline void moveFrontBack(float value)
- { this->moveFrontBack(Vector2(value, 0)); }
- /**
- @brief Moves the Drone in the Right/Left-direction by the specifed amount.
- @param value The amount by which the drone is to be moved.
- */
- inline void moveRightLeft(float value)
- { this->moveRightLeft(Vector2(value, 0)); }
- /**
- @brief Moves the Drone in the Up/Down-direction by the specifed amount.
- @param value The amount by which the drone is to be moved.
- */
- inline void moveUpDown(float value)
- { this->moveUpDown(Vector2(value, 0)); }
-
- /**
- @brief Rotates the Drone around the y-axis by the specifed amount.
- @param value The amount by which the drone is to be rotated.
- */
- inline void rotateYaw(float value)
- { this->rotateYaw(Vector2(value, 0)); }
- /**
- @brief Rotates the Drone around the x-axis by the specifed amount.
- @param value The amount by which the drone is to be rotated.
- */
- inline void rotatePitch(float value)
- { this->rotatePitch(Vector2(value, 0)); }
- /**
- @brief Rotates the Drone around the z-axis by the specifed amount.
- @param value The amount by which the drone is to be rotated.
- */
- inline void rotateRoll(float value)
- { this->rotateRoll(Vector2(value, 0)); }
-
- /**
- @brief Sets the primary thrust to the input amount.
- @param thrust The amount of thrust.
- */
- inline void setPrimaryThrust( float thrust )
- { this->primaryThrust_=thrust; }
- // place your set-functions here.
- // - hint: auxiliary thrust, rotation thrust.
- inline void setAuxilaryThrust( float thrust )
- { this->primaryThrust_=thrust; }
- inline void setRotationThrust( float thrust )
- { this->rotationThrust_=thrust; }
- /**
- @brief Gets the primary thrust to the input amount.
- @preturn The amount of thrust.
- */
- inline float getPrimaryThrust()
- { return this->primaryThrust_; }
- // place your get-functions here.
- inline float getAuxilaryThrust()
- { return this->auxilaryThrust_; }
- inline float getRotationThrust()
- { return this->rotationThrust_; }
- private:
- DroneController *myController_; //!< The controller of the Drone.
-
- btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Drone the next tick.
- btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Drone the next tick.
- float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
- float auxilaryThrust_; //!< The amount of auxilary thrust. Used for all other movements (except for rotations).
- float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.
- };
-
-}
-
-#endif /* _Drone_H__ */
Deleted: code/branches/presentation3/src/orxonox/worldentities/RocketDrone.cc
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/RocketDrone.cc 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/worldentities/RocketDrone.cc 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,192 +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:
- * Oli Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#include "RocketDrone.h"
-
-#include "core/XMLPort.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "graphics/Model.h"
-
-namespace orxonox
-{
- CreateFactory(RocketDrone);
- // put your code in here:
- // create the factory for the drone
-
- /**
- @brief
- Constructor. Registers the object and initializes some default values.
- */
- RocketDrone::RocketDrone(BaseObject* creator) : ControllableEntity(creator)
- {
- RegisterObject(RocketDrone);
- // put your code in here:
- // - register the drone class to the core
- this->myController_ = 0;
- this->localLinearAcceleration_.setValue(0, 0, 0);
- this->localAngularAcceleration_.setValue(0, 0, 0);
- this->primaryThrust_ = 100;
- this->auxilaryThrust_ = 100;
- this->rotationThrust_ = 10;
- Model *model = new Model(this);
- model->setMeshSource("rocket.mesh");
- model->scale(0.7f);
- this->setCollisionType(WorldEntity::Dynamic);
-
- myController_ = new RocketController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
- }
-
- /**
- @brief
- Destructor. Destroys controller, if present.
- */
- RocketDrone::~RocketDrone()
- {
- if( this->isInitialized() && this->myController_ )
- delete this->myController_;
- }
-
- /**
- @brief
- Method for creating a Drone through XML.
- */
- void RocketDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- // this calls the XMLPort function of the parent class
- SUPER(RocketDrone, XMLPort, xmlelement, mode);
-
- // put your code in here:
- // make sure you add the variables primaryThrust_, auxilaryThrust_ and rotationThrust_ to xmlport
- // make sure that the set- and get-functions exist.
- // variables can be added by the following command
- // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
- XMLPortParam(RocketDrone, "primaryThrust_", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
- XMLPortParam(RocketDrone, "auxilaryThrust_", setAuxilaryThrust, getAuxilaryThrust, xmlelement, mode);
- XMLPortParam(RocketDrone, "rotationThrust_", setRotationThrust, getRotationThrust, xmlelement, mode);
-
- }
-
- /**
- @brief
- Defines which actions the Drone has to take in each tick.
- @param dt
- The length of the tick.
- */
- void RocketDrone::tick(float dt)
- {
- SUPER(RocketDrone, tick, dt);
-
- //if (this->hasLocalController())
- //{
- this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
- this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
- if (this->localLinearAcceleration_.z() > 0)
- this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
- else
- this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
- this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
- this->localLinearAcceleration_.setValue(0, 0, 0);
-
- this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
- this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
- this->localAngularAcceleration_.setValue(0, 0, 0);
- //}
- }
-
- /**
- @brief
- Moves the Drone in the negative z-direction (Front/Back) by an amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the movement.
- */
- void RocketDrone::moveFrontBack(const Vector2& value)
- {
- this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
- }
-
- /**
- @brief
- Moves the Drone in the x-direction (Right/Left) by an amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the movement.
- */
- void RocketDrone::moveRightLeft(const Vector2& value)
- {
- this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
- }
-
- /**
- @brief
- Moves the Drone in the y-direction (Up/Down) by an amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the movement.
- */
- void RocketDrone::moveUpDown(const Vector2& value)
- {
- this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
- }
-
- /**
- @brief
- Rotates the Drone around the y-axis by the amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the angular movement.
- */
- void RocketDrone::rotateYaw(const Vector2& value)
- {
- this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
- }
-
- /**
- @brief
- Rotates the Drone around the x-axis by the amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the angular movement.
- */
- void RocketDrone::rotatePitch(const Vector2& value)
- {
- this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
- }
-
- /**
- @brief
- Rotates the Drone around the z-axis by the amount specified by the first component of the input 2-dim vector.
- @param value
- The vector determining the amount of the angular movement.
- */
- void RocketDrone::rotateRoll(const Vector2& value)
- {
- this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
- }
-
- //void RocketDrone::setOwner(Pawn* owner)
- //{
- // this->owner_ = owner;
- //}
-
-}
Deleted: code/branches/presentation3/src/orxonox/worldentities/RocketDrone.h
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/RocketDrone.h 2010-05-21 11:06:59 UTC (rev 6956)
+++ code/branches/presentation3/src/orxonox/worldentities/RocketDrone.h 2010-05-21 12:11:47 UTC (rev 6957)
@@ -1,139 +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:
- * Oli Scheuss
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _RocketDrone_H__
-#define _RocketDrone_H__
-
-#include "OrxonoxPrereqs.h"
-#include "worldentities/ControllableEntity.h"
-#include "controllers/RocketController.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- Drone, that is made to move upon a specified pattern.
- This class was constructed for the PPS tutorial.
- @author
- Oli Scheuss
- */
- class _OrxonoxExport RocketDrone : public ControllableEntity
- {
- public:
- RocketDrone(BaseObject* creator);
- virtual ~RocketDrone();
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Drone through XML.
- virtual void tick(float dt); //!< Defines which actions the Drone has to take in each tick.
-
-
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
- virtual void moveUpDown(const Vector2& value);
-
- virtual void rotateYaw(const Vector2& value);
- virtual void rotatePitch(const Vector2& value);
- virtual void rotateRoll(const Vector2& value);
-
- /**
- @brief Moves the Drone in the Front/Back-direction by the specifed amount.
- @param value The amount by which the drone is to be moved.
- */
- inline void moveFrontBack(float value)
- { this->moveFrontBack(Vector2(value, 0)); }
- /**
- @brief Moves the Drone in the Right/Left-direction by the specifed amount.
- @param value The amount by which the drone is to be moved.
- */
- inline void moveRightLeft(float value)
- { this->moveRightLeft(Vector2(value, 0)); }
- /**
- @brief Moves the Drone in the Up/Down-direction by the specifed amount.
- @param value The amount by which the drone is to be moved.
- */
- inline void moveUpDown(float value)
- { this->moveUpDown(Vector2(value, 0)); }
-
- /**
- @brief Rotates the Drone around the y-axis by the specifed amount.
- @param value The amount by which the drone is to be rotated.
- */
- inline void rotateYaw(float value)
- { this->rotateYaw(Vector2(value, 0)); }
- /**
- @brief Rotates the Drone around the x-axis by the specifed amount.
- @param value The amount by which the drone is to be rotated.
- */
- inline void rotatePitch(float value)
- { this->rotatePitch(Vector2(value, 0)); }
- /**
- @brief Rotates the Drone around the z-axis by the specifed amount.
- @param value The amount by which the drone is to be rotated.
- */
- inline void rotateRoll(float value)
- { this->rotateRoll(Vector2(value, 0)); }
-
- /**
- @brief Sets the primary thrust to the input amount.
- @param thrust The amount of thrust.
- */
- inline void setPrimaryThrust( float thrust )
- { this->primaryThrust_=thrust; }
- // place your set-functions here.
- // - hint: auxiliary thrust, rotation thrust.
- inline void setAuxilaryThrust( float thrust )
- { this->primaryThrust_=thrust; }
- inline void setRotationThrust( float thrust )
- { this->rotationThrust_=thrust; }
- /**
- @brief Gets the primary thrust to the input amount.
- @preturn The amount of thrust.
- */
- inline float getPrimaryThrust()
- { return this->primaryThrust_; }
- // place your get-functions here.
- inline float getAuxilaryThrust()
- { return this->auxilaryThrust_; }
- inline float getRotationThrust()
- { return this->rotationThrust_; }
-
- //void setOwner(Pawn* owner);
- private:
- RocketController *myController_; //!< The controller of the Drone.
-
- btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Drone the next tick.
- btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Drone the next tick.
- float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
- float auxilaryThrust_; //!< The amount of auxilary thrust. Used for all other movements (except for rotations).
- float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.
- };
-
-}
-
-#endif /* _RocketDrone_H__ */
More information about the Orxonox-commit
mailing list