Changeset 708
- Timestamp:
- Dec 28, 2007, 10:30:29 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 9 added
- 101 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioBuffer.cc
r702 r708 30 30 namespace audio 31 31 { 32 AudioBuffer::AudioBuffer( std::string fileName)32 AudioBuffer::AudioBuffer(orxonox::String fileName) 33 33 { 34 34 // Load wav data into buffers. -
code/branches/FICN/src/audio/AudioBuffer.h
r673 r708 9 9 { 10 10 public: 11 AudioBuffer( std::string fileName);11 AudioBuffer(orxonox::String fileName); 12 12 ~AudioBuffer(); 13 13 private: … … 15 15 ALuint buffer; 16 16 // Identifier 17 std::string name;17 orxonox::String name; 18 18 // True if AL was able to load data 19 19 ALboolean loaded; -
code/branches/FICN/src/audio/AudioIncludes.h
r677 r708 1 1 #include <iostream> 2 #include <string>3 2 #include <vector> 4 3 … … 11 10 #include <vorbis/vorbisfile.h> 12 11 13 #include "../orxonox/core/Error.h" 12 #include "orxonox/core/Error.h" 13 #include "misc/String.h" -
code/branches/FICN/src/audio/AudioManager.cc
r666 r708 27 27 28 28 #include "AudioManager.h" 29 #include " ../orxonox/core/Debug.h"29 #include "orxonox/core/Debug.h" 30 30 31 31 namespace audio … … 72 72 } 73 73 74 void AudioManager::ambientAdd( std::string file)74 void AudioManager::ambientAdd(orxonox::String file) 75 75 { 76 std::string path = ambientPath + "/" + file + ".ogg";76 orxonox::String path = ambientPath + "/" + file + ".ogg"; 77 77 AudioStream tmp(path); 78 78 tmp.open(); -
code/branches/FICN/src/audio/AudioManager.h
r673 r708 37 37 void update(); 38 38 39 void ambientAdd( std::string file);39 void ambientAdd(orxonox::String file); 40 40 void ambientStart(); 41 41 void ambientStop(); … … 49 49 50 50 51 std::string ambientPath;51 orxonox::String ambientPath; 52 52 53 53 // Vector containing all audio files -
code/branches/FICN/src/audio/AudioStream.cc
r677 r708 28 28 29 29 #include "AudioStream.h" 30 #include " ../orxonox/core/Debug.h"30 #include "orxonox/core/Debug.h" 31 31 32 32 namespace audio 33 33 { 34 AudioStream::AudioStream( std::string path)34 AudioStream::AudioStream(orxonox::String path) 35 35 { 36 36 this->path = path; … … 40 40 void AudioStream::open() 41 41 { 42 int result; 43 44 45 if(!(oggFile = fopen(path.c_str(), "rb"))) 42 //int result; 43 errno_t result; 44 45 46 if(fopen_s(&oggFile, path.c_str(), "rb")) 46 47 { 47 48 orxonox::Error("Could not open Ogg file "+path); 48 49 return; 49 50 } 50 51 if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0) 51 else 52 { 53 COUT(4) << "Opened Ogg file" << path << std::endl; 54 } 55 56 /*if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0) 52 57 { 53 58 fclose(oggFile); 54 59 orxonox::Error("Could not open Ogg stream. " + errorString(result)); 55 60 return; 56 } 61 }*/ 57 62 58 63 loaded = true; … … 254 259 255 260 256 std::string AudioStream::errorString(int code)261 orxonox::String AudioStream::errorString(int code) 257 262 { 258 263 switch(code) 259 264 { 260 265 case OV_EREAD: 261 return std::string("Read from media.");266 return orxonox::String("Read from media."); 262 267 case OV_ENOTVORBIS: 263 return std::string("Not Vorbis data.");268 return orxonox::String("Not Vorbis data."); 264 269 case OV_EVERSION: 265 return std::string("Vorbis version mismatch.");270 return orxonox::String("Vorbis version mismatch."); 266 271 case OV_EBADHEADER: 267 return std::string("Invalid Vorbis header.");272 return orxonox::String("Invalid Vorbis header."); 268 273 case OV_EFAULT: 269 return std::string("Internal logic fault (bug or heap/stack corruption.");274 return orxonox::String("Internal logic fault (bug or heap/stack corruption."); 270 275 default: 271 return std::string("Unknown Ogg error.");276 return orxonox::String("Unknown Ogg error."); 272 277 } 273 278 } -
code/branches/FICN/src/audio/AudioStream.h
r677 r708 11 11 { 12 12 public: 13 AudioStream( std::string path);13 AudioStream(orxonox::String path); 14 14 void open(); 15 15 void release(); … … 24 24 void empty(); 25 25 void check(); 26 std::string errorString(int code);26 orxonox::String errorString(int code); 27 27 28 28 private: 29 std::string path;29 orxonox::String path; 30 30 31 31 FILE* oggFile; -
code/branches/FICN/src/loader/LevelLoader.cc
r702 r708 42 42 { 43 43 44 LevelLoader::LevelLoader( std::string file, std::string path)44 LevelLoader::LevelLoader(orxonox::String file, orxonox::String path) 45 45 { 46 46 valid_ = false; … … 155 155 156 156 tElem = tNode->ToElement(); 157 std::string elemVal = tElem->Value();157 orxonox::String elemVal = tElem->Value(); 158 158 if (elemVal == "ogg") 159 159 { -
code/branches/FICN/src/loader/LevelLoader.h
r682 r708 9 9 #define _LevelLoader_H__ 10 10 11 #include <string>11 #include "LoaderPrereqs.h" 12 12 13 #include " LoaderPrereqs.h"13 #include "misc/String.h" 14 14 #include "tinyxml/tinyxml.h" 15 15 … … 23 23 public: 24 24 // Constructors, loads the level file and some information data 25 LevelLoader( std::string file, std::string dir = "levels");25 LevelLoader(orxonox::String file, orxonox::String dir = "levels"); 26 26 // Destructor 27 27 virtual ~LevelLoader(); … … 30 30 31 31 // Getters 32 inline std::string name() {return name_; };33 inline std::string description() {return description_; };34 inline std::string image() {return image_; };32 inline orxonox::String name() {return name_; }; 33 inline orxonox::String description() {return description_; }; 34 inline orxonox::String image() {return image_; }; 35 35 private: 36 36 //! Level information 37 std::string name_;38 std::string description_;39 std::string image_;40 std::string loadingBackgroundColor_;41 std::string loadingBackgroundImage_;42 std::string loadingBarImage_;43 std::string loadingBarTop_;44 std::string loadingBarLeft_;45 std::string loadingBarWidth_;46 std::string loadingBarHeight_;37 orxonox::String name_; 38 orxonox::String description_; 39 orxonox::String image_; 40 orxonox::String loadingBackgroundColor_; 41 orxonox::String loadingBackgroundImage_; 42 orxonox::String loadingBarImage_; 43 orxonox::String loadingBarTop_; 44 orxonox::String loadingBarLeft_; 45 orxonox::String loadingBarWidth_; 46 orxonox::String loadingBarHeight_; 47 47 48 48 //! Set to true if it was possible to load the level file -
code/branches/FICN/src/misc/String2Number.h
r676 r708 6 6 #include <iostream> 7 7 8 #include " ../orxonox/core/Debug.h"8 #include "orxonox/core/Debug.h" 9 9 10 10 /** -
code/branches/FICN/src/network/ClientConnection.cc
r632 r708 39 39 #include "ClientConnection.h" 40 40 41 #ifdef WIN32 42 #include <windows.h> 43 #define usleep(x) Sleep((x)/1000) 44 #else 45 #include <unistd.h> 46 #endif 41 #include "misc/Sleep.h" 47 42 48 43 namespace network{ -
code/branches/FICN/src/network/NetworkFrameListener.h
r673 r708 14 14 #define _NetworkFrameListener_H__ 15 15 16 #include "OgreFrameListener.h" 16 #include <OgreFrameListener.h> 17 17 18 #include "Server.h" 18 19 #include "Client.h" -
code/branches/FICN/src/orxonox/AIClass.h
r673 r708 2 2 #define _AIClass_H__ 3 3 4 #include <Ogre.h> 5 #include <OgreVector3.h> 6 #include <OgreMath.h> 4 #include "misc/Vector3.h" 7 5 8 #include <iostream> 9 10 // FIXME: using namespace xy; in header files is a very bad idea.. 11 using namespace std; 12 using namespace Ogre; 13 14 class AIPilot { 6 namespace orxonox 7 { 8 class AIPilot 9 { 15 10 16 11 17 /*18 TASKS: Requirements:12 /* 13 TASKS: Requirements: 19 14 20 15 - Change actual Speed to required Speed - Speed as Vector3 , spaceship(?) -> pilot attached to it or vice versa (?) … … 25 20 26 21 27 */22 */ 28 23 29 24 public: … … 32 27 33 28 34 //default constructor35 AIPilot() {36 speed = (1,0,0);37 }29 //default constructor 30 AIPilot() { 31 speed = (1,0,0); 32 } 38 33 39 Vector3 steer(Vector3 reqSpeed) {40 Quaternion sRotation = speed.getRotationTo(reqSpeed);41 Radian rollarc = sRotation.getRoll();42 Radian pitcharc = sRotation.getPitch();43 Radian yawarc = sRotation.getYaw();44 return Vector3((float)rollarc.valueRadians(), (float)pitcharc.valueRadians(), (float)yawarc.valueRadians());45 }34 Vector3 steer(Vector3 reqSpeed) { 35 Quaternion sRotation = speed.getRotationTo(reqSpeed); 36 Radian rollarc = sRotation.getRoll(); 37 Radian pitcharc = sRotation.getPitch(); 38 Radian yawarc = sRotation.getYaw(); 39 return Vector3((float)rollarc.valueRadians(), (float)pitcharc.valueRadians(), (float)yawarc.valueRadians()); 40 } 46 41 47 42 43 }; 48 44 49 }; 50 51 class AIFleetCommander : public AIPilot { 45 class AIFleetCommander : public AIPilot { 52 46 53 47 54 /*55 TASKS: Requirements:48 /* 49 TASKS: Requirements: 56 50 57 51 - Same tasks as AI_Pilot (only if shipcontrol) - Same as AI_Pilot … … 61 55 62 56 63 */57 */ 64 58 65 59 public: 66 60 67 61 68 //default constructor69 AIFleetCommander() {62 //default constructor 63 AIFleetCommander() { 70 64 71 }65 } 72 66 73 67 74 68 75 };69 }; 76 70 77 class AICommander : public AIFleetCommander { 71 class AICommander : public AIFleetCommander 72 { 78 73 79 74 80 /*81 TASKS: Requirements:75 /* 76 TASKS: Requirements: 82 77 83 78 - Decide on general tactics - List of general fleet status + all possible information on enemies … … 86 81 87 82 88 */83 */ 89 84 90 //default constructor91 AICommander() {85 //default constructor 86 AICommander() { 92 87 93 }88 } 94 89 95 90 91 }; 96 92 97 } ;93 } 98 94 99 95 #endif /* _AIClass_H__ */ -
code/branches/FICN/src/orxonox/Arrival.h
r673 r708 6 6 #define _Arrival_H__ 7 7 8 // #include <Ogre.h> 9 #include <OgreVector3.h>8 #include "misc/Vector3.h" 9 #include "misc/Quaternion.h" 10 10 11 12 #include <iostream> 13 14 // FIXME: using namspace xy; in header files is a bad idea 15 using namespace std; 16 using namespace Ogre; 17 18 class Arrival { 19 11 namespace orxonox 12 { 13 class Arrival 14 { 20 15 public: 21 16 Vector3 location; //!< locationvector of the element … … 27 22 28 23 29 Arrival() {30 acceleration = (0,0,0);31 speed = (0,0,0);32 location = (0,0,0);33 target = (0,0,0);34 }24 Arrival() { 25 acceleration = (0,0,0); 26 speed = (0,0,0); 27 location = (0,0,0); 28 target = (0,0,0); 29 } 35 30 36 Arrival(Vector3 location_, Vector3 speed_, Vector3 acceleration_, Vector3 target_) {37 acceleration = acceleration_;38 speed = speed_;39 location = location_;40 target = target_;41 }31 Arrival(Vector3 location_, Vector3 speed_, Vector3 acceleration_, Vector3 target_) { 32 acceleration = acceleration_; 33 speed = speed_; 34 location = location_; 35 target = target_; 36 } 42 37 43 void setValues(Vector3 location_, Vector3 speed_, Vector3 acceleration_, Vector3 target_) {44 acceleration = acceleration_;45 speed = speed_;46 location = location_;47 target = target_;48 }38 void setValues(Vector3 location_, Vector3 speed_, Vector3 acceleration_, Vector3 target_) { 39 acceleration = acceleration_; 40 speed = speed_; 41 location = location_; 42 target = target_; 43 } 49 44 50 void setTarget(Vector3 target_) {51 setValues(this.location, this.speed, this.acceleration, target_);52 }45 void setTarget(Vector3 target_) { 46 setValues(this->location, this->speed, this->acceleration, target_); 47 } 53 48 54 Vector3 getDirection() {55 Vector3 direction = target-location;56 }49 Vector3 getDirection() { 50 Vector3 direction = target-location; 51 } 57 52 58 double relativeDirectApproach() {59 // Maxspeed / accelerationForwards = time needed to break with max acceleration60 // 2*getDistance()length/(MaxSpeed/accelerationForwards)^2 = required acceleration to arrive at the target with speed = 061 return (accelerationForwards / (2*getDirection().length / (MaxSpeed/accelerationForwards)^2) );62 }53 double relativeDirectApproach() { 54 // Maxspeed / accelerationForwards = time needed to break with max acceleration 55 // 2*getDistance()length/(MaxSpeed/accelerationForwards)^2 = required acceleration to arrive at the target with speed = 0 56 return (accelerationForwards / (2*getDirection().length() / ((MaxSpeed/accelerationForwards)*(MaxSpeed/accelerationForwards))) ); 57 } 63 58 64 void Approach() { 65 Quaternion rotation = (0,0,0,0); 66 if (relativeDirectApproach() > 1) { 67 float length = speed.length(); 68 speed = (speed+getDirection()); 69 speed.normalise(); 70 speed = speed*length; 71 if (relativeDirectApproach > 4) { 72 //accelerate 59 void Approach() { 60 Quaternion rotation = Quaternion(0,0,0,0); 61 if (relativeDirectApproach() > 1) 62 { 63 float length = speed.length(); 64 speed = (speed+getDirection()); 65 speed.normalise(); 66 speed = speed*length; 67 if (relativeDirectApproach() > 4) 68 { 69 //accelerate 70 } 71 else 72 { 73 // speed will stay constant 74 } 73 75 } 74 76 else { 75 // speed will stay constant76 77 } 77 78 79 }80 else {81 82 83 78 } 84 79 85 } 80 }; 86 81 } 87 82 -
code/branches/FICN/src/orxonox/Flocking.h
r673 r708 5 5 #define _Flocking_H__ 6 6 7 // #include <Ogre.h> 8 #include <OgreVector3.h> 7 #include "misc/Vector3.h" 9 8 10 11 #include <iostream> 12 13 14 15 class Element // An element that flocks 9 namespace orxonox 16 10 { 11 class Element // An element that flocks 12 { 17 13 18 14 public: 19 Ogre::Vector3 location; //!< locationvector of the element20 Ogre::Vector3 speed; //!< speedvector of the element21 Ogre::Vector3 acceleration; //!< accelerationvector of the element15 Vector3 location; //!< locationvector of the element 16 Vector3 speed; //!< speedvector of the element 17 Vector3 acceleration; //!< accelerationvector of the element 22 18 bool movable; //!< movability of the element, (false) gives the possiblity that an object can`t be moved by flocking but still gets into the calculation 23 19 static int const SEPERATIONDISTANCE = 300; //!< detectionradius of seperation … … 26 22 static int const ANZELEMENTS = 9; //!< number of elements 27 23 28 //! default constructor29 Element() {30 acceleration = Ogre::Vector3(0,0,0);31 speed = Ogre::Vector3(0,0,0);32 location = Ogre::Vector3(0,0,0);33 movable = true;34 }24 //! default constructor 25 Element() { 26 acceleration = Vector3(0,0,0); 27 speed = Vector3(0,0,0); 28 location = Vector3(0,0,0); 29 movable = true; 30 } 35 31 36 /** constructor37 * @param location_ sets locationvector of the element38 * @param speed_ sets speedvector of the element39 * @param acceleration_ sets accelerationvector of the element40 * @param movable_ sets movability of the element41 */42 Element(Ogre::Vector3 location_, Ogre::Vector3 speed_, Ogre::Vector3 acceleration_, bool movable_) {43 acceleration = acceleration_;44 speed = speed_;45 location = location_;46 movable = movable_;47 }32 /** constructor 33 * @param location_ sets locationvector of the element 34 * @param speed_ sets speedvector of the element 35 * @param acceleration_ sets accelerationvector of the element 36 * @param movable_ sets movability of the element 37 */ 38 Element(Vector3 location_, Vector3 speed_, Vector3 acceleration_, bool movable_) { 39 acceleration = acceleration_; 40 speed = speed_; 41 location = location_; 42 movable = movable_; 43 } 48 44 49 //! function to chance values of an element50 void setValues(Ogre::Vector3 location_, Ogre::Vector3 speed_, Ogre::Vector3 acceleration_, bool movable_) {51 acceleration = acceleration_;52 speed = speed_;53 location = location_;54 movable = movable_;55 }45 //! function to chance values of an element 46 void setValues(Vector3 location_, Vector3 speed_, Vector3 acceleration_, bool movable_) { 47 acceleration = acceleration_; 48 speed = speed_; 49 location = location_; 50 movable = movable_; 51 } 56 52 57 /** calculates the distance between the element and an other point given by temp58 * @param e remote object to calculate distance to59 */60 float getDistance(Element e) {61 Ogre::Vector3 distance = e.location - location;62 return distance.length();63 }53 /** calculates the distance between the element and an other point given by temp 54 * @param e remote object to calculate distance to 55 */ 56 float getDistance(Element e) { 57 Vector3 distance = e.location - location; 58 return distance.length(); 59 } 64 60 65 //! updates the data of an element66 void update(Element arrayOfElements[]) {67 if (this->movable == true) {calculateAcceleration(arrayOfElements);} //if element is movable, calculate acceleration68 }61 //! updates the data of an element 62 void update(Element arrayOfElements[]) { 63 if (this->movable == true) {calculateAcceleration(arrayOfElements);} //if element is movable, calculate acceleration 64 } 69 65 70 //! calculates the new acceleration of an element71 void calculateAcceleration(Element arrayOfElements[]) {72 acceleration = separation(arrayOfElements) + alignment(arrayOfElements) + cohesion(arrayOfElements); //acceleration consisting of flocking-functions73 }66 //! calculates the new acceleration of an element 67 void calculateAcceleration(Element arrayOfElements[]) { 68 acceleration = separation(arrayOfElements) + alignment(arrayOfElements) + cohesion(arrayOfElements); //acceleration consisting of flocking-functions 69 } 74 70 75 //! separation-function (keep elements separated, avoid crashs) 76 Ogre::Vector3 separation(Element arrayOfElements[]) { 77 using namespace Ogre; 78 Vector3 steering = Vector3(0,0,0); //steeringvector 79 Vector3 inverseDistance = Vector3(0,0,0); //vector pointing away from possible collisions 80 int numberOfNeighbour = 0; //number of observed neighbours 81 float distance = 0; // distance to the actual element 82 for(int i=0; i<ANZELEMENTS; i++) { //go through all elements 83 Element actual = arrayOfElements[i]; //get the actual element 84 distance = getDistance(actual); //get distance between this and actual 85 if ((distance > 0) && (distance < SEPERATIONDISTANCE)) { //do only if actual is inside detectionradius 86 inverseDistance = (0,0,0); 87 inverseDistance = location-actual.location; //calculate the distancevector heading towards this 88 //adaptation of the inverseDistance to the distance 89 if ((distance < 200) && (distance >= 120)) {inverseDistance = 2*inverseDistance;} 90 if ((distance < 120) && (distance >= 80)) {inverseDistance = 5*inverseDistance;} 91 if ((distance < 80) && (distance >= 40)) {inverseDistance = 10*inverseDistance;} 92 if ((distance < 40) && (distance > 0)) {inverseDistance = 10*inverseDistance;} 93 steering = steering + inverseDistance; //add up all significant steeringvectors 94 numberOfNeighbour++; //counts the elements inside the detectionradius 71 //! separation-function (keep elements separated, avoid crashs) 72 Vector3 separation(Element arrayOfElements[]) { 73 using namespace Ogre; 74 Vector3 steering = Vector3(0,0,0); //steeringvector 75 Vector3 inverseDistance = Vector3(0,0,0); //vector pointing away from possible collisions 76 int numberOfNeighbour = 0; //number of observed neighbours 77 float distance = 0; // distance to the actual element 78 for(int i=0; i<ANZELEMENTS; i++) { //go through all elements 79 Element actual = arrayOfElements[i]; //get the actual element 80 distance = getDistance(actual); //get distance between this and actual 81 if ((distance > 0) && (distance < SEPERATIONDISTANCE)) { //do only if actual is inside detectionradius 82 inverseDistance = (0,0,0); 83 inverseDistance = location-actual.location; //calculate the distancevector heading towards this 84 //adaptation of the inverseDistance to the distance 85 if ((distance < 200) && (distance >= 120)) {inverseDistance = 2*inverseDistance;} 86 if ((distance < 120) && (distance >= 80)) {inverseDistance = 5*inverseDistance;} 87 if ((distance < 80) && (distance >= 40)) {inverseDistance = 10*inverseDistance;} 88 if ((distance < 40) && (distance > 0)) {inverseDistance = 10*inverseDistance;} 89 steering = steering + inverseDistance; //add up all significant steeringvectors 90 numberOfNeighbour++; //counts the elements inside the detectionradius 91 } 95 92 } 93 if(numberOfNeighbour > 0) { steering = steering / (float)numberOfNeighbour; } //devide the sum of steeringvectors by the number of elements -> separation steeringvector 94 return steering; 96 95 } 97 if(numberOfNeighbour > 0) { steering = steering / (float)numberOfNeighbour; } //devide the sum of steeringvectors by the number of elements -> separation steeringvector98 return steering;99 }100 96 101 //! alignment-function (lead elements to the same heading) 102 Ogre::Vector3 alignment(Element arrayOfElements[]) { 103 using namespace Ogre; 104 Vector3 steering = Vector3(0,0,0); //steeringvector 105 int numberOfNeighbour = 0; //number of observed neighbours 106 float distance = 0; 107 //go through all elements 108 for(int i=0; i<ANZELEMENTS; i++) { //just working with 3 elements at the moment 109 Element actual = arrayOfElements[i]; //get the actual element 110 float distance = getDistance(actual); //get distance between this and actual 111 if ((distance > 0) && (distance < ALIGNMENTDISTANCE)) { //check if actual element is inside detectionradius 112 steering = steering + actual.speed; //add up all speedvectors inside the detectionradius 113 numberOfNeighbour++; //counts the elements inside the detectionradius 97 //! alignment-function (lead elements to the same heading) 98 Vector3 alignment(Element arrayOfElements[]) { 99 using namespace Ogre; 100 Vector3 steering = Vector3(0,0,0); //steeringvector 101 int numberOfNeighbour = 0; //number of observed neighbours 102 float distance = 0; 103 //go through all elements 104 for(int i=0; i<ANZELEMENTS; i++) { //just working with 3 elements at the moment 105 Element actual = arrayOfElements[i]; //get the actual element 106 float distance = getDistance(actual); //get distance between this and actual 107 if ((distance > 0) && (distance < ALIGNMENTDISTANCE)) { //check if actual element is inside detectionradius 108 steering = steering + actual.speed; //add up all speedvectors inside the detectionradius 109 numberOfNeighbour++; //counts the elements inside the detectionradius 110 } 114 111 } 112 if(numberOfNeighbour > 0) { steering = steering / (float)numberOfNeighbour; } //devide the sum of steeringvectors by the number of elements -> alignment steeringvector 113 return steering; 115 114 } 116 if(numberOfNeighbour > 0) { steering = steering / (float)numberOfNeighbour; } //devide the sum of steeringvectors by the number of elements -> alignment steeringvector117 return steering;118 }119 115 120 //! cohseion-function (keep elements close to each other) 121 Ogre::Vector3 cohesion(Element arrayOfElements[]) { 122 using namespace Ogre; 123 Vector3 steering = Vector3(0,0,0); //steeringvector 124 int numberOfNeighbour = 0; //number of observed neighbours 125 float distance = 0; 126 //go through all elements 127 for(int i=0; i<ANZELEMENTS; i++) { //just working with 3 elements at the moment 128 Element actual = arrayOfElements[i]; //get the actual element 129 float distance = getDistance(actual); //get distance between this and actual 130 if ((distance > 0) && (distance < COHESIONDISTANCE)) { //check if actual element is inside detectionradius 131 steering = steering + actual.location; //add up all locations of elements inside the detectionradius 132 numberOfNeighbour++; //counts the elements inside the detectionradius 116 //! cohseion-function (keep elements close to each other) 117 Vector3 cohesion(Element arrayOfElements[]) { 118 using namespace Ogre; 119 Vector3 steering = Vector3(0,0,0); //steeringvector 120 int numberOfNeighbour = 0; //number of observed neighbours 121 float distance = 0; 122 //go through all elements 123 for(int i=0; i<ANZELEMENTS; i++) { //just working with 3 elements at the moment 124 Element actual = arrayOfElements[i]; //get the actual element 125 float distance = getDistance(actual); //get distance between this and actual 126 if ((distance > 0) && (distance < COHESIONDISTANCE)) { //check if actual element is inside detectionradius 127 steering = steering + actual.location; //add up all locations of elements inside the detectionradius 128 numberOfNeighbour++; //counts the elements inside the detectionradius 129 } 133 130 } 131 if(numberOfNeighbour > 0) { 132 steering = steering / (float)numberOfNeighbour; //devide the sum steeringvector by the number of elements -> cohesion steeringvector 133 steering = steering - this->location; //transform the vector for the ship 134 } 135 return steering; 134 136 } 135 if(numberOfNeighbour > 0) { 136 steering = steering / (float)numberOfNeighbour; //devide the sum steeringvector by the number of elements -> cohesion steeringvector 137 steering = steering - this->location; //transform the vector for the ship 138 } 139 return steering; 140 } 141 }; //End of class Element 137 }; //End of class Element 138 } 142 139 143 140 #endif /* _Flocking_H__*/ -
code/branches/FICN/src/orxonox/GraphicsEngine.cc
r679 r708 65 65 #endif*/ 66 66 #if defined(_DEBUG) && defined(WIN32) 67 std::string plugin_filename = "plugins_d.cfg";67 String plugin_filename = "plugins_d.cfg"; 68 68 #else 69 std::string plugin_filename = "plugins.cfg";69 String plugin_filename = "plugins.cfg"; 70 70 #endif 71 71 root_ = new Root(plugin_filename); … … 100 100 } 101 101 102 void GraphicsEngine::loadRessourceLocations( std::string dataPath)102 void GraphicsEngine::loadRessourceLocations(String dataPath) 103 103 { 104 104 //TODO: Specify layout of data file and maybe use xml-loader -
code/branches/FICN/src/orxonox/GraphicsEngine.h
r673 r708 11 11 #include <OgreSceneManager.h> 12 12 13 #include "misc/String.h" 14 13 15 14 16 namespace orxonox { … … 20 22 public: 21 23 GraphicsEngine(); 22 inline void setConfigPath( std::string path) { this->configPath_ = path; };24 inline void setConfigPath(String path) { this->configPath_ = path; }; 23 25 // find a better way for this 24 26 inline Ogre::Root* getRoot() { return root_; }; 25 27 void setup(); 26 28 bool load(); 27 void loadRessourceLocations( std::string path);29 void loadRessourceLocations(String path); 28 30 Ogre::SceneManager* getSceneManager(); 29 31 void startRender(); … … 32 34 private: 33 35 Ogre::Root* root_; //!< Ogre's root 34 std::string configPath_; //!< path to config file35 std::string dataPath_; //!< path to data file36 String configPath_; //!< path to config file 37 String dataPath_; //!< path to data file 36 38 Ogre::SceneManager* scene_; //!< scene manager of the game 37 39 -
code/branches/FICN/src/orxonox/Main.cc
r701 r708 39 39 40 40 using namespace orxonox; 41 using namespace Ogre;42 41 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 43 42 #include <CoreFoundation/CoreFoundation.h> -
code/branches/FICN/src/orxonox/Orxonox.cc
r673 r708 32 32 33 33 //****** OGRE ****** 34 #include <OgreString.h>35 34 #include <OgreException.h> 36 35 #include <OgreRoot.h> … … 47 46 48 47 //****** STD ******* 49 #include <string>50 48 #include <iostream> 51 49 #include <exception> 52 50 53 51 //***** ORXONOX **** 52 //misc 53 #include "misc/Sleep.h" 54 54 55 // loader and audio 55 56 #include "loader/LevelLoader.h" … … 77 78 namespace orxonox 78 79 { 79 using namespace Ogre;80 81 80 // put this in a seperate Class or solve the problem in another fashion 82 class OrxListener : public FrameListener81 class OrxListener : public Ogre::FrameListener 83 82 { 84 83 public: … … 90 89 } 91 90 92 bool frameStarted(const FrameEvent& evt)91 bool frameStarted(const Ogre::FrameEvent& evt) 93 92 { 94 93 auMan_->update(); … … 154 153 * @param path path to config (in home dir or something) 155 154 */ 156 void Orxonox::init(int argc, char **argv, std::string path)155 void Orxonox::init(int argc, char **argv, String path) 157 156 { 158 157 //TODO: find config file (assuming executable directory) 159 158 //TODO: read config file 160 159 //TODO: give config file to Ogre 161 std::string mode;160 String mode; 162 161 // if(argc>=2) 163 // mode = std::string(argv[1]);162 // mode = String(argv[1]); 164 163 // else 165 164 // mode = ""; … … 170 169 //mode = "presentation"; 171 170 if(ar.errorHandling()) die(); 172 if(mode == std::string("server"))171 if(mode == String("server")) 173 172 { 174 173 serverInit(path); 175 174 mode_ = SERVER; 176 175 } 177 else if(mode == std::string("client"))176 else if(mode == String("client")) 178 177 { 179 178 clientInit(path); 180 179 mode_ = CLIENT; 181 180 } 182 else if(mode == std::string("presentation"))181 else if(mode == String("presentation")) 183 182 { 184 183 serverInit(path); … … 244 243 } 245 244 246 void Orxonox::standaloneInit( std::string path)245 void Orxonox::standaloneInit(String path) 247 246 { 248 247 ogre_->setConfigPath(path); … … 263 262 } 264 263 265 void Orxonox::playableServer( std::string path)264 void Orxonox::playableServer(String path) 266 265 { 267 266 ogre_->setConfigPath(path); … … 297 296 } 298 297 299 void Orxonox::serverInit( std::string path)298 void Orxonox::serverInit(String path) 300 299 { 301 300 COUT(2) << "initialising server" << std::endl; … … 307 306 } 308 307 309 void Orxonox::clientInit( std::string path)308 void Orxonox::clientInit(String path) 310 309 { 311 310 COUT(2) << "initialising client" << std::endl; … … 322 321 void Orxonox::defineResources() 323 322 { 324 Ogre::String secName, typeName, archName;323 String secName, typeName, archName; 325 324 Ogre::ConfigFile cf; 326 325 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE … … 341 340 archName = i->second; 342 341 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE 343 ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);342 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName); 344 343 #else 345 ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);344 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName); 346 345 #endif 347 346 } … … 352 351 { 353 352 if (!root_->restoreConfig() && !root_->showConfigDialog()) 354 throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");353 throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()"); 355 354 } 356 355 … … 362 361 void Orxonox::initializeResourceGroups() 363 362 { 364 TextureManager::getSingleton().setDefaultNumMipmaps(5);365 ResourceGroupManager::getSingleton().initialiseAllResourceGroups();363 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); 364 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 366 365 } 367 366 … … 381 380 loader_->loadLevel(); 382 381 383 O verlay* hudOverlay =OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");384 hud::HUD* orxonoxHud;385 orxonoxHud = new hud::HUD();382 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 383 HUD* orxonoxHud; 384 orxonoxHud = new HUD(); 386 385 orxonoxHud->setEnergyValue(20); 387 386 orxonoxHud->setEnergyDistr(20,20,60); … … 427 426 // fixes auto repeat problem 428 427 #if defined OIS_LINUX_PLATFORM 429 pl.insert(std::make_pair( std::string("XAutoRepeatOn"), std::string("true")));428 pl.insert(std::make_pair(String("XAutoRepeatOn"), String("true"))); 430 429 #endif 431 430 432 RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();431 Ogre::RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow(); 433 432 win->getCustomAttribute("WINDOW", &windowHnd); 434 433 windowHndStr << windowHnd; 435 pl.insert(std::make_pair( std::string("WINDOW"), windowHndStr.str()));434 pl.insert(std::make_pair(String("WINDOW"), windowHndStr.str())); 436 435 inputManager_ = OIS::InputManager::createInputSystem(pl); 437 436 -
code/branches/FICN/src/orxonox/Orxonox.h
r682 r708 13 13 #include "OrxonoxPrereqs.h" 14 14 #include "loader/LoaderPrereqs.h" 15 16 #include "misc/String.h" 15 17 #include "GraphicsEngine.h" 16 18 … … 30 32 { 31 33 public: 32 void init(int argc, char **argv, std::string path);34 void init(int argc, char **argv, String path); 33 35 void start(); 34 36 // not sure if this should be private … … 46 48 virtual ~Orxonox(); 47 49 // init functions 48 void serverInit( std::string path);49 void clientInit( std::string path);50 void standaloneInit( std::string path);50 void serverInit(String path); 51 void clientInit(String path); 52 void standaloneInit(String path); 51 53 // run functions 52 void playableServer( std::string path);54 void playableServer(String path); 53 55 void standalone(); 54 56 void defineResources(); … … 64 66 private: 65 67 GraphicsEngine* ogre_; //!< our dearest graphics engine <3 66 std::string dataPath_; //!< path to data68 String dataPath_; //!< path to data 67 69 loader::LevelLoader* loader_; //!< level loader builds the scene 68 70 audio::AudioManager* auMan_; //!< audio manager … … 77 79 // this is used to identify the mode (server/client/...) we're in 78 80 gameMode mode_; 79 std::string serverIp_;81 String serverIp_; 80 82 }; 81 83 } -
code/branches/FICN/src/orxonox/OrxonoxPlatform.h
r683 r708 220 220 typedef unsigned char uint8; 221 221 222 } 222 #ifdef ORXONOX_DOUBLE_PRECISION 223 typedef double Real; 224 #else 225 typedef float Real; 226 #endif 223 227 224 228 … … 270 274 #endif 271 275 272 273 // hack for the usleep/Sleep problem 274 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 275 # include <windows.h> 276 # define usleep(x) Sleep((x)/1000) 277 #elif ORXONOX_PLATFORM == ORXONOX_PLATFORM_LINUX 278 # include <unistd.h> 279 #endif 280 276 } /* namespace orxonox */ 281 277 282 278 #endif /* _OrxonoxPlatform_H__ */ -
code/branches/FICN/src/orxonox/OrxonoxPrereqs.h
r682 r708 40 40 class SpaceShipSteering; 41 41 42 // TinyXML 43 class TiXmlString; 44 class TiXmlOutStream; 45 class TiXmlNode; 46 class TiXmlHandle; 47 class TiXmlDocument; 48 class TiXmlElement; 49 class TiXmlComment; 50 class TiXmlUnknown; 51 class TiXmlAttribute; 52 class TiXmlText; 53 class TiXmlDeclaration; 54 class TiXmlParsingData; 55 42 56 namespace orxonox { 43 57 class Ambient; … … 70 84 class BarrelGun; 71 85 class WeaponStation; 86 87 class ParticleInterface; 88 class HUD; 72 89 } 73 90 … … 77 94 class AudioSource; 78 95 class AudioStream; 79 }80 81 namespace hud {82 class HUD;83 96 } 84 97 … … 112 125 } 113 126 114 namespace particle {115 class ParticleInterface;116 }117 118 127 #endif /* _OrxonoxPrereqs_H__ */ -
code/branches/FICN/src/orxonox/SpaceshipSteering.cc
r612 r708 1 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * ... 23 * Co-authors: 24 * ... 25 * 26 */ 27 28 #include "Ogre.h" 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * ... 23 * Co-authors: 24 * ... 25 * 26 */ 27 28 #include <OgreNode.h> 29 #include <OgreSceneNode.h> 30 31 #include "core/Debug.h" 32 #include "misc/Vector3.h" 29 33 #include "SpaceshipSteering.h" 30 #include <iostream> 31 #include "core/Debug.h" 32 33 using namespace Ogre; 34 35 SpaceshipSteering::SpaceshipSteering(float maxSpeedForward, float 36 maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float 37 maxSpeedLoopRightLeft) { 38 39 COUT(3) << "Info: Steering was loaded" << std::endl; 40 moveForward_ = 0; 41 rotateUp_ = 0; 42 rotateDown_ = 0; 43 rotateRight_ = 0; 44 rotateLeft_ = 0; 45 loopRight_ = 0; 46 loopLeft_ = 0; 47 brakeForward_ = 0; 48 brakeRotate_ = 0; 49 brakeLoop_ = 0; 50 speedForward_ = 0; 51 speedRotateUpDown_ = 0; 52 speedRotateRightLeft_ = 0; 53 speedLoopRightLeft_ = 0; 54 maxSpeedForward_ = maxSpeedForward; 55 maxSpeedRotateUpDown_ = maxSpeedRotateUpDown; 56 maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft; 57 maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft; 58 accelerationForward_ = 0; 59 accelerationRotateUpDown_ = 0; 60 accelerationRotateRightLeft_ = 0; 61 accelerationLoopRightLeft_ = 0; 34 35 namespace orxonox 36 { 37 38 SpaceshipSteering::SpaceshipSteering(float maxSpeedForward, float 39 maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float 40 maxSpeedLoopRightLeft) 41 { 42 43 COUT(3) << "Info: Steering was loaded" << std::endl; 44 moveForward_ = 0; 45 rotateUp_ = 0; 46 rotateDown_ = 0; 47 rotateRight_ = 0; 48 rotateLeft_ = 0; 49 loopRight_ = 0; 50 loopLeft_ = 0; 51 brakeForward_ = 0; 52 brakeRotate_ = 0; 53 brakeLoop_ = 0; 54 speedForward_ = 0; 55 speedRotateUpDown_ = 0; 56 speedRotateRightLeft_ = 0; 57 speedLoopRightLeft_ = 0; 58 maxSpeedForward_ = maxSpeedForward; 59 maxSpeedRotateUpDown_ = maxSpeedRotateUpDown; 60 maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft; 61 maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft; 62 accelerationForward_ = 0; 63 accelerationRotateUpDown_ = 0; 64 accelerationRotateRightLeft_ = 0; 65 accelerationLoopRightLeft_ = 0; 66 } 67 68 void SpaceshipSteering::tick(float time) 69 { 70 71 if(moveForward_ > 0) { 72 accelerationForward_ = moveForward_; 73 if(speedForward_ < maxSpeedForward_) 74 speedForward_ += accelerationForward_*time; 75 if(speedForward_ > maxSpeedForward_) 76 speedForward_ = maxSpeedForward_; 77 } 78 if(moveForward_ <= 0) { 79 accelerationForward_ = brakeForward_; 80 if(speedForward_ > 0) 81 speedForward_ -= accelerationForward_*time; 82 if(speedForward_ < 0) 83 speedForward_ = 0; 84 } 85 86 if(rotateUp_ > 0) { 87 accelerationRotateUpDown_ = rotateUp_; 88 if(speedRotateUpDown_ < maxSpeedRotateUpDown_) 89 speedRotateUpDown_ += accelerationRotateUpDown_*time; 90 if(speedRotateUpDown_ > maxSpeedRotateUpDown_) 91 speedRotateUpDown_ = maxSpeedRotateUpDown_; 92 } 93 if(rotateDown_ > 0) { 94 accelerationRotateUpDown_ = rotateDown_; 95 if(speedRotateUpDown_ > -maxSpeedRotateUpDown_) 96 speedRotateUpDown_ -= accelerationRotateUpDown_*time; 97 if(speedRotateUpDown_ < -maxSpeedRotateUpDown_) 98 speedRotateUpDown_ = -maxSpeedRotateUpDown_; 99 } 100 if(rotateUp_ == 0 && rotateDown_ == 0) { 101 accelerationRotateUpDown_ = brakeRotate_; 102 if(speedRotateUpDown_ > 0) 103 speedRotateUpDown_ -= accelerationRotateUpDown_*time; 104 if(speedRotateUpDown_ < 0) 105 speedRotateUpDown_ += accelerationRotateUpDown_*time; 106 if(abs(speedRotateUpDown_)<accelerationRotateUpDown_*time) 107 speedRotateUpDown_ = 0; 108 } 109 110 if(rotateRight_ > 0) { 111 accelerationRotateRightLeft_ = rotateRight_; 112 if(speedRotateRightLeft_ > -maxSpeedRotateRightLeft_) 113 speedRotateRightLeft_ -= accelerationRotateRightLeft_*time; 114 if(speedRotateRightLeft_ < -maxSpeedRotateRightLeft_) 115 speedRotateRightLeft_ = -maxSpeedRotateRightLeft_; 116 } 117 if(rotateLeft_ > 0) { 118 accelerationRotateRightLeft_ = rotateLeft_; 119 if(speedRotateRightLeft_ < maxSpeedRotateRightLeft_) 120 speedRotateRightLeft_ += accelerationRotateRightLeft_*time; 121 if(speedRotateRightLeft_ > maxSpeedRotateRightLeft_) 122 speedRotateRightLeft_ = maxSpeedRotateRightLeft_; 123 } 124 if(rotateRight_ == 0 && rotateLeft_ == 0) { 125 accelerationRotateRightLeft_ = brakeRotate_; 126 if(speedRotateRightLeft_ > 0) 127 speedRotateRightLeft_ -= accelerationRotateRightLeft_*time; 128 if(speedRotateRightLeft_ < 0) 129 speedRotateRightLeft_ += accelerationRotateRightLeft_*time; 130 if(abs(speedRotateRightLeft_)<accelerationRotateRightLeft_*time) 131 speedRotateRightLeft_ = 0; 132 } 133 134 if(loopRight_ > 0) { 135 accelerationLoopRightLeft_ = loopRight_; 136 if(speedLoopRightLeft_ < maxSpeedLoopRightLeft_) 137 speedLoopRightLeft_ += accelerationLoopRightLeft_*time; 138 if(speedLoopRightLeft_ > maxSpeedLoopRightLeft_) 139 speedLoopRightLeft_ = maxSpeedLoopRightLeft_; 140 } 141 if(loopLeft_ > 0) { 142 accelerationLoopRightLeft_ = loopLeft_; 143 if(speedLoopRightLeft_ > -maxSpeedLoopRightLeft_) 144 speedLoopRightLeft_ -= accelerationLoopRightLeft_*time; 145 if(speedLoopRightLeft_ < -maxSpeedLoopRightLeft_) 146 speedLoopRightLeft_ = -maxSpeedLoopRightLeft_; 147 } 148 if(loopLeft_ == 0 && loopRight_ == 0) { 149 accelerationLoopRightLeft_ = brakeLoop_; 150 if(speedLoopRightLeft_ > 0) 151 speedLoopRightLeft_ -= accelerationLoopRightLeft_*time; 152 if(speedLoopRightLeft_ < 0) 153 speedLoopRightLeft_ += accelerationLoopRightLeft_*time; 154 if(abs(speedLoopRightLeft_)<accelerationLoopRightLeft_*time) 155 speedLoopRightLeft_ = 0; 156 } 157 158 Vector3 transVector = Vector3::ZERO; 159 transVector.z = 1; 160 steeringNode_->translate(transVector*speedForward_*time, 161 Ogre::SceneNode::TS_LOCAL); 162 steeringNode_->pitch(Degree(speedRotateUpDown_*time), 163 Ogre::SceneNode::TS_LOCAL); 164 steeringNode_->yaw(Degree(speedRotateRightLeft_*time), 165 Ogre::SceneNode::TS_LOCAL); 166 steeringNode_->roll(Degree(speedLoopRightLeft_*time), 167 Ogre::SceneNode::TS_LOCAL); 168 169 } 170 171 void SpaceshipSteering::moveForward(float moveForward) { 172 moveForward_ = moveForward; 173 } 174 175 void SpaceshipSteering::rotateUp(float rotateUp) { 176 rotateUp_ = rotateUp; 177 } 178 179 void SpaceshipSteering::rotateDown(float rotateDown) { 180 rotateDown_ = rotateDown; 181 } 182 183 void SpaceshipSteering::rotateLeft(float rotateLeft) { 184 rotateLeft_ = rotateLeft; 185 } 186 187 void SpaceshipSteering::rotateRight(float rotateRight) { 188 rotateRight_ = rotateRight; 189 } 190 191 void SpaceshipSteering::loopLeft(float loopLeft) { 192 loopLeft_ = loopLeft; 193 } 194 195 void SpaceshipSteering::loopRight(float loopRight) { 196 loopRight_ = loopRight; 197 } 198 199 void SpaceshipSteering::brakeForward(float brakeForward) { 200 brakeForward_ = brakeForward; 201 } 202 203 void SpaceshipSteering::brakeRotate(float brakeRotate) { 204 brakeRotate_ = brakeRotate; 205 } 206 207 void SpaceshipSteering::brakeLoop(float brakeLoop) { 208 brakeLoop_ = brakeLoop; 209 } 210 211 void SpaceshipSteering::maxSpeedForward(float maxSpeedForward) { 212 maxSpeedForward_ = maxSpeedForward; 213 } 214 215 void SpaceshipSteering::maxSpeedRotateUpDown(float maxSpeedRotateUpDown) { 216 maxSpeedRotateUpDown_ = maxSpeedRotateUpDown; 217 } 218 219 void SpaceshipSteering::maxSpeedRotateRightLeft(float maxSpeedRotateRightLeft) { 220 maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft; 221 } 222 223 void SpaceshipSteering::maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft) { 224 maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft; 225 } 226 227 void SpaceshipSteering::addNode(Ogre::SceneNode *steeringNode) { 228 steeringNode_ = steeringNode; 229 } 230 62 231 } 63 64 void SpaceshipSteering::tick(float time) {65 66 if(moveForward_ > 0) {67 accelerationForward_ = moveForward_;68 if(speedForward_ < maxSpeedForward_)69 speedForward_ += accelerationForward_*time;70 if(speedForward_ > maxSpeedForward_)71 speedForward_ = maxSpeedForward_;72 }73 if(moveForward_ <= 0) {74 accelerationForward_ = brakeForward_;75 if(speedForward_ > 0)76 speedForward_ -= accelerationForward_*time;77 if(speedForward_ < 0)78 speedForward_ = 0;79 }80 81 if(rotateUp_ > 0) {82 accelerationRotateUpDown_ = rotateUp_;83 if(speedRotateUpDown_ < maxSpeedRotateUpDown_)84 speedRotateUpDown_ += accelerationRotateUpDown_*time;85 if(speedRotateUpDown_ > maxSpeedRotateUpDown_)86 speedRotateUpDown_ = maxSpeedRotateUpDown_;87 }88 if(rotateDown_ > 0) {89 accelerationRotateUpDown_ = rotateDown_;90 if(speedRotateUpDown_ > -maxSpeedRotateUpDown_)91 speedRotateUpDown_ -= accelerationRotateUpDown_*time;92 if(speedRotateUpDown_ < -maxSpeedRotateUpDown_)93 speedRotateUpDown_ = -maxSpeedRotateUpDown_;94 }95 if(rotateUp_ == 0 && rotateDown_ == 0) {96 accelerationRotateUpDown_ = brakeRotate_;97 if(speedRotateUpDown_ > 0)98 speedRotateUpDown_ -= accelerationRotateUpDown_*time;99 if(speedRotateUpDown_ < 0)100 speedRotateUpDown_ += accelerationRotateUpDown_*time;101 if(abs(speedRotateUpDown_)<accelerationRotateUpDown_*time)102 speedRotateUpDown_ = 0;103 }104 105 if(rotateRight_ > 0) {106 accelerationRotateRightLeft_ = rotateRight_;107 if(speedRotateRightLeft_ > -maxSpeedRotateRightLeft_)108 speedRotateRightLeft_ -= accelerationRotateRightLeft_*time;109 if(speedRotateRightLeft_ < -maxSpeedRotateRightLeft_)110 speedRotateRightLeft_ = -maxSpeedRotateRightLeft_;111 }112 if(rotateLeft_ > 0) {113 accelerationRotateRightLeft_ = rotateLeft_;114 if(speedRotateRightLeft_ < maxSpeedRotateRightLeft_)115 speedRotateRightLeft_ += accelerationRotateRightLeft_*time;116 if(speedRotateRightLeft_ > maxSpeedRotateRightLeft_)117 speedRotateRightLeft_ = maxSpeedRotateRightLeft_;118 }119 if(rotateRight_ == 0 && rotateLeft_ == 0) {120 accelerationRotateRightLeft_ = brakeRotate_;121 if(speedRotateRightLeft_ > 0)122 speedRotateRightLeft_ -= accelerationRotateRightLeft_*time;123 if(speedRotateRightLeft_ < 0)124 speedRotateRightLeft_ += accelerationRotateRightLeft_*time;125 if(abs(speedRotateRightLeft_)<accelerationRotateRightLeft_*time)126 speedRotateRightLeft_ = 0;127 }128 129 if(loopRight_ > 0) {130 accelerationLoopRightLeft_ = loopRight_;131 if(speedLoopRightLeft_ < maxSpeedLoopRightLeft_)132 speedLoopRightLeft_ += accelerationLoopRightLeft_*time;133 if(speedLoopRightLeft_ > maxSpeedLoopRightLeft_)134 speedLoopRightLeft_ = maxSpeedLoopRightLeft_;135 }136 if(loopLeft_ > 0) {137 accelerationLoopRightLeft_ = loopLeft_;138 if(speedLoopRightLeft_ > -maxSpeedLoopRightLeft_)139 speedLoopRightLeft_ -= accelerationLoopRightLeft_*time;140 if(speedLoopRightLeft_ < -maxSpeedLoopRightLeft_)141 speedLoopRightLeft_ = -maxSpeedLoopRightLeft_;142 }143 if(loopLeft_ == 0 && loopRight_ == 0) {144 accelerationLoopRightLeft_ = brakeLoop_;145 if(speedLoopRightLeft_ > 0)146 speedLoopRightLeft_ -= accelerationLoopRightLeft_*time;147 if(speedLoopRightLeft_ < 0)148 speedLoopRightLeft_ += accelerationLoopRightLeft_*time;149 if(abs(speedLoopRightLeft_)<accelerationLoopRightLeft_*time)150 speedLoopRightLeft_ = 0;151 }152 153 Vector3 transVector = Vector3::ZERO;154 transVector.z = 1;155 steeringNode_->translate(transVector*speedForward_*time,156 Node::TS_LOCAL);157 steeringNode_->pitch(Degree(speedRotateUpDown_*time),158 Node::TS_LOCAL);159 steeringNode_->yaw(Degree(speedRotateRightLeft_*time),160 Node::TS_LOCAL);161 steeringNode_->roll(Degree(speedLoopRightLeft_*time),162 Node::TS_LOCAL);163 164 }165 166 void SpaceshipSteering::moveForward(float moveForward) {167 moveForward_ = moveForward;168 }169 170 void SpaceshipSteering::rotateUp(float rotateUp) {171 rotateUp_ = rotateUp;172 }173 174 void SpaceshipSteering::rotateDown(float rotateDown) {175 rotateDown_ = rotateDown;176 }177 178 void SpaceshipSteering::rotateLeft(float rotateLeft) {179 rotateLeft_ = rotateLeft;180 }181 182 void SpaceshipSteering::rotateRight(float rotateRight) {183 rotateRight_ = rotateRight;184 }185 186 void SpaceshipSteering::loopLeft(float loopLeft) {187 loopLeft_ = loopLeft;188 }189 190 void SpaceshipSteering::loopRight(float loopRight) {191 loopRight_ = loopRight;192 }193 194 void SpaceshipSteering::brakeForward(float brakeForward) {195 brakeForward_ = brakeForward;196 }197 198 void SpaceshipSteering::brakeRotate(float brakeRotate) {199 brakeRotate_ = brakeRotate;200 }201 202 void SpaceshipSteering::brakeLoop(float brakeLoop) {203 brakeLoop_ = brakeLoop;204 }205 206 void SpaceshipSteering::maxSpeedForward(float maxSpeedForward) {207 maxSpeedForward_ = maxSpeedForward;208 }209 210 void SpaceshipSteering::maxSpeedRotateUpDown(float maxSpeedRotateUpDown) {211 maxSpeedRotateUpDown_ = maxSpeedRotateUpDown;212 }213 214 void SpaceshipSteering::maxSpeedRotateRightLeft(float maxSpeedRotateRightLeft) {215 maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft;216 }217 218 void SpaceshipSteering::maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft) {219 maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft;220 }221 222 void SpaceshipSteering::addNode(Ogre::SceneNode *steeringNode) {223 steeringNode_ = steeringNode;224 } -
code/branches/FICN/src/orxonox/SpaceshipSteering.h
r673 r708 4 4 #include "OgrePrerequisites.h" 5 5 6 7 class SpaceshipSteering 6 namespace orxonox 8 7 { 8 class SpaceshipSteering 9 { 9 10 public: 10 11 SpaceshipSteering(float maxSpeedForward, float maxSpeedRotateUpDown, 11 float maxSpeedRotateRightLeft, float maxSpeedLoopRightLeft);12 float maxSpeedRotateRightLeft, float maxSpeedLoopRightLeft); 12 13 void tick(float time); 13 14 void moveForward(float moveForward); … … 57 58 float accelerationLoopRightLeft_; 58 59 59 }; 60 }; 61 } 60 62 61 63 -
code/branches/FICN/src/orxonox/core/ArgReader.cc
r668 r708 45 45 } 46 46 47 void ArgReader::checkArgument( std::string option, std::string &string, bool must)47 void ArgReader::checkArgument(String option, String &string, bool must) 48 48 { 49 49 int argpos = checkOption(option) + 1; … … 62 62 } 63 63 64 void ArgReader::checkArgument( std::string option, int &integer, bool must)64 void ArgReader::checkArgument(String option, int &integer, bool must) 65 65 { 66 66 int argpos = checkOption(option) + 1; … … 78 78 } 79 79 80 void ArgReader::checkArgument( std::string option, float &floating, bool must)80 void ArgReader::checkArgument(String option, float &floating, bool must) 81 81 { 82 82 int argpos = checkOption(option) + 1; … … 94 94 } 95 95 96 int ArgReader::checkOption( std::string option)96 int ArgReader::checkOption(String option) 97 97 { 98 98 for(int i = 1; i < counter_; i++) -
code/branches/FICN/src/orxonox/core/ArgReader.h
r682 r708 35 35 #define _ArgReader_H__ 36 36 37 #include <string>37 #include "CorePrereqs.h" 38 38 39 #include " CorePrereqs.h"39 #include "misc/String.h" 40 40 41 41 namespace orxonox { … … 45 45 public: 46 46 ArgReader(int argc, char **argv); 47 void checkArgument( std::string option, std::string& string, bool must=false);48 void checkArgument( std::string option, int& integer, bool must=false);49 void checkArgument( std::string option, float& floating, bool must=false);47 void checkArgument(String option, String& string, bool must=false); 48 void checkArgument(String option, int& integer, bool must=false); 49 void checkArgument(String option, float& floating, bool must=false); 50 50 bool errorHandling(); 51 51 private: 52 int checkOption( std::string option);52 int checkOption(String option); 53 53 54 54 private: … … 56 56 char **arguments_; 57 57 bool fail_; 58 std::string errorStr_;58 String errorStr_; 59 59 }; 60 60 -
code/branches/FICN/src/orxonox/core/ClassFactory.h
r704 r708 36 36 #define _ClassFactory_H__ 37 37 38 #include <string>39 40 38 #include "CorePrereqs.h" 41 39 40 #include "misc/String.h" 42 41 #include "Factory.h" 43 42 #include "Identifier.h" … … 54 53 { 55 54 public: 56 static bool create(const std::string& name);55 static bool create(const String& name); 57 56 BaseObject* fabricate(); 58 57 … … 70 69 */ 71 70 template <class T> 72 bool ClassFactory<T>::create(const std::string& name)71 bool ClassFactory<T>::create(const String& name) 73 72 { 74 73 COUT(4) << "*** Create entry for " << name << " in Factory." << std::endl; -
code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc
r705 r708 28 28 #include <fstream> 29 29 30 #include " ../../misc/Tokenizer.h"31 #include " ../../misc/String2Number.h"30 #include "misc/Tokenizer.h" 31 #include "misc/String2Number.h" 32 32 #include "ConfigValueContainer.h" 33 33 … … 43 43 @param defvalue The default-value 44 44 */ 45 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, int defvalue)45 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, int defvalue) 46 46 { 47 47 this->bAddedDescription_ = false; … … 53 53 this->searchConfigFileLine(); // Search the entry in the config-file 54 54 55 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry56 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 57 this->resetConfigFileEntry(); // The conversion failed 58 } 59 60 /** 61 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 62 @param value This is only needed to determine the right type. 63 @param classname The name of the class the variable belongs to 64 @param varname The name of the variable 65 @param defvalue The default-value 66 */ 67 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned int defvalue)55 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 56 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 57 this->resetConfigFileEntry(); // The conversion failed 58 } 59 60 /** 61 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 62 @param value This is only needed to determine the right type. 63 @param classname The name of the class the variable belongs to 64 @param varname The name of the variable 65 @param defvalue The default-value 66 */ 67 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, unsigned int defvalue) 68 68 { 69 69 this->bAddedDescription_ = false; … … 75 75 this->searchConfigFileLine(); // Search the entry in the config-file 76 76 77 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry78 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 79 this->resetConfigFileEntry(); // The conversion failed 80 } 81 82 /** 83 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 84 @param value This is only needed to determine the right type. 85 @param classname The name of the class the variable belongs to 86 @param varname The name of the variable 87 @param defvalue The default-value 88 */ 89 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, char defvalue)77 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 78 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 79 this->resetConfigFileEntry(); // The conversion failed 80 } 81 82 /** 83 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 84 @param value This is only needed to determine the right type. 85 @param classname The name of the class the variable belongs to 86 @param varname The name of the variable 87 @param defvalue The default-value 88 */ 89 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, char defvalue) 90 90 { 91 91 this->bAddedDescription_ = false; … … 97 97 this->searchConfigFileLine(); // Search the entry in the config-file 98 98 99 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry100 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 101 this->resetConfigFileEntry(); // The conversion failed 102 } 103 104 /** 105 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 106 @param value This is only needed to determine the right type. 107 @param classname The name of the class the variable belongs to 108 @param varname The name of the variable 109 @param defvalue The default-value 110 */ 111 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned char defvalue)99 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 100 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 101 this->resetConfigFileEntry(); // The conversion failed 102 } 103 104 /** 105 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 106 @param value This is only needed to determine the right type. 107 @param classname The name of the class the variable belongs to 108 @param varname The name of the variable 109 @param defvalue The default-value 110 */ 111 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, unsigned char defvalue) 112 112 { 113 113 this->bAddedDescription_ = false; … … 119 119 this->searchConfigFileLine(); // Search the entry in the config-file 120 120 121 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry122 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 123 this->resetConfigFileEntry(); // The conversion failed 124 } 125 126 /** 127 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 128 @param value This is only needed to determine the right type. 129 @param classname The name of the class the variable belongs to 130 @param varname The name of the variable 131 @param defvalue The default-value 132 */ 133 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, float defvalue)121 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 122 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 123 this->resetConfigFileEntry(); // The conversion failed 124 } 125 126 /** 127 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 128 @param value This is only needed to determine the right type. 129 @param classname The name of the class the variable belongs to 130 @param varname The name of the variable 131 @param defvalue The default-value 132 */ 133 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, float defvalue) 134 134 { 135 135 this->bAddedDescription_ = false; … … 141 141 this->searchConfigFileLine(); // Search the entry in the config-file 142 142 143 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry144 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 145 this->resetConfigFileEntry(); // The conversion failed 146 } 147 148 /** 149 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 150 @param value This is only needed to determine the right type. 151 @param classname The name of the class the variable belongs to 152 @param varname The name of the variable 153 @param defvalue The default-value 154 */ 155 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, double defvalue)143 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 144 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 145 this->resetConfigFileEntry(); // The conversion failed 146 } 147 148 /** 149 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 150 @param value This is only needed to determine the right type. 151 @param classname The name of the class the variable belongs to 152 @param varname The name of the variable 153 @param defvalue The default-value 154 */ 155 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, double defvalue) 156 156 { 157 157 this->bAddedDescription_ = false; … … 163 163 this->searchConfigFileLine(); // Search the entry in the config-file 164 164 165 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry166 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 167 this->resetConfigFileEntry(); // The conversion failed 168 } 169 170 /** 171 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 172 @param value This is only needed to determine the right type. 173 @param classname The name of the class the variable belongs to 174 @param varname The name of the variable 175 @param defvalue The default-value 176 */ 177 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, long double defvalue)165 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 166 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 167 this->resetConfigFileEntry(); // The conversion failed 168 } 169 170 /** 171 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 172 @param value This is only needed to determine the right type. 173 @param classname The name of the class the variable belongs to 174 @param varname The name of the variable 175 @param defvalue The default-value 176 */ 177 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, long double defvalue) 178 178 { 179 179 this->bAddedDescription_ = false; … … 185 185 this->searchConfigFileLine(); // Search the entry in the config-file 186 186 187 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry188 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 189 this->resetConfigFileEntry(); // The conversion failed 190 } 191 192 /** 193 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 194 @param value This is only needed to determine the right type. 195 @param classname The name of the class the variable belongs to 196 @param varname The name of the variable 197 @param defvalue The default-value 198 */ 199 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, bool defvalue)187 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 188 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 189 this->resetConfigFileEntry(); // The conversion failed 190 } 191 192 /** 193 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 194 @param value This is only needed to determine the right type. 195 @param classname The name of the class the variable belongs to 196 @param varname The name of the variable 197 @param defvalue The default-value 198 */ 199 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, bool defvalue) 200 200 { 201 201 this->bAddedDescription_ = false; … … 211 211 212 212 this->searchConfigFileLine(); // Search the entry in the config-file 213 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry214 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 215 this->resetConfigFileEntry(); // The conversion failed 216 } 217 218 /** 219 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 220 @param value This is only needed to determine the right type. 221 @param classname The name of the class the variable belongs to 222 @param varname The name of the variable 223 @param defvalue The default-value 224 */ 225 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, const std::string& defvalue)226 { 227 this->bAddedDescription_ = false; 228 this->classname_ = classname; 229 this->varname_ = varname; 230 this->type_ = String;213 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 214 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 215 this->resetConfigFileEntry(); // The conversion failed 216 } 217 218 /** 219 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 220 @param value This is only needed to determine the right type. 221 @param classname The name of the class the variable belongs to 222 @param varname The name of the variable 223 @param defvalue The default-value 224 */ 225 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, const String& defvalue) 226 { 227 this->bAddedDescription_ = false; 228 this->classname_ = classname; 229 this->varname_ = varname; 230 this->type_ = _String; 231 231 232 232 this->defvalueString_ = "\"" + defvalue + "\""; // Convert the string to a "config-file-string" with quotes 233 233 this->searchConfigFileLine(); // Search the entry in the config-file 234 std::string valueString = this->parseValueString(false); // Parses the value string from the config-file-entry235 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 236 this->resetConfigFileEntry(); // The conversion failed 237 } 238 239 /** 240 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 241 @param value This is only needed to determine the right type. 242 @param classname The name of the class the variable belongs to 243 @param varname The name of the variable 244 @param defvalue The default-value 245 */ 246 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, const char* defvalue)234 String valueString = this->parseValueString(false); // Parses the value string from the config-file-entry 235 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 236 this->resetConfigFileEntry(); // The conversion failed 237 } 238 239 /** 240 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 241 @param value This is only needed to determine the right type. 242 @param classname The name of the class the variable belongs to 243 @param varname The name of the variable 244 @param defvalue The default-value 245 */ 246 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, const char* defvalue) 247 247 { 248 248 this->bAddedDescription_ = false; … … 251 251 this->type_ = ConstChar; 252 252 253 this->defvalueString_ = "\"" + std::string(defvalue) + "\""; // Convert the string to a "config-file-string" with quotes254 this->searchConfigFileLine(); // Search the entry in the config-file 255 std::string valueString = this->parseValueString(false); // Parses the value string from the config-file-entry256 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 257 this->resetConfigFileEntry(); // The conversion failed 258 } 259 260 /** 261 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 262 @param value This is only needed to determine the right type. 263 @param classname The name of the class the variable belongs to 264 @param varname The name of the variable 265 @param defvalue The default-value 266 */ 267 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector2 defvalue)268 { 269 this->bAddedDescription_ = false; 270 this->classname_ = classname; 271 this->varname_ = varname; 272 this->type_ = Vector2;253 this->defvalueString_ = "\"" + String(defvalue) + "\""; // Convert the string to a "config-file-string" with quotes 254 this->searchConfigFileLine(); // Search the entry in the config-file 255 String valueString = this->parseValueString(false); // Parses the value string from the config-file-entry 256 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 257 this->resetConfigFileEntry(); // The conversion failed 258 } 259 260 /** 261 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 262 @param value This is only needed to determine the right type. 263 @param classname The name of the class the variable belongs to 264 @param varname The name of the variable 265 @param defvalue The default-value 266 */ 267 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, Vector2 defvalue) 268 { 269 this->bAddedDescription_ = false; 270 this->classname_ = classname; 271 this->varname_ = varname; 272 this->type_ = _Vector2; 273 273 274 274 // Try to convert the default-value from Vector2 to string … … 280 280 281 281 this->searchConfigFileLine(); // Search the entry in the config-file 282 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry283 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 284 this->resetConfigFileEntry(); // The conversion failed 285 } 286 287 /** 288 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 289 @param value This is only needed to determine the right type. 290 @param classname The name of the class the variable belongs to 291 @param varname The name of the variable 292 @param defvalue The default-value 293 */ 294 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector3 defvalue)295 { 296 this->bAddedDescription_ = false; 297 this->classname_ = classname; 298 this->varname_ = varname; 299 this->type_ = Vector3;282 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 283 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 284 this->resetConfigFileEntry(); // The conversion failed 285 } 286 287 /** 288 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 289 @param value This is only needed to determine the right type. 290 @param classname The name of the class the variable belongs to 291 @param varname The name of the variable 292 @param defvalue The default-value 293 */ 294 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, Vector3 defvalue) 295 { 296 this->bAddedDescription_ = false; 297 this->classname_ = classname; 298 this->varname_ = varname; 299 this->type_ = _Vector3; 300 300 301 301 // Try to convert the default-value from Vector3 to string … … 307 307 308 308 this->searchConfigFileLine(); // Search the entry in the config-file 309 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry310 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 311 this->resetConfigFileEntry(); // The conversion failed 312 } 313 314 /** 315 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 316 @param value This is only needed to determine the right type. 317 @param classname The name of the class the variable belongs to 318 @param varname The name of the variable 319 @param defvalue The default-value 320 */ 321 ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::ColourValue defvalue)322 { 323 this->bAddedDescription_ = false; 324 this->classname_ = classname; 325 this->varname_ = varname; 326 this->type_ = ColourValue;309 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 310 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 311 this->resetConfigFileEntry(); // The conversion failed 312 } 313 314 /** 315 @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable. 316 @param value This is only needed to determine the right type. 317 @param classname The name of the class the variable belongs to 318 @param varname The name of the variable 319 @param defvalue The default-value 320 */ 321 ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, ColourValue defvalue) 322 { 323 this->bAddedDescription_ = false; 324 this->classname_ = classname; 325 this->varname_ = varname; 326 this->type_ = _ColourValue; 327 327 328 328 // Try to convert the default-value from ColourValue to string … … 334 334 335 335 this->searchConfigFileLine(); // Search the entry in the config-file 336 std::string valueString = this->parseValueString(); // Parses the value string from the config-file-entry337 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 338 this->resetConfigFileEntry(); // The conversion failed 339 } 340 341 /** 342 @brief Parses a given std::string into a value of the type of the associated variable and assigns it.343 @param input The string to convert 344 @return True if the string was successfully parsed 345 */ 346 bool ConfigValueContainer::parseSting(const std::string& input)336 String valueString = this->parseValueString(); // Parses the value string from the config-file-entry 337 if (!this->parseSting(valueString, defvalue)) // Try to convert the string to a value 338 this->resetConfigFileEntry(); // The conversion failed 339 } 340 341 /** 342 @brief Parses a given String into a value of the type of the associated variable and assigns it. 343 @param input The string to convert 344 @return True if the string was successfully parsed 345 */ 346 bool ConfigValueContainer::parseSting(const String& input) 347 347 { 348 348 if (this->type_ == ConfigValueContainer::Int) … … 362 362 else if (this->type_ == ConfigValueContainer::Bool) 363 363 return this->parseSting(input, this->value_.value_bool_); 364 else if (this->type_ == ConfigValueContainer:: String)364 else if (this->type_ == ConfigValueContainer::_String) 365 365 return this->parseSting(input, this->value_string_); 366 366 else if (this->type_ == ConfigValueContainer::ConstChar) 367 367 return this->parseSting(input, this->value_string_); 368 else if (this->type_ == ConfigValueContainer:: Vector2)368 else if (this->type_ == ConfigValueContainer::_Vector2) 369 369 return this->parseSting(input, this->value_vector2_); 370 else if (this->type_ == ConfigValueContainer:: Vector3)370 else if (this->type_ == ConfigValueContainer::_Vector3) 371 371 return this->parseSting(input, this->value_vector3_); 372 else if (this->type_ == ConfigValueContainer:: ColourValue)372 else if (this->type_ == ConfigValueContainer::_ColourValue) 373 373 return this->parseSting(input, this->value_colourvalue_); 374 374 … … 377 377 378 378 /** 379 @brief Parses a given std::string into a value of the type int and assigns it to the right variable. If the conversion failed, the default-value gets assigned.380 @param input The string to convert 381 @param defvalue The default-value 382 @return True if the string was successfully parsed 383 */ 384 bool ConfigValueContainer::parseSting(const std::string& input, int defvalue)379 @brief Parses a given String into a value of the type int and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 380 @param input The string to convert 381 @param defvalue The default-value 382 @return True if the string was successfully parsed 383 */ 384 bool ConfigValueContainer::parseSting(const String& input, int defvalue) 385 385 { 386 386 return string2Number(this->value_.value_int_, input, defvalue); … … 388 388 389 389 /** 390 @brief Parses a given std::string into a value of the type unsigned int and assigns it to the right variable. If the conversion failed, the default-value gets assigned.391 @param input The string to convert 392 @param defvalue The default-value 393 @return True if the string was successfully parsed 394 */ 395 bool ConfigValueContainer::parseSting(const std::string& input, unsigned int defvalue)390 @brief Parses a given String into a value of the type unsigned int and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 391 @param input The string to convert 392 @param defvalue The default-value 393 @return True if the string was successfully parsed 394 */ 395 bool ConfigValueContainer::parseSting(const String& input, unsigned int defvalue) 396 396 { 397 397 return string2Number(this->value_.value_uint_, input, defvalue); … … 399 399 400 400 /** 401 @brief Parses a given std::string into a value of the type char and assigns it to the right variable. If the conversion failed, the default-value gets assigned.402 @param input The string to convert 403 @param defvalue The default-value 404 @return True if the string was successfully parsed 405 */ 406 bool ConfigValueContainer::parseSting(const std::string& input, char defvalue)401 @brief Parses a given String into a value of the type char and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 402 @param input The string to convert 403 @param defvalue The default-value 404 @return True if the string was successfully parsed 405 */ 406 bool ConfigValueContainer::parseSting(const String& input, char defvalue) 407 407 { 408 408 // I used value_int_ instead of value_char_ to avoid number <-> char confusion in the config-file … … 411 411 412 412 /** 413 @brief Parses a given std::string into a value of the type unsigned char and assigns it to the right variable. If the conversion failed, the default-value gets assigned.414 @param input The string to convert 415 @param defvalue The default-value 416 @return True if the string was successfully parsed 417 */ 418 bool ConfigValueContainer::parseSting(const std::string& input, unsigned char defvalue)413 @brief Parses a given String into a value of the type unsigned char and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 414 @param input The string to convert 415 @param defvalue The default-value 416 @return True if the string was successfully parsed 417 */ 418 bool ConfigValueContainer::parseSting(const String& input, unsigned char defvalue) 419 419 { 420 420 // I used value_uint_ instead of value_uchar_ to avoid number <-> char confusion in the config-file … … 423 423 424 424 /** 425 @brief Parses a given std::string into a value of the type float and assigns it to the right variable. If the conversion failed, the default-value gets assigned.426 @param input The string to convert 427 @param defvalue The default-value 428 @return True if the string was successfully parsed 429 */ 430 bool ConfigValueContainer::parseSting(const std::string& input, float defvalue)425 @brief Parses a given String into a value of the type float and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 426 @param input The string to convert 427 @param defvalue The default-value 428 @return True if the string was successfully parsed 429 */ 430 bool ConfigValueContainer::parseSting(const String& input, float defvalue) 431 431 { 432 432 return string2Number(this->value_.value_float_, input, defvalue); … … 434 434 435 435 /** 436 @brief Parses a given std::string into a value of the type double and assigns it to the right variable. If the conversion failed, the default-value gets assigned.437 @param input The string to convert 438 @param defvalue The default-value 439 @return True if the string was successfully parsed 440 */ 441 bool ConfigValueContainer::parseSting(const std::string& input, double defvalue)436 @brief Parses a given String into a value of the type double and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 437 @param input The string to convert 438 @param defvalue The default-value 439 @return True if the string was successfully parsed 440 */ 441 bool ConfigValueContainer::parseSting(const String& input, double defvalue) 442 442 { 443 443 return string2Number(this->value_.value_double_, input, defvalue); … … 445 445 446 446 /** 447 @brief Parses a given std::string into a value of the type long double and assigns it to the right variable. If the conversion failed, the default-value gets assigned.448 @param input The string to convert 449 @param defvalue The default-value 450 @return True if the string was successfully parsed 451 */ 452 bool ConfigValueContainer::parseSting(const std::string& input, long double defvalue)447 @brief Parses a given String into a value of the type long double and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 448 @param input The string to convert 449 @param defvalue The default-value 450 @return True if the string was successfully parsed 451 */ 452 bool ConfigValueContainer::parseSting(const String& input, long double defvalue) 453 453 { 454 454 return string2Number(this->value_.value_long_double_, input, defvalue); … … 456 456 457 457 /** 458 @brief Parses a given std::string into a value of the type bool and assigns it to the right variable. If the conversion failed, the default-value gets assigned.459 @param input The string to convert 460 @param defvalue The default-value 461 @return True if the string was successfully parsed 462 */ 463 bool ConfigValueContainer::parseSting(const std::string& input, bool defvalue)458 @brief Parses a given String into a value of the type bool and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 459 @param input The string to convert 460 @param defvalue The default-value 461 @return True if the string was successfully parsed 462 */ 463 bool ConfigValueContainer::parseSting(const String& input, bool defvalue) 464 464 { 465 465 // Try to parse the value-string - is it a word? … … 484 484 485 485 /** 486 @brief Parses a given std::string into a value of the type std::string and assigns it to the right variable. If the conversion failed, the default-value gets assigned.487 @param input The string to convert 488 @param defvalue The default-value 489 @return True if the string was successfully parsed 490 */ 491 bool ConfigValueContainer::parseSting(const std::string& input, const std::string& defvalue)486 @brief Parses a given String into a value of the type String and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 487 @param input The string to convert 488 @param defvalue The default-value 489 @return True if the string was successfully parsed 490 */ 491 bool ConfigValueContainer::parseSting(const String& input, const String& defvalue) 492 492 { 493 493 // Strip the quotes … … 509 509 510 510 /** 511 @brief Parses a given std::string into a value of the type const char* and assigns it to the right variable. If the conversion failed, the default-value gets assigned.512 @param input The string to convert 513 @param defvalue The default-value 514 @return True if the string was successfully parsed 515 */ 516 bool ConfigValueContainer::parseSting(const std::string& input, const char* defvalue)511 @brief Parses a given String into a value of the type const char* and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 512 @param input The string to convert 513 @param defvalue The default-value 514 @return True if the string was successfully parsed 515 */ 516 bool ConfigValueContainer::parseSting(const String& input, const char* defvalue) 517 517 { 518 518 // Strip the quotes … … 534 534 535 535 /** 536 @brief Parses a given std::string into a value of the type Ogre::Vector2 and assigns it to the right variable. If the conversion failed, the default-value gets assigned.537 @param input The string to convert 538 @param defvalue The default-value 539 @return True if the string was successfully parsed 540 */ 541 bool ConfigValueContainer::parseSting(const std::string& input, const Ogre::Vector2& defvalue)536 @brief Parses a given String into a value of the type _Vector2 and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 537 @param input The string to convert 538 @param defvalue The default-value 539 @return True if the string was successfully parsed 540 */ 541 bool ConfigValueContainer::parseSting(const String& input, const Vector2& defvalue) 542 542 { 543 543 // Strip the value-string … … 548 548 if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2) 549 549 { 550 std::vector< std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");550 std::vector<String> tokens = tokenize(input.substr(pos1, pos2 - pos1), ","); 551 551 if (!string2Number(this->value_vector2_.x, tokens[0], defvalue.x)) 552 552 { … … 568 568 569 569 /** 570 @brief Parses a given std::string into a value of the type Ogre::Vector3 and assigns it to the right variable. If the conversion failed, the default-value gets assigned.571 @param input The string to convert 572 @param defvalue The default-value 573 @return True if the string was successfully parsed 574 */ 575 bool ConfigValueContainer::parseSting(const std::string& input, const Ogre::Vector3& defvalue)570 @brief Parses a given String into a value of the type Vector3 and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 571 @param input The string to convert 572 @param defvalue The default-value 573 @return True if the string was successfully parsed 574 */ 575 bool ConfigValueContainer::parseSting(const String& input, const Vector3& defvalue) 576 576 { 577 577 // Strip the value-string … … 582 582 if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2) 583 583 { 584 std::vector< std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");584 std::vector<String> tokens = tokenize(input.substr(pos1, pos2 - pos1), ","); 585 585 if (!string2Number(this->value_vector3_.x, tokens[0], defvalue.x)) 586 586 { … … 607 607 608 608 /** 609 @brief Parses a given std::string into a value of the type Ogre::ColourValue and assigns it to the right variable. If the conversion failed, the default-value gets assigned.610 @param input The string to convert 611 @param defvalue The default-value 612 @return True if the string was successfully parsed 613 */ 614 bool ConfigValueContainer::parseSting(const std::string& input, const Ogre::ColourValue& defvalue)609 @brief Parses a given String into a value of the type ColourValue and assigns it to the right variable. If the conversion failed, the default-value gets assigned. 610 @param input The string to convert 611 @param defvalue The default-value 612 @return True if the string was successfully parsed 613 */ 614 bool ConfigValueContainer::parseSting(const String& input, const ColourValue& defvalue) 615 615 { 616 616 // Strip the value-string … … 621 621 if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2) 622 622 { 623 std::vector< std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");623 std::vector<String> tokens = tokenize(input.substr(pos1, pos2 - pos1), ","); 624 624 if (!string2Number(this->value_colourvalue_.r, tokens[0], defvalue.r)) 625 625 { … … 678 678 679 679 // The string of the section we're searching 680 std::string section = "";680 String section = ""; 681 681 section.append("["); 682 682 section.append(this->classname_); … … 685 685 // Iterate through all config-file-lines 686 686 bool success = false; 687 std::list< std::string>::iterator it1;687 std::list<String>::iterator it1; 688 688 for(it1 = ConfigValueContainer::getConfigFileLines().begin(); it1 != ConfigValueContainer::getConfigFileLines().end(); ++it1) 689 689 { … … 696 696 // We found the right section 697 697 bool bLineIsEmpty = false; 698 std::list< std::string>::iterator positionToPutNewLineAt;698 std::list<String>::iterator positionToPutNewLineAt; 699 699 700 700 // Iterate through all lines in the section 701 std::list< std::string>::iterator it2;701 std::list<String>::iterator it2; 702 702 for(it2 = ++it1; it2 != ConfigValueContainer::getConfigFileLines().end(); ++it2) 703 703 { … … 777 777 @return True = it's a comment 778 778 */ 779 bool ConfigValueContainer::isComment(const std::string& line)779 bool ConfigValueContainer::isComment(const String& line) 780 780 { 781 781 // Strip the line, whitespaces are disturbing 782 std::string teststring = getStrippedLine(line);782 String teststring = getStrippedLine(line); 783 783 784 784 // There are four possible comment-symbols: … … 798 798 @return True = it's empty 799 799 */ 800 bool ConfigValueContainer::isEmpty(const std::string& line)800 bool ConfigValueContainer::isEmpty(const String& line) 801 801 { 802 802 return getStrippedLine(line) == ""; … … 808 808 @return The stripped line 809 809 */ 810 std::string ConfigValueContainer::getStrippedLine(const std::string& line)811 { 812 std::string output = line;810 String ConfigValueContainer::getStrippedLine(const String& line) 811 { 812 String output = line; 813 813 unsigned int pos; 814 814 while ((pos = output.find(" ")) < output.length()) … … 825 825 @return The value-string 826 826 */ 827 std::string ConfigValueContainer::parseValueString(bool bStripped)828 { 829 std::string output;827 String ConfigValueContainer::parseValueString(bool bStripped) 828 { 829 String output; 830 830 if (bStripped) 831 831 output = this->getStrippedLine(*this->configFileLine_); … … 839 839 @returns a list, containing all entrys in the config-file. 840 840 */ 841 std::list< std::string>& ConfigValueContainer::getConfigFileLines()841 std::list<String>& ConfigValueContainer::getConfigFileLines() 842 842 { 843 843 // This is done to avoid problems while executing this code before main() 844 static std::list< std::string> configFileLinesStaticReference = std::list<std::string>();844 static std::list<String> configFileLinesStaticReference = std::list<String>(); 845 845 return configFileLinesStaticReference; 846 846 } … … 866 866 @param filename The name of the config-file 867 867 */ 868 void ConfigValueContainer::readConfigFile(const std::string& filename)868 void ConfigValueContainer::readConfigFile(const String& filename) 869 869 { 870 870 // This creates the file if it's not existing … … 913 913 @param filename The name of the config-file 914 914 */ 915 void ConfigValueContainer::writeConfigFile(const std::string& filename)915 void ConfigValueContainer::writeConfigFile(const String& filename) 916 916 { 917 917 // Make sure we stored the config-file in the list … … 930 930 931 931 // Iterate through the list an write the lines into the file 932 std::list< std::string>::iterator it;932 std::list<String>::iterator it; 933 933 for (it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it) 934 934 { … … 943 943 @param description The description 944 944 */ 945 void ConfigValueContainer::description(const std::string& description)945 void ConfigValueContainer::description(const String& description) 946 946 { 947 947 if (!this->bAddedDescription_) 948 948 { 949 this->description_ = std::string("ConfigValueDescription::" + this->classname_ + "::" + this->varname_);949 this->description_ = String("ConfigValueDescription::" + this->classname_ + "::" + this->varname_); 950 950 Language::getLanguage().addEntry(description_, description); 951 951 this->bAddedDescription_ = true; -
code/branches/FICN/src/orxonox/core/ConfigValueContainer.h
r705 r708 43 43 #define _ConfigValueContainer_H__ 44 44 45 #include <string>46 45 #include <list> 47 46 48 47 #include "CorePrereqs.h" 49 48 50 #include "OgreVector2.h" 51 #include "OgreVector3.h" 52 #include "OgreColourValue.h" 49 #include "misc/Vector2.h" 50 #include "misc/Vector3.h" 51 #include "misc/Matrix3.h" 52 #include "misc/Quaternion.h" 53 #include "misc/String.h" 54 #include "misc/ColourValue.h" 53 55 #include "Language.h" 54 56 … … 85 87 Bool, 86 88 ConstChar, 87 String,88 Vector2,89 Vector3,90 ColourValue89 _String, 90 _Vector2, 91 _Vector3, 92 _ColourValue 91 93 }; 92 94 93 ConfigValueContainer(const std::string& classname, const std::string& varname, int defvalue);94 ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned int defvalue);95 ConfigValueContainer(const std::string& classname, const std::string& varname, char defvalue);96 ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned char defvalue);97 ConfigValueContainer(const std::string& classname, const std::string& varname, float defvalue);98 ConfigValueContainer(const std::string& classname, const std::string& varname, double defvalue);99 ConfigValueContainer(const std::string& classname, const std::string& varname, long double defvalue);100 ConfigValueContainer(const std::string& classname, const std::string& varname, bool defvalue);101 ConfigValueContainer(const std::string& classname, const std::string& varname, const std::string& defvalue);102 ConfigValueContainer(const std::string& classname, const std::string& varname, const char* defvalue);103 ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector2 defvalue);104 ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::Vector3 defvalue);105 ConfigValueContainer(const std::string& classname, const std::string& varname, Ogre::ColourValue defvalue);95 ConfigValueContainer(const String& classname, const String& varname, int defvalue); 96 ConfigValueContainer(const String& classname, const String& varname, unsigned int defvalue); 97 ConfigValueContainer(const String& classname, const String& varname, char defvalue); 98 ConfigValueContainer(const String& classname, const String& varname, unsigned char defvalue); 99 ConfigValueContainer(const String& classname, const String& varname, float defvalue); 100 ConfigValueContainer(const String& classname, const String& varname, double defvalue); 101 ConfigValueContainer(const String& classname, const String& varname, long double defvalue); 102 ConfigValueContainer(const String& classname, const String& varname, bool defvalue); 103 ConfigValueContainer(const String& classname, const String& varname, const String& defvalue); 104 ConfigValueContainer(const String& classname, const String& varname, const char* defvalue); 105 ConfigValueContainer(const String& classname, const String& varname, Vector2 defvalue); 106 ConfigValueContainer(const String& classname, const String& varname, Vector3 defvalue); 107 ConfigValueContainer(const String& classname, const String& varname, ColourValue defvalue); 106 108 107 109 /** @returns the value. @param value This is only needed to determine the right type. */ … … 122 124 inline ConfigValueContainer& getValue(bool& value) { value = this->value_.value_bool_; return *this; } 123 125 /** @returns the value. @param value This is only needed to determine the right type. */ 124 inline ConfigValueContainer& getValue( std::string& value) { value = this->value_string_; return *this; }126 inline ConfigValueContainer& getValue(String& value) { value = this->value_string_; return *this; } 125 127 /** @returns the value. @param value This is only needed to determine the right type. */ 126 128 inline ConfigValueContainer& getValue(const char* value) { value = this->value_string_.c_str(); return *this; } 127 129 /** @returns the value. @param value This is only needed to determine the right type. */ 128 inline ConfigValueContainer& getValue( Ogre::Vector2& value) { value = this->value_vector2_; return *this; }130 inline ConfigValueContainer& getValue(Vector2& value) { value = this->value_vector2_; return *this; } 129 131 /** @returns the value. @param value This is only needed to determine the right type. */ 130 inline ConfigValueContainer& getValue( Ogre::Vector3& value) { value = this->value_vector3_; return *this; }132 inline ConfigValueContainer& getValue(Vector3& value) { value = this->value_vector3_; return *this; } 131 133 /** @returns the value. @param value This is only needed to determine the right type. */ 132 inline ConfigValueContainer& getValue( Ogre::ColourValue& value) { value = this->value_colourvalue_; return *this; }134 inline ConfigValueContainer& getValue(ColourValue& value) { value = this->value_colourvalue_; return *this; } 133 135 134 void description(const std::string& description);136 void description(const String& description); 135 137 136 bool parseSting(const std::string& input);138 bool parseSting(const String& input); 137 139 void resetConfigFileEntry(); 138 140 void resetConfigValue(); 139 141 140 static std::string getStrippedLine(const std::string& line);141 static bool isEmpty(const std::string& line);142 static bool isComment(const std::string& line);142 static String getStrippedLine(const String& line); 143 static bool isEmpty(const String& line); 144 static bool isComment(const String& line); 143 145 144 146 private: 145 bool parseSting(const std::string& input, int defvalue);146 bool parseSting(const std::string& input, unsigned int defvalue);147 bool parseSting(const std::string& input, char defvalue);148 bool parseSting(const std::string& input, unsigned char defvalue);149 bool parseSting(const std::string& input, float defvalue);150 bool parseSting(const std::string& input, double defvalue);151 bool parseSting(const std::string& input, long double defvalue);152 bool parseSting(const std::string& input, bool defvalue);153 bool parseSting(const std::string& input, const std::string& defvalue);154 bool parseSting(const std::string& input, const char* defvalue);155 bool parseSting(const std::string& input, const Ogre::Vector2& defvalue);156 bool parseSting(const std::string& input, const Ogre::Vector3& defvalue);157 bool parseSting(const std::string& input, const Ogre::ColourValue& defvalue);147 bool parseSting(const String& input, int defvalue); 148 bool parseSting(const String& input, unsigned int defvalue); 149 bool parseSting(const String& input, char defvalue); 150 bool parseSting(const String& input, unsigned char defvalue); 151 bool parseSting(const String& input, float defvalue); 152 bool parseSting(const String& input, double defvalue); 153 bool parseSting(const String& input, long double defvalue); 154 bool parseSting(const String& input, bool defvalue); 155 bool parseSting(const String& input, const String& defvalue); 156 bool parseSting(const String& input, const char* defvalue); 157 bool parseSting(const String& input, const Vector2& defvalue); 158 bool parseSting(const String& input, const Vector3& defvalue); 159 bool parseSting(const String& input, const ColourValue& defvalue); 158 160 159 static std::list< std::string>& getConfigFileLines();161 static std::list<String>& getConfigFileLines(); 160 162 static bool finishedReadingConfigFile(bool finished = false); 161 163 void searchConfigFileLine(); 162 std::string parseValueString(bool bStripped = true);164 String parseValueString(bool bStripped = true); 163 165 164 static void readConfigFile(const std::string& filename);165 static void writeConfigFile(const std::string& filename);166 static void readConfigFile(const String& filename); 167 static void writeConfigFile(const String& filename); 166 168 167 std::string classname_; //!< The name of the class the variable belongs to168 std::string varname_; //!< The name of the variable169 std::string defvalueString_; //!< The string of the default-variable169 String classname_; //!< The name of the class the variable belongs to 170 String varname_; //!< The name of the variable 171 String defvalueString_; //!< The string of the default-variable 170 172 171 173 union MultiType … … 181 183 } value_; //!< The value of the variable 182 184 183 std::string value_string_; //!< The value, if the variable is of the type string184 Ogre::Vector2 value_vector2_; //!< The value, if the variable is of the type Vector2185 Ogre::Vector3 value_vector3_; //!< The value, if the variable is of the type Vector3186 Ogre::ColourValue value_colourvalue_; //!< The value, if the variable is of the type ColourValue185 String value_string_; //!< The value, if the variable is of the type string 186 Vector2 value_vector2_; //!< The value, if the variable is of the type Vector2 187 Vector3 value_vector3_; //!< The value, if the variable is of the type Vector3 188 ColourValue value_colourvalue_; //!< The value, if the variable is of the type ColourValue 187 189 188 std::list< std::string>::iterator configFileLine_; //!< An iterator, pointing to the entry of the variable in the config-file190 std::list<String>::iterator configFileLine_; //!< An iterator, pointing to the entry of the variable in the config-file 189 191 190 192 VariableType type_; //!< The type of the variable -
code/branches/FICN/src/orxonox/core/CoreIncludes.h
r705 r708 50 50 #include "ConfigValueContainer.h" 51 51 #include "Debug.h" 52 53 #include "OgreVector2.h"54 #include "OgreVector3.h"55 #include "OgreColourValue.h"56 #include "OgreQuaternion.h"57 #include "OgreMatrix3.h"58 59 60 // Some typedefs61 namespace orxonox62 {63 typedef Ogre::Vector2 Vector2;64 typedef Ogre::Vector3 Vector3;65 typedef Ogre::ColourValue ColourValue;66 typedef Ogre::Radian Radian;67 typedef Ogre::Degree Degree;68 typedef Ogre::Real Real;69 typedef Ogre::Quaternion Quaternion;70 typedef Ogre::Matrix3 Matrix3;71 }72 73 52 74 53 /** -
code/branches/FICN/src/orxonox/core/CorePrereqs.h
r705 r708 34 34 #define _CorePrereqs_H__ 35 35 36 #include " ../OrxonoxPlatform.h"36 #include "orxonox/OrxonoxPlatform.h" 37 37 38 38 //----------------------------------------------------------------------- -
code/branches/FICN/src/orxonox/core/Debug.h
r699 r708 37 37 38 38 #include <stdio.h> 39 40 #include "CorePrereqs.h" 41 39 42 #include "OutputHandler.h" 40 41 #include "CorePrereqs.h"42 43 43 44 extern "C" _CoreExport int getSoftDebugLevel(); -
code/branches/FICN/src/orxonox/core/DebugLevel.h
r704 r708 38 38 39 39 #include "CorePrereqs.h" 40 40 41 #include "OrxonoxClass.h" 41 42 #include "OutputHandler.h" -
code/branches/FICN/src/orxonox/core/Error.cc
r670 r708 26 26 */ 27 27 28 #include "Debug.h" 28 29 #include "Error.h" 29 #include "Debug.h"30 30 31 31 namespace orxonox … … 36 36 } 37 37 38 Error::Error( std::string errorMsg, int errorCode)38 Error::Error(String errorMsg, int errorCode) 39 39 { 40 40 Error(errorCode, errorMsg); 41 41 } 42 42 43 Error::Error(int errorCode, std::string errorMsg)43 Error::Error(int errorCode, String errorMsg) 44 44 { 45 45 COUT(1) << "############################ "<< std::endl -
code/branches/FICN/src/orxonox/core/Error.h
r684 r708 29 29 #define _Error_H__ 30 30 31 #include <string>31 #include "CorePrereqs.h" 32 32 33 #include " CorePrereqs.h"33 #include "misc/String.h" 34 34 35 35 namespace orxonox … … 39 39 public: 40 40 Error(); 41 Error( std::string errorMsg, int errorCode=0);42 Error(int errorCode, std::string errorMsg="");41 Error(String errorMsg, int errorCode = 0); 42 Error(int errorCode, String errorMsg = ""); 43 43 private: 44 44 -
code/branches/FICN/src/orxonox/core/Factory.cc
r698 r708 42 42 @param name The name of the wanted Identifier 43 43 */ 44 Identifier* Factory::getIdentifier(const std::string& name)44 Identifier* Factory::getIdentifier(const String& name) 45 45 { 46 46 return getFactoryPointer()->identifierStringMap_[name]; … … 61 61 @param identifier The identifier to add 62 62 */ 63 void Factory::add(const std::string& name, Identifier* identifier)63 void Factory::add(const String& name, Identifier* identifier) 64 64 { 65 65 getFactoryPointer()->identifierStringMap_[name] = identifier; … … 85 85 { 86 86 COUT(3) << "*** Factory -> Create class-hierarchy" << std::endl; 87 std::map< std::string, Identifier*>::iterator it;87 std::map<String, Identifier*>::iterator it; 88 88 it = getFactoryPointer()->identifierStringMap_.begin(); 89 89 (*getFactoryPointer()->identifierStringMap_.begin()).second->startCreatingHierarchy(); -
code/branches/FICN/src/orxonox/core/Factory.h
r682 r708 45 45 46 46 #include <map> 47 #include <string>48 47 49 48 #include "CorePrereqs.h" 49 50 #include "misc/String.h" 50 51 51 52 namespace orxonox … … 60 61 { 61 62 public: 62 static Identifier* getIdentifier(const std::string& name);63 static Identifier* getIdentifier(const String& name); 63 64 static Identifier* getIdentifier(const unsigned int id); 64 static void add(const std::string& name, Identifier* identifier);65 static void add(const String& name, Identifier* identifier); 65 66 static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID); 66 67 static void createClassHierarchy(); 67 68 68 static Factory* getFactoryPointer(); // avoid overriding pointer_sin the static intialisation process69 static Factory* getFactoryPointer(); // avoid overriding order problem in the static intialisation process 69 70 70 71 private: … … 73 74 ~Factory() {} // don't delete 74 75 75 std::map< std::string, Identifier*> identifierStringMap_; //!< The map, mapping the name with the Identifier76 std::map<String, Identifier*> identifierStringMap_; //!< The map, mapping the name with the Identifier 76 77 std::map<unsigned int, Identifier*> identifierNetworkIDMap_; //!< The map, mapping the network ID with the Identifier 77 78 }; -
code/branches/FICN/src/orxonox/core/Identifier.cc
r698 r708 118 118 @returns a reference to the Identifier map, containing all Identifiers. 119 119 */ 120 std::map< std::string, Identifier*>& Identifier::getIdentifierMap()120 std::map<String, Identifier*>& Identifier::getIdentifierMap() 121 121 { 122 static std::map< std::string, Identifier*> identifierMapStaticReference = std::map<std::string, Identifier*>();122 static std::map<String, Identifier*> identifierMapStaticReference = std::map<String, Identifier*>(); 123 123 return identifierMapStaticReference; 124 124 } -
code/branches/FICN/src/orxonox/core/Identifier.h
r700 r708 52 52 #define _Identifier_H__ 53 53 54 #include <string>55 54 #include <map> 56 55 57 56 #include "CorePrereqs.h" 58 57 58 #include "misc/String.h" 59 59 #include "ObjectList.h" 60 60 #include "IdentifierList.h" … … 112 112 113 113 /** @returns the name of the class the Identifier belongs to. */ 114 inline const std::string& getName() const { return this->name_; }114 inline const String& getName() const { return this->name_; } 115 115 116 116 /** @returns the parents of the class the Identifier belongs to. */ … … 130 130 131 131 /** @returns the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variable */ 132 inline ConfigValueContainer* getConfigValueContainer(const std::string& varname)132 inline ConfigValueContainer* getConfigValueContainer(const String& varname) 133 133 { return this->configValues_[varname]; } 134 134 135 135 /** @brief Sets the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variablee @param container The container */ 136 inline void setConfigValueContainer(const std::string& varname, ConfigValueContainer* container)136 inline void setConfigValueContainer(const String& varname, ConfigValueContainer* container) 137 137 { this->configValues_[varname] = container; } 138 138 139 static std::map< std::string, Identifier*>& getIdentifierMap();139 static std::map<String, Identifier*>& getIdentifierMap(); 140 140 141 141 private: … … 166 166 IdentifierList* children_; //!< The Children of the class the Identifier belongs to 167 167 168 std::string name_; //!< The name of the class the Identifier belongs to168 String name_; //!< The name of the class the Identifier belongs to 169 169 170 170 BaseFactory* factory_; //!< The Factory, able to create new objects of the given class (if available) … … 172 172 static int hierarchyCreatingCounter_s; //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading) 173 173 unsigned int classID_; //!< The network ID to identify a class through the network 174 std::map< std::string, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer174 std::map<String, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer 175 175 }; 176 176 … … 189 189 { 190 190 public: 191 static ClassIdentifier<T>* registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass);191 static ClassIdentifier<T>* registerClass(const IdentifierList* parents, const String& name, bool bRootClass); 192 192 static void addObject(T* object); 193 193 static ClassIdentifier<T>* getIdentifier(); 194 void setName(const std::string& name);194 void setName(const String& name); 195 195 196 196 private: … … 221 221 */ 222 222 template <class T> 223 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass)223 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const String& name, bool bRootClass) 224 224 { 225 225 COUT(4) << "*** Register Class in " << name << "-Singleton." << std::endl; … … 265 265 */ 266 266 template <class T> 267 void ClassIdentifier<T>::setName(const std::string& name)267 void ClassIdentifier<T>::setName(const String& name) 268 268 { 269 269 // Make sure we didn't already set the name, to avoid duplicate entries in the Identifier map … … 271 271 { 272 272 this->name_ = name; 273 this->getIdentifierMap().insert(std::pair< std::string, Identifier*>(name, this));273 this->getIdentifierMap().insert(std::pair<String, Identifier*>(name, this)); 274 274 this->bSetName_ = true; 275 275 } -
code/branches/FICN/src/orxonox/core/IdentifierList.cc
r670 r708 31 31 */ 32 32 33 #include "Identifier.h" 33 34 #include "IdentifierList.h" 34 #include "Identifier.h"35 35 36 36 namespace orxonox … … 130 130 @returns a string, containing a list of the names of all Identifiers in the list. 131 131 */ 132 std::string IdentifierList::toString() const132 String IdentifierList::toString() const 133 133 { 134 134 IdentifierListElement* temp = this->first_; 135 std::string output = "";135 String output = ""; 136 136 137 137 while (temp) -
code/branches/FICN/src/orxonox/core/IdentifierList.h
r682 r708 37 37 #define _IdentifierList_H__ 38 38 39 #include <string>39 #include "CorePrereqs.h" 40 40 41 #include " CorePrereqs.h"41 #include "misc/String.h" 42 42 43 43 namespace orxonox … … 62 62 void remove(const Identifier* identifier); 63 63 bool isInList(const Identifier* identifier) const; 64 std::string toString() const;64 String toString() const; 65 65 66 66 IdentifierListElement* first_; //!< The first element in the list -
code/branches/FICN/src/orxonox/core/Language.cc
r704 r708 28 28 #include <fstream> 29 29 30 #include "CoreIncludes.h" 30 31 #include "Language.h" 31 #include "CoreIncludes.h"32 32 33 33 namespace orxonox … … 36 36 // ### LanguageEntry ### 37 37 // ############################### 38 LanguageEntry::LanguageEntry(const std::string& fallbackEntry)38 LanguageEntry::LanguageEntry(const String& fallbackEntry) 39 39 { 40 40 RegisterRootObject(LanguageEntry); … … 44 44 } 45 45 46 void LanguageEntry::setTranslation(const std::string& translation)46 void LanguageEntry::setTranslation(const String& translation) 47 47 { 48 48 if (translation.compare("") != 0) … … 52 52 } 53 53 54 void LanguageEntry::setDefault(const std::string& fallbackEntry)54 void LanguageEntry::setDefault(const String& fallbackEntry) 55 55 { 56 56 if (this->translatedEntry_.compare(this->fallbackEntry_) == 0) … … 85 85 } 86 86 87 void Language::createEntry(const LanguageEntryName& name, const std::string& entry)87 void Language::createEntry(const LanguageEntryName& name, const String& entry) 88 88 { 89 89 if (!this->languageEntries_[name]) … … 99 99 } 100 100 101 void Language::addEntry(const LanguageEntryName& name, const std::string& entry)102 { 103 std::map< std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name);101 void Language::addEntry(const LanguageEntryName& name, const String& entry) 102 { 103 std::map<String, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name); 104 104 if (!it->second) 105 105 this->createEntry(name, entry); … … 112 112 } 113 113 114 const std::string& Language::getTranslation(const LanguageEntryName& name) const115 { 116 std::map< std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name);114 const String& Language::getTranslation(const LanguageEntryName& name) const 115 { 116 std::map<String, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name); 117 117 if (it->second) 118 118 return it->second->getTranslation(); … … 124 124 } 125 125 126 const std::string Language::getFileName(const std::string& language)127 { 128 return std::string("translation_" + language + ".lang");126 const String Language::getFileName(const String& language) 127 { 128 return String("translation_" + language + ".lang"); 129 129 } 130 130 … … 154 154 { 155 155 file.getline(line, 1024); 156 std::string lineString = std::string(line);156 String lineString = String(line); 157 157 if (lineString.compare("") != 0) 158 158 { … … 190 190 { 191 191 file.getline(line, 1024); 192 std::string lineString = std::string(line);192 String lineString = String(line); 193 193 if (lineString.compare("") != 0) 194 194 { … … 196 196 if (pos < lineString.size() && lineString.size() >= 3) 197 197 { 198 std::map< std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(lineString.substr(0, pos));198 std::map<String, LanguageEntry*>::const_iterator it = this->languageEntries_.find(lineString.substr(0, pos)); 199 199 if (it->second) 200 200 it->second->setTranslation(lineString.substr(pos + 1)); -
code/branches/FICN/src/orxonox/core/Language.h
r704 r708 29 29 #define _Language_H__ 30 30 31 #include <string>32 31 #include <map> 33 32 34 33 #include "CorePrereqs.h" 35 34 35 #include "misc/String.h" 36 36 #include "OrxonoxClass.h" 37 37 38 38 namespace orxonox 39 39 { 40 typedef std::string LanguageEntryName;40 typedef String LanguageEntryName; 41 41 42 42 class _CoreExport LanguageEntry : public OrxonoxClass 43 43 { 44 44 public: 45 explicit LanguageEntry(const std::string& fallbackEntry);46 void setTranslation(const std::string& translation);47 void setDefault(const std::string& fallbackEntry);45 explicit LanguageEntry(const String& fallbackEntry); 46 void setTranslation(const String& translation); 47 void setDefault(const String& fallbackEntry); 48 48 49 inline const std::string& getTranslation()49 inline const String& getTranslation() 50 50 { return this->translatedEntry_; } 51 51 52 inline const std::string& getDefault()52 inline const String& getDefault() 53 53 { return this->fallbackEntry_; } 54 54 55 55 private: 56 std::string fallbackEntry_;57 std::string translatedEntry_;56 String fallbackEntry_; 57 String translatedEntry_; 58 58 }; 59 59 … … 63 63 static Language& getLanguage(); 64 64 void setConfigValues(); 65 void addEntry(const LanguageEntryName& name, const std::string& entry);66 const std::string& getTranslation(const LanguageEntryName& name) const;65 void addEntry(const LanguageEntryName& name, const String& entry); 66 const String& getTranslation(const LanguageEntryName& name) const; 67 67 68 68 private: … … 74 74 void readTranslatedLanguageFile(); 75 75 void writeDefaultLanguageFile() const; 76 static const std::string getFileName(const std::string& language);77 void createEntry(const LanguageEntryName& name, const std::string& entry);76 static const String getFileName(const String& language); 77 void createEntry(const LanguageEntryName& name, const String& entry); 78 78 79 std::string language_;80 std::string defaultLanguage_;81 std::string defaultTranslation_;82 std::map< std::string, LanguageEntry*> languageEntries_;79 String language_; 80 String defaultLanguage_; 81 String defaultTranslation_; 82 std::map<String, LanguageEntry*> languageEntries_; 83 83 }; 84 84 } -
code/branches/FICN/src/orxonox/core/OrxonoxClass.h
r695 r708 37 37 #define _OrxonoxClass_H__ 38 38 39 #include <string>40 41 39 #include "CorePrereqs.h" 42 40 41 #include "misc/String.h" 43 42 #include "MetaObjectList.h" 44 43 #include "Identifier.h" … … 133 132 134 133 /** @brief Sets the name of the object. @param name The name */ 135 inline virtual void setName(const std::string& name) { this->name_ = name; }134 inline virtual void setName(const String& name) { this->name_ = name; } 136 135 137 136 /** @returns the name of the object. */ 138 inline const std::string& getName() const { return this->name_; }137 inline const String& getName() const { return this->name_; } 139 138 140 139 /** @brief Sets the state of the objects activity. @param bActive True = active */ … … 155 154 MetaObjectList metaList_; //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in 156 155 157 std::string name_; //!< The name of the object156 String name_; //!< The name of the object 158 157 bool bActive_; //!< True = the object is active 159 158 bool bVisible_; //!< True = the object is visible -
code/branches/FICN/src/orxonox/core/OutputHandler.cc
r699 r708 26 26 */ 27 27 28 #include "DebugLevel.h" 28 29 #include "OutputHandler.h" 29 #include "DebugLevel.h"30 30 31 31 namespace orxonox … … 35 35 @param logfilename The name of the logfile 36 36 */ 37 OutputHandler::OutputHandler(const std::string& logfilename)37 OutputHandler::OutputHandler(const String& logfilename) 38 38 { 39 39 this->logfilename_ = logfilename; -
code/branches/FICN/src/orxonox/core/OutputHandler.h
r704 r708 37 37 #define _OutputHandler_H__ 38 38 39 #include "CorePrereqs.h"40 41 39 #include <iostream> 42 40 #include <fstream> 43 #include <string> 41 42 #include "misc/String.h" 43 #include "CorePrereqs.h" 44 44 45 45 namespace orxonox … … 108 108 109 109 private: 110 explicit OutputHandler(const std::string& logfilename);110 explicit OutputHandler(const String& logfilename); 111 111 OutputHandler(const OutputHandler& oh) {}; // don't copy 112 112 virtual ~OutputHandler(); 113 113 std::ofstream logfile_; //!< The logfile where the output is logged 114 std::string logfilename_; //!< The name of the logfile114 String logfilename_; //!< The name of the logfile 115 115 int outputLevel_; //!< The level of the incoming output 116 116 }; -
code/branches/FICN/src/orxonox/hud/HUD.cc
r668 r708 1 1 /* 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * Yuning Chai 23 * Co-authors: 24 * ... 25 * 26 */ 27 27 28 28 #include <OgreOverlayManager.h> … … 33 33 34 34 35 namespace hud { 35 namespace orxonox 36 { 36 37 using namespace Ogre; 37 38 … … 179 180 primarChoice_->setLeft(101); 180 181 primarChoice_->setWidth(48); 181 182 } 182 183 } 183 184 -
code/branches/FICN/src/orxonox/hud/HUD.h
r673 r708 1 1 /* 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * Yuning Chai 23 * Co-authors: 24 * ... 25 * 26 */ 27 27 28 28 #ifndef _HUD_H__ … … 31 31 #include <OgrePrerequisites.h> 32 32 33 //#include "../OrxonoxPrereqs.h" 33 #include "../OrxonoxPrereqs.h" 34 35 #include "misc/String.h" 34 36 35 37 36 namespace hud { 37 class HUD { 38 namespace orxonox 39 { 40 class HUD 41 { 38 42 private: 39 43 Ogre::OverlayElement* timeText_; … … 57 61 int timeSec_; 58 62 59 Ogre::String targetWindowName_;60 Ogre::String targetWindowStatus_;63 String targetWindowName_; 64 String targetWindowStatus_; 61 65 int targetWindowDistance_; 62 66 int targetWindowHitRating_; … … 89 93 90 94 void setTime(int i, int j); 91 void setTargetWindowName( Ogre::String i);92 void setTargetWindowStatus( Ogre::String i);95 void setTargetWindowName(String i); 96 void setTargetWindowStatus(String i); 93 97 void setTargetWindowDistance(int i); 94 98 void setTargetWindowHitRating(int i); -
code/branches/FICN/src/orxonox/objects/Ambient.cc
r614 r708 26 26 */ 27 27 28 #include <vector> 29 28 30 #include <OgreSceneManager.h> 29 #include <string>30 31 32 #include "tinyxml/tinyxml.h" 33 #include "misc/Tokenizer.h" 34 #include "misc/String2Number.h" 35 #include "misc/ColourValue.h" 36 #include "misc/String.h" 37 #include "../core/Debug.h" 38 #include "../core/CoreIncludes.h" 31 39 #include "../Orxonox.h" 32 #include "../../tinyxml/tinyxml.h"33 #include "../../misc/Tokenizer.h"34 #include "../../misc/String2Number.h"35 #include "../core/Debug.h"36 40 37 41 #include "Ambient.h" … … 57 61 { 58 62 59 std::vector< std::string> colourvalues = tokenize(xmlElem->Attribute("colourvalue"),",");63 std::vector<String> colourvalues = tokenize(xmlElem->Attribute("colourvalue"),","); 60 64 float r, g, b; 61 65 String2Number<float>(r, colourvalues[0]); -
code/branches/FICN/src/orxonox/objects/Ambient.h
r673 r708 2 2 #define _Ambient_H__ 3 3 4 #include "../OrxonoxPrereqs.h" 5 4 6 #include "BaseObject.h" 5 #include "../../tinyxml/tinyxml.h"6 7 7 8 namespace orxonox -
code/branches/FICN/src/orxonox/objects/BaseObject.cc
r673 r708 30 30 @brief Implementation of the BaseObject class. 31 31 */ 32 33 #include "tinyxml/tinyxml.h" 34 #include "../core/CoreIncludes.h" 32 35 33 36 #include "BaseObject.h" -
code/branches/FICN/src/orxonox/objects/BaseObject.h
r673 r708 9 9 #define _BaseObject_H__ 10 10 11 #include "../core/CoreIncludes.h" 12 #include "tinyxml/tinyxml.h" 11 #include "../OrxonoxPrereqs.h" 12 13 #include "../core/OrxonoxClass.h" 13 14 14 15 namespace orxonox -
code/branches/FICN/src/orxonox/objects/BillboardSet.cc
r670 r708 28 28 #include <sstream> 29 29 30 #include <OgreSceneManager.h> 31 32 #include "../Orxonox.h" 33 #include "misc/Vector3.h" 34 #include "misc/ColourValue.h" 35 30 36 #include "BillboardSet.h" 31 #include "../Orxonox.h"32 37 33 38 namespace orxonox … … 40 45 } 41 46 42 void BillboardSet::setBillboardSet(const std::string& file, const Ogre::ColourValue& colour, int count, const Ogre::Vector3& position)47 void BillboardSet::setBillboardSet(const String& file, const ColourValue& colour, int count, const Vector3& position) 43 48 { 44 49 std::ostringstream name; -
code/branches/FICN/src/orxonox/objects/BillboardSet.h
r673 r708 2 2 #define _BillboardSet_H__ 3 3 4 #include < string>4 #include <OgreBillboardSet.h> 5 5 6 #include "OgreBillboardSet.h" 6 #include "../OrxonoxPrereqs.h" 7 8 #include "misc/String.h" 9 #include "../core/CoreIncludes.h" 10 #include "misc/ColourValue.h" 11 #include "misc/Vector3.h" 7 12 8 13 namespace orxonox … … 13 18 BillboardSet(); 14 19 ~BillboardSet(); 15 void setBillboardSet(const std::string& file, const Ogre::ColourValue& colour = Ogre::ColourValue(1.0, 1.0, 1.0), int count = 1, const Ogre::Vector3& position = Ogre::Vector3::ZERO);20 void setBillboardSet(const String& file, const ColourValue& colour = ColourValue(1.0, 1.0, 1.0), int count = 1, const Vector3& position = Vector3::ZERO); 16 21 17 22 inline Ogre::BillboardSet* getBillboardSet() 18 23 { return this->billboardSet_; } 19 24 20 inline const std::string& getName() const25 inline const String& getName() const 21 26 { return this->billboardSet_->getName(); } 22 27 -
code/branches/FICN/src/orxonox/objects/Camera.cc
r660 r708 3 3 #include <OgreRoot.h> 4 4 #include <OgreRenderWindow.h> 5 #include <OgreViewport.h> 5 6 6 #include <string> 7 7 #include "tinyxml/tinyxml.h" 8 #include "misc/Tokenizer.h" 9 #include "misc/String2Number.h" 10 #include "misc/Vector3.h" 11 #include "misc/String.h" 12 #include "../core/Debug.h" 13 #include "../core/CoreIncludes.h" 8 14 #include "../Orxonox.h" 9 15 #include "../GraphicsEngine.h" 10 #include "../../tinyxml/tinyxml.h"11 #include "../../misc/Tokenizer.h"12 #include "../../misc/String2Number.h"13 #include "../core/Debug.h"14 16 15 17 #include "Camera.h" … … 36 38 // <Camera name="Camera" pos="0,0,-250" lookat="0,0,0" /> 37 39 38 std::string name = xmlElem->Attribute("name");39 std::string pos = xmlElem->Attribute("pos");40 std::string lookat = xmlElem->Attribute("lookat");40 String name = xmlElem->Attribute("name"); 41 String pos = xmlElem->Attribute("pos"); 42 String lookat = xmlElem->Attribute("lookat"); 41 43 42 44 Ogre::Camera *cam = mgr->createCamera(name); 43 45 44 46 float x, y, z; 45 std::vector< std::string> posVec = tokenize(xmlElem->Attribute("pos"),",");46 47 std::vector<String> posVec = tokenize(xmlElem->Attribute("pos"),","); 48 String2Number<float>(x, posVec[0]); 47 49 String2Number<float>(y, posVec[1]); 48 50 String2Number<float>(z, posVec[2]); … … 57 59 cam->lookAt(Vector3(x,y,z)); 58 60 59 std::string node = xmlElem->Attribute("node");61 String node = xmlElem->Attribute("node"); 60 62 61 63 Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->createChildSceneNode(node); //getChild(node); -
code/branches/FICN/src/orxonox/objects/Camera.h
r673 r708 2 2 #define _Camera_H__ 3 3 4 #include "../OrxonoxPrereqs.h" 5 4 6 #include "BaseObject.h" 5 #include "../../tinyxml/tinyxml.h"6 7 7 8 namespace orxonox -
code/branches/FICN/src/orxonox/objects/Explosion.cc
r670 r708 26 26 */ 27 27 28 #include <OgreParticleSystem.h> 29 #include <OgreSceneManager.h> 30 #include <OgreSceneNode.h> 31 32 #include "../core/CoreIncludes.h" 33 #include "misc/ColourValue.h" 34 #include "../Orxonox.h" 35 #include "../particle/ParticleInterface.h" 36 28 37 #include "Explosion.h" 29 #include "../Orxonox.h"30 38 31 39 namespace orxonox … … 46 54 Vector3 position = owner->getNode()->getWorldPosition(); 47 55 48 this->particle_ = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(), "explosion" + this->getName(), "Orxonox/treibwerk");56 this->particle_ = new ParticleInterface(Orxonox::getSingleton()->getSceneManager(), "explosion" + this->getName(), "Orxonox/treibwerk"); 49 57 this->particle_->getParticleSystem()->setParameter("local_space", "true"); 50 58 this->particle_->newEmitter(); -
code/branches/FICN/src/orxonox/objects/Explosion.h
r673 r708 2 2 #define _Explosion_H__ 3 3 4 #include "../particle/ParticleInterface.h" 4 #include "../OrxonoxPrereqs.h" 5 5 6 #include "WorldEntity.h" 6 7 #include "Timer.h" … … 18 19 Timer<Explosion> destroyTimer_; 19 20 float lifetime_; 20 particle::ParticleInterface* particle_;21 ParticleInterface* particle_; 21 22 }; 22 23 } -
code/branches/FICN/src/orxonox/objects/Fighter.cc
r706 r708 26 26 */ 27 27 28 #include "Fighter.h" 29 30 #include "../../tinyxml/tinyxml.h" 31 #include "../../misc/String2Number.h" 28 #include <OgreCamera.h> 29 #include <OgreRenderWindow.h> 30 #include <OgreSceneManager.h> 31 #include <OgreSceneNode.h> 32 33 #include "tinyxml/tinyxml.h" 34 #include "misc/String2Number.h" 35 #include "misc/String.h" 32 36 #include "../core/CoreIncludes.h" 33 37 #include "../Orxonox.h" 38 #include "../particle/ParticleInterface.h" 34 39 #include "weapon_system/AmmunitionDump.h" 35 40 #include "weapon_system/BarrelGun.h" 36 41 37 #include "OgreCamera.h" 38 #include <OgreRenderWindow.h> 39 #include <string> 42 #include "Fighter.h" 40 43 41 44 namespace orxonox … … 141 144 #endif 142 145 143 tt = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");146 tt = new ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); 144 147 tt->getParticleSystem()->setParameter("local_space","true"); 145 148 tt->newEmitter(); … … 171 174 if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft")) 172 175 { 173 std::string forwardStr = xmlElem->Attribute("forward");174 std::string rotateupdownStr = xmlElem->Attribute("rotateupdown");175 std::string rotaterightleftStr = xmlElem->Attribute("rotaterightleft");176 std::string looprightleftStr = xmlElem->Attribute("looprightleft");176 String forwardStr = xmlElem->Attribute("forward"); 177 String rotateupdownStr = xmlElem->Attribute("rotateupdown"); 178 String rotaterightleftStr = xmlElem->Attribute("rotaterightleft"); 179 String looprightleftStr = xmlElem->Attribute("looprightleft"); 177 180 178 181 String2Number<float>(this->maxSpeedForward_, forwardStr); -
code/branches/FICN/src/orxonox/objects/Fighter.h
r697 r708 2 2 #define _Fighter_H__ 3 3 4 #include <OIS/OIS.h> 5 4 6 #include "../OrxonoxPrereqs.h" 5 7 6 #include <OIS/OIS.h> 7 #include <string.h> 8 #include "Model.h" 8 9 9 #include "Model.h" 10 #include "../../tinyxml/tinyxml.h" 11 #include "../particle/ParticleInterface.h" 10 class TiXmlElement; // Forward declaration 12 11 13 12 namespace orxonox … … 45 44 bool setMouseEventCallback_; 46 45 47 particle::ParticleInterface *w;48 particle::ParticleInterface *tt;46 ParticleInterface *w; 47 ParticleInterface *tt; 49 48 50 49 AmmunitionDump* ammoDump_; -
code/branches/FICN/src/orxonox/objects/Light.cc
r676 r708 1 1 #include <sstream> 2 2 3 #include <OgreSceneManager.h> 4 5 #include "../Orxonox.h" 6 3 7 #include "Light.h" 4 #include "../Orxonox.h"5 8 6 9 namespace orxonox … … 13 16 } 14 17 15 void Light::setLight(Ogre::Light::LightTypes type, const Ogre::ColourValue& diffuse, const Ogre::ColourValue& specular)18 void Light::setLight(Ogre::Light::LightTypes type, const ColourValue& diffuse, const ColourValue& specular) 16 19 { 17 20 std::ostringstream name; -
code/branches/FICN/src/orxonox/objects/Light.h
r676 r708 2 2 #define _Light_H__ 3 3 4 #include < string>4 #include <OgreLight.h> 5 5 6 #include "OgreLight.h" 7 #include "OgreColourValue.h" 6 #include "../OrxonoxPrereqs.h" 7 8 #include "misc/String.h" 9 #include "misc/ColourValue.h" 8 10 9 11 namespace orxonox … … 14 16 Light(); 15 17 ~Light(); 16 void setLight(Ogre::Light::LightTypes type = Ogre::Light::LT_POINT, const Ogre::ColourValue& diffuse = Ogre::ColourValue(1.0, 1.0, 1.0), const Ogre::ColourValue& specular = Ogre::ColourValue(1.0, 1.0, 1.0));18 void setLight(Ogre::Light::LightTypes type = Ogre::Light::LT_POINT, const ColourValue& diffuse = ColourValue(1.0, 1.0, 1.0), const ColourValue& specular = ColourValue(1.0, 1.0, 1.0)); 17 19 18 20 inline Ogre::Light* getLight() 19 21 { return this->light_; } 20 22 21 inline const std::string& getName() const23 inline const String& getName() const 22 24 { return this->light_->getName(); } 23 25 -
code/branches/FICN/src/orxonox/objects/Mesh.cc
r670 r708 28 28 #include <sstream> 29 29 30 #include <OgreSceneManager.h> 31 32 #include "../Orxonox.h" 33 30 34 #include "Mesh.h" 31 #include "../Orxonox.h"32 35 33 36 namespace orxonox … … 40 43 } 41 44 42 void Mesh::setMesh(const std::string& file)45 void Mesh::setMesh(const String& file) 43 46 { 44 47 std::ostringstream name; -
code/branches/FICN/src/orxonox/objects/Mesh.h
r673 r708 2 2 #define _Mesh_H__ 3 3 4 #include < string>4 #include <OgreEntity.h> 5 5 6 #include "OgreEntity.h" 6 #include "../OrxonoxPrereqs.h" 7 8 #include "misc/String.h" 7 9 8 10 namespace orxonox … … 13 15 Mesh(); 14 16 ~Mesh(); 15 void setMesh(const std::string& file);17 void setMesh(const String& file); 16 18 17 19 inline Ogre::Entity* getEntity() 18 20 { return this->entity_; } 19 21 20 inline const std::string& getName() const22 inline const String& getName() const 21 23 { return this->entity_->getName(); } 22 24 -
code/branches/FICN/src/orxonox/objects/Model.cc
r670 r708 26 26 */ 27 27 28 #include <string> 28 #include "tinyxml/tinyxml.h" 29 #include "misc/Tokenizer.h" 30 #include "misc/String2Number.h" 31 #include "../core/CoreIncludes.h" 32 #include "../Orxonox.h" 29 33 30 34 #include "Model.h" 31 #include "../core/CoreIncludes.h"32 #include "../Orxonox.h"33 #include "../../tinyxml/tinyxml.h"34 #include "../../misc/Tokenizer.h"35 #include "../../misc/String2Number.h"36 35 37 36 namespace orxonox -
code/branches/FICN/src/orxonox/objects/Model.h
r673 r708 2 2 #define _Model_H__ 3 3 4 #include "../OrxonoxPrereqs.h" 5 4 6 #include "WorldEntity.h" 5 7 #include "Mesh.h" 6 #include "../../tinyxml/tinyxml.h" 8 9 class TiXmlElement; // Forward declaration 7 10 8 11 namespace orxonox 9 12 { 13 10 14 class Model : public WorldEntity 11 15 { … … 17 21 18 22 private: 19 std::string meshSrc_;23 String meshSrc_; 20 24 Mesh mesh_; 21 25 void registerAllVariables(); -
code/branches/FICN/src/orxonox/objects/NPC.cc
r627 r708 26 26 */ 27 27 28 #include "../core/CoreIncludes.h" 28 29 #include "NPC.h" 29 #include "../core/Iterator.h"30 #include "../core/ObjectList.h"31 30 32 31 namespace orxonox { -
code/branches/FICN/src/orxonox/objects/NPC.h
r673 r708 8 8 #define _NPC_H__ 9 9 10 // includes 10 #include "../OrxonoxPrereqs.h" 11 11 12 #include "Model.h" 13 14 class TiXmlElement; // Forward declaration 12 15 13 16 namespace orxonox { -
code/branches/FICN/src/orxonox/objects/Projectile.cc
r706 r708 26 26 */ 27 27 28 #include "Projectile.h"29 28 #include "../core/CoreIncludes.h" 29 #include "SpaceShip.h" 30 30 #include "Explosion.h" 31 31 #include "Model.h" 32 33 #include "Projectile.h" 32 34 33 35 namespace orxonox -
code/branches/FICN/src/orxonox/objects/Projectile.h
r697 r708 2 2 #define _Projectile_H__ 3 3 4 #include "../OrxonoxPrereqs.h" 5 4 6 #include "WorldEntity.h" 5 7 #include "BillboardSet.h" 6 #include "SpaceShip.h"7 8 #include "Timer.h" 8 9 9 10 namespace orxonox 10 11 { 12 class SpaceShip; // Forward declaration 13 11 14 class Projectile : public WorldEntity 12 15 { -
code/branches/FICN/src/orxonox/objects/Skybox.cc
r614 r708 27 27 28 28 #include <OgreSceneManager.h> 29 #include <string>30 29 30 #include "tinyxml/tinyxml.h" 31 //#include "misc/Tokenizer.h" 32 //#include "misc/String2Number.h" 33 #include "misc/String.h" 31 34 #include "../Orxonox.h" 32 #include "../../tinyxml/tinyxml.h" 33 #include "../../misc/Tokenizer.h" 34 #include "../../misc/String2Number.h" 35 #include "../core/CoreIncludes.h" 35 36 #include "../core/Debug.h" 36 37 … … 56 57 if (xmlElem->Attribute("src")) 57 58 { 58 std::string skyboxSrc = xmlElem->Attribute("src");59 String skyboxSrc = xmlElem->Attribute("src"); 59 60 mgr->setSkyBox(true, skyboxSrc); 60 61 -
code/branches/FICN/src/orxonox/objects/Skybox.h
r673 r708 2 2 #define _Skybox_H__ 3 3 4 #include "../OrxonoxPrereqs.h" 5 4 6 #include "BaseObject.h" 5 #include "../../tinyxml/tinyxml.h" 7 8 class TiXmlElement; // Forward declaration 6 9 7 10 namespace orxonox -
code/branches/FICN/src/orxonox/objects/SpaceShip.cc
r706 r708 26 26 */ 27 27 28 #include <OIS/OIS.h> 29 #include <OgreCamera.h> 30 #include <OgreRenderWindow.h> 31 #include <OgreParticleSystem.h> 32 #include <OgreSceneNode.h> 33 34 #include "tinyxml/tinyxml.h" 35 #include "misc/String2Number.h" 36 #include "misc/String.h" 37 #include "../core/CoreIncludes.h" 38 #include "../core/Debug.h" 39 #include "../Orxonox.h" 40 #include "../particle/ParticleInterface.h" 41 #include "Projectile.h" 42 28 43 #include "SpaceShip.h" 29 #include "Projectile.h"30 31 #include "../../tinyxml/tinyxml.h"32 #include "../../misc/String2Number.h"33 #include "../core/CoreIncludes.h"34 #include "../Orxonox.h"35 36 #include "OgreCamera.h"37 #include <OgreRenderWindow.h>38 44 39 45 namespace orxonox … … 134 140 135 141 // START CREATING THRUSTER 136 this->tt_ = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");142 this->tt_ = new ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); 137 143 this->tt_->getParticleSystem()->setParameter("local_space","true"); 138 144 this->tt_->newEmitter(); … … 190 196 if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft")) 191 197 { 192 std::string forwardStr = xmlElem->Attribute("forward");193 std::string rotateupdownStr = xmlElem->Attribute("rotateupdown");194 std::string rotaterightleftStr = xmlElem->Attribute("rotaterightleft");195 std::string looprightleftStr = xmlElem->Attribute("looprightleft");198 String forwardStr = xmlElem->Attribute("forward"); 199 String rotateupdownStr = xmlElem->Attribute("rotateupdown"); 200 String rotaterightleftStr = xmlElem->Attribute("rotaterightleft"); 201 String looprightleftStr = xmlElem->Attribute("looprightleft"); 196 202 197 203 String2Number<float>(this->maxSpeedForward_, forwardStr); … … 206 212 { 207 213 208 std::string msStr = xmlElem->Attribute("maxSpeed");209 std::string msabsStr = xmlElem->Attribute("maxSideAndBackSpeed");210 std::string mrStr = xmlElem->Attribute("maxRotation");211 std::string taStr = xmlElem->Attribute("transAcc");212 std::string raStr = xmlElem->Attribute("rotAcc");213 std::string tdStr = xmlElem->Attribute("transDamp");214 std::string rdStr = xmlElem->Attribute("rotDamp");214 String msStr = xmlElem->Attribute("maxSpeed"); 215 String msabsStr = xmlElem->Attribute("maxSideAndBackSpeed"); 216 String mrStr = xmlElem->Attribute("maxRotation"); 217 String taStr = xmlElem->Attribute("transAcc"); 218 String raStr = xmlElem->Attribute("rotAcc"); 219 String tdStr = xmlElem->Attribute("transDamp"); 220 String rdStr = xmlElem->Attribute("rotDamp"); 215 221 216 222 String2Number<float>(this->maxSpeed_, msStr); -
code/branches/FICN/src/orxonox/objects/SpaceShip.h
r697 r708 2 2 #define _SpaceShip_H__ 3 3 4 #include <OIS/OIS.h> 4 #include <OgrePrerequisites.h> 5 #include <OIS/OISMouse.h> 6 7 #include "../OrxonoxPrereqs.h" 5 8 6 9 #include "Model.h" 7 10 #include "BillboardSet.h" 8 #include "OgreSceneNode.h"9 11 10 #include "../../tinyxml/tinyxml.h" 11 #include "../particle/ParticleInterface.h" 12 class TiXmlElement; // Forward declaration 12 13 13 14 namespace orxonox 14 15 { 16 class ParticleInterface; // Forward declaration 17 15 18 class SpaceShip : public Model, public OIS::MouseListener 16 19 { … … 50 53 Ogre::SceneNode* camNode_; 51 54 52 particle::ParticleInterface* tt_;55 ParticleInterface* tt_; 53 56 54 57 BillboardSet redBillboard_; -
code/branches/FICN/src/orxonox/objects/Tickable.h
r673 r708 41 41 #define _Tickable_H__ 42 42 43 #include <OgreFrameListener.h> 44 45 #include "../OrxonoxPrereqs.h" 46 43 47 #include "../core/CoreIncludes.h" 44 #include "OgreFrameListener.h"45 48 46 49 namespace orxonox -
code/branches/FICN/src/orxonox/objects/Timer.h
r673 r708 58 58 #define _Timer_H__ 59 59 60 #include <OgreFrameListener.h> 61 62 #include "../OrxonoxPrereqs.h" 63 60 64 #include "../core/CoreIncludes.h" 61 #include "OgreFrameListener.h"62 65 63 66 namespace orxonox -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r670 r708 26 26 */ 27 27 28 #include <string>29 28 #include <sstream> 30 29 31 #include "WorldEntity.h" 30 #include "tinyxml/tinyxml.h" 31 #include "misc/Tokenizer.h" 32 #include "misc/String2Number.h" 33 #include "misc/String.h" 32 34 #include "../core/CoreIncludes.h" 33 35 #include "../Orxonox.h" 34 #include "../../tinyxml/tinyxml.h" 35 #include "../../misc/Tokenizer.h" 36 #include "../../misc/String2Number.h" 36 #include "WorldEntity.h" 37 37 38 38 namespace orxonox … … 88 88 if (xmlElem->Attribute("position")) 89 89 { 90 std::vector< std::string> pos = tokenize(xmlElem->Attribute("position"),",");90 std::vector<String> pos = tokenize(xmlElem->Attribute("position"),","); 91 91 float x, y, z; 92 92 String2Number<float>(x, pos[0]); … … 98 98 if (xmlElem->Attribute("direction")) 99 99 { 100 std::vector< std::string> pos = tokenize(xmlElem->Attribute("direction"),",");100 std::vector<String> pos = tokenize(xmlElem->Attribute("direction"),","); 101 101 float x, y, z; 102 102 String2Number<float>(x, pos[0]); … … 125 125 if (xmlElem->Attribute("scale")) 126 126 { 127 std::string scaleStr = xmlElem->Attribute("scale");127 String scaleStr = xmlElem->Attribute("scale"); 128 128 float scale; 129 129 String2Number<float>(scale, scaleStr); … … 133 133 if (xmlElem->Attribute("rotationAxis")) 134 134 { 135 std::vector< std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),",");135 std::vector<String> pos = tokenize(xmlElem->Attribute("rotationAxis"),","); 136 136 float x, y, z; 137 137 String2Number<float>(x, pos[0]); -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r673 r708 5 5 #include <OgreSceneNode.h> 6 6 7 #include "../OrxonoxPrereqs.h" 8 9 #include "misc/Vector3.h" 10 #include "misc/Matrix3.h" 11 #include "misc/Quaternion.h" 7 12 #include "network/Synchronisable.h" 8 13 #include "tinyxml/tinyxml.h" -
code/branches/FICN/src/orxonox/objects/weapon_system/AmmunitionDump.cc
r668 r708 59 59 } 60 60 61 void AmmunitionDump::setDumpSize(const Ogre::String &name, int size)61 void AmmunitionDump::setDumpSize(const String &name, int size) 62 62 { 63 63 if (size < 0) … … 70 70 71 71 72 int AmmunitionDump::store(const Ogre::String &name, int quantity)72 int AmmunitionDump::store(const String &name, int quantity) 73 73 { 74 74 int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name); … … 87 87 88 88 89 int AmmunitionDump::getAmmunition(const Ogre::String &name, int quantity)89 int AmmunitionDump::getAmmunition(const String &name, int quantity) 90 90 { 91 91 int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name); … … 103 103 104 104 105 int AmmunitionDump::getStockSize(const Ogre::String &name)105 int AmmunitionDump::getStockSize(const String &name) 106 106 { 107 107 int id = Orxonox::getSingleton()->getBulletMgr()->getAmmunitionID(name); -
code/branches/FICN/src/orxonox/objects/weapon_system/AmmunitionDump.h
r673 r708 32 32 #include <OgrePrerequisites.h> 33 33 34 #include " orxonox/OrxonoxPrereqs.h"34 #include "../../OrxonoxPrereqs.h" 35 35 36 36 #include "network/Synchronisable.h" 37 37 //#include "../core/CoreIncludes.h" 38 #include "misc/String.h" 38 39 #include "../BaseObject.h" 39 40 … … 46 47 ~AmmunitionDump(); 47 48 48 void setDumpSize(const Ogre::String &name, int size);49 void setDumpSize(const String &name, int size); 49 50 50 int store(const Ogre::String &name, int quantiy);51 int store(const String &name, int quantiy); 51 52 52 int getAmmunition(const Ogre::String &name, int quantity);53 int getAmmunition(const String &name, int quantity); 53 54 54 int getStockSize(const Ogre::String &name);55 int getStockSize(const String &name); 55 56 56 57 virtual void loadParams(TiXmlElement* xmlElem) { BaseObject::loadParams(xmlElem); }; -
code/branches/FICN/src/orxonox/objects/weapon_system/BarrelGun.cc
r668 r708 26 26 */ 27 27 28 #include "OgreMath.h" 29 #include "OgreVector3.h" 30 #include "OgreStringConverter.h" 31 #include "OgreSceneNode.h" 32 #include "OgreEntity.h" 33 #include "OgreSceneManager.h" 28 #include <OgreStringConverter.h> 29 #include <OgreSceneNode.h> 30 #include <OgreEntity.h> 31 #include <OgreSceneManager.h> 34 32 33 #include "misc/Vector3.h" 35 34 #include "Bullet.h" 36 35 #include "BulletManager.h" … … 42 41 43 42 namespace orxonox { 44 using namespace Ogre;45 46 43 CreateFactory(BarrelGun); 47 44 … … 78 75 79 76 Ogre::Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity" 80 +StringConverter::toString(bulletCounter_++), "Barrel.mesh");77 + Ogre::StringConverter::toString(bulletCounter_++), "Barrel.mesh"); 81 78 82 79 Vector3 speed = (temp->getOrientation() * Vector3(1, 0, 0)) … … 106 103 107 104 108 109 105 void BarrelGun::secondaryFire() 110 106 { … … 120 116 121 117 Ogre::Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity" 122 +StringConverter::toString(bulletCounter_++), "Barrel.mesh");118 + Ogre::StringConverter::toString(bulletCounter_++), "Barrel.mesh"); 123 119 124 120 Vector3 speed = (temp->getOrientation() * Vector3(1, 0, 0)) -
code/branches/FICN/src/orxonox/objects/weapon_system/BarrelGun.h
r673 r708 32 32 #include <OgrePrerequisites.h> 33 33 34 #include " orxonox/OrxonoxPrereqs.h"34 #include "../../OrxonoxPrereqs.h" 35 35 36 36 #include "BaseWeapon.h" -
code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.cc
r680 r708 26 26 */ 27 27 28 #include "OgreMath.h" 29 #include "OgreVector3.h" 30 #include "OgreStringConverter.h" 31 #include "OgreSceneNode.h" 32 #include "OgreEntity.h" 33 #include "OgreSceneManager.h" 28 #include <OgreStringConverter.h> 29 #include <OgreSceneNode.h> 30 #include <OgreEntity.h> 31 #include <OgreSceneManager.h> 34 32 33 #include "misc/Vector3.h" 35 34 #include "../../Orxonox.h" 36 37 35 #include "Bullet.h" 38 36 #include "BulletManager.h" … … 43 41 44 42 namespace orxonox { 45 using namespace Ogre;46 47 //CreateFactory(BaseWeapon);48 49 43 float BaseWeapon::nextActionValidityPeriod_s = 0.5; 50 44 -
code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.h
r680 r708 32 32 #include <OgrePrerequisites.h> 33 33 34 #include " orxonox/OrxonoxPrereqs.h"34 #include "../../OrxonoxPrereqs.h" 35 35 36 36 #include "../Model.h" … … 116 116 float primaryFiringRate_; 117 117 float secondaryFiringRate_; 118 Ogre::Real primaryBulletSpeed_;119 Ogre::Real secondaryBulletSpeed_;118 Real primaryBulletSpeed_; 119 Real secondaryBulletSpeed_; 120 120 121 121 int magazineSize_; -
code/branches/FICN/src/orxonox/objects/weapon_system/Bullet.cc
r669 r708 26 26 */ 27 27 28 #include "OgreSceneNode.h"29 #include "OgreEntity.h"30 #include "OgreVector3.h"31 32 28 #include "Bullet.h" 33 29 34 35 30 namespace orxonox { 36 using namespace Ogre;37 38 31 CreateFactory(Bullet); 39 32 -
code/branches/FICN/src/orxonox/objects/weapon_system/Bullet.h
r673 r708 32 32 #include <OgrePrerequisites.h> 33 33 34 #include " orxonox/OrxonoxPrereqs.h"34 #include "../../OrxonoxPrereqs.h" 35 35 36 36 #include "../Model.h" -
code/branches/FICN/src/orxonox/objects/weapon_system/BulletManager.cc
r680 r708 26 26 */ 27 27 28 #include "OgreSceneNode.h"29 30 28 #include "BulletManager.h" 31 29 #include "Bullet.h" … … 33 31 34 32 namespace orxonox { 35 using namespace Ogre;36 37 33 CreateFactory(BulletManager); 38 34 … … 86 82 } 87 83 88 int BulletManager::getAmmunitionID(const Ogre::String &ammoName)84 int BulletManager::getAmmunitionID(const String &ammoName) 89 85 { 90 Ogre::String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };86 String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" }; 91 87 int ammoTypesLength = 3; 92 88 -
code/branches/FICN/src/orxonox/objects/weapon_system/BulletManager.h
r673 r708 32 32 #include <OgrePrerequisites.h> 33 33 34 #include " orxonox/OrxonoxPrereqs.h"34 #include "../../OrxonoxPrereqs.h" 35 35 36 36 #include "network/Synchronisable.h" 37 37 #include "tinyxml/tinyxml.h" 38 38 //#include "../core/CoreIncludes.h" 39 #include "misc/String.h" 39 40 #include "../BaseObject.h" 40 41 #include "../Tickable.h" … … 49 50 void addBullet(Bullet*); 50 51 51 int getAmmunitionID(const Ogre::String&);52 int getAmmunitionID(const String&); 52 53 53 54 int getNumberOfAmmos(); -
code/branches/FICN/src/orxonox/objects/weapon_system/WeaponStation.cc
r680 r708 26 26 */ 27 27 28 #include "OgreMath.h"29 #include "OgreVector3.h"30 #include "OgreStringConverter.h"31 #include "OgreSceneNode.h"32 #include "OgreEntity.h"33 #include "OgreSceneManager.h"34 35 28 #include "BaseWeapon.h" 36 37 29 #include "WeaponStation.h" 38 30 39 31 40 32 namespace orxonox { 41 using namespace Ogre;42 43 33 WeaponStation::WeaponStation(int stationSize) 44 34 : slots_(new BaseWeapon*[stationSize]), -
code/branches/FICN/src/orxonox/objects/weapon_system/WeaponStation.h
r673 r708 32 32 #include <OgrePrerequisites.h> 33 33 34 #include " orxonox/OrxonoxPrereqs.h"34 #include "../../OrxonoxPrereqs.h" 35 35 36 36 -
code/branches/FICN/src/orxonox/particle/ParticleInterface.cc
r659 r708 1 1 /* 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * ... 23 * Co-authors: 24 * ... 25 * 26 */ 27 27 28 28 /** 29 30 31 29 * @file ParticleInterface.cc 30 * @brief class to control praticle effects 31 */ 32 32 33 33 #include "ParticleInterface.h" 34 34 // #include <OgreParticleSystem.h> 35 35 // #include <Ogre.h> 36 // #include <OIS/OIS.h>36 // #include <OIS/OIS.h> 37 37 // #include <CEGUI/CEGUI.h> 38 38 // #include <CEGUIRenderer.h> 39 39 40 40 41 using namespace Ogre;42 41 43 namespace particle { 42 namespace orxonox { 43 using namespace Ogre; 44 44 45 45 ParticleInterface::ParticleInterface( SceneManager *sceneManager, String name, String templateName ) … … 122 122 } 123 123 124 // TODO check if this really works124 // TODO check if this really works 125 125 Vector3 ParticleInterface::getPositionOfEmitter ( int emitterNr ) 126 126 { -
code/branches/FICN/src/orxonox/particle/ParticleInterface.h
r673 r708 11 11 #include <OgreSceneManager.h> 12 12 13 #include "../OrxonoxPrereqs.h" 13 14 14 namespace particle 15 #include "misc/Vector3.h" 16 #include "misc/String.h" 17 #include "misc/ColourValue.h" 18 19 20 namespace orxonox 15 21 { 16 22 17 class ParticleInterface18 {19 public:23 class ParticleInterface 24 { 25 public: 20 26 21 ParticleInterface( Ogre::SceneManager *sceneManager, Ogre::String name, Ogre::String templateName );22 ~ParticleInterface( void );27 ParticleInterface( Ogre::SceneManager *sceneManager, String name, String templateName ); 28 ~ParticleInterface( void ); 23 29 24 void inline addToSceneNode( Ogre::SceneNode* sceneNode ) { sceneNode_ = sceneNode; sceneNode_->attachObject(particleSystem_);};25 void inline detachFromSceneNode( void ) { sceneNode_->detachObject(particleSystem_); sceneNode_ = NULL;};30 void inline addToSceneNode( Ogre::SceneNode* sceneNode ) { sceneNode_ = sceneNode; sceneNode_->attachObject(particleSystem_);}; 31 void inline detachFromSceneNode( void ) { sceneNode_->detachObject(particleSystem_); sceneNode_ = NULL;}; 26 32 27 Ogre::ParticleEmitter* getEmitter ( int emitterNr );28 void newEmitter ( void );33 Ogre::ParticleEmitter* getEmitter ( int emitterNr ); 34 void newEmitter ( void ); 29 35 30 Ogre::Vector3 getPositionOfEmitter ( int emitterNr );31 inline void setPositionOfEmitter ( int emitterNr, Ogre::Vector3 position ) { particleSystem_->getEmitter(emitterNr)->setPosition(position); };36 Vector3 getPositionOfEmitter ( int emitterNr ); 37 inline void setPositionOfEmitter ( int emitterNr, Vector3 position ) { particleSystem_->getEmitter(emitterNr)->setPosition(position); }; 32 38 33 inline Ogre::Vector3 getDirection ( void ) { return particleSystem_->getEmitter(0)->getDirection(); };34 void setDirection ( Ogre::Vector3 direction );39 inline Vector3 getDirection ( void ) { return particleSystem_->getEmitter(0)->getDirection(); }; 40 void setDirection ( Vector3 direction ); 35 41 36 inline Ogre::Real getVelocity() {return velocity_; };37 void setVelocity( Ogre::Real v );42 inline Real getVelocity() {return velocity_; }; 43 void setVelocity( Real v ); 38 44 39 inline int getRate() { return rate_; };40 void setRate( int r );45 inline int getRate() { return rate_; }; 46 void setRate( int r ); 41 47 42 inline Ogre::Real getDistance() { return distance_; };43 void setDistance( Ogre::Real d );48 inline Real getDistance() { return distance_; }; 49 void setDistance( Real d ); 44 50 45 inline Ogre::ColourValue getColour( void ) {return colour_;};46 void setColour( Ogre::ColourValue colour );51 inline ColourValue getColour( void ) {return colour_;}; 52 void setColour( ColourValue colour ); 47 53 48 void switchEnable();54 void switchEnable(); 49 55 50 inline Ogre::ParticleSystem* getParticleSystem() { return this->particleSystem_; };56 inline Ogre::ParticleSystem* getParticleSystem() { return this->particleSystem_; }; 51 57 52 private:53 Ogre::SceneNode *sceneNode_;54 Ogre::SceneManager *sceneManager_;55 Ogre::ParticleSystem *particleSystem_;56 Ogre::Real distance_;57 Ogre::Real velocity_;58 int rate_;59 Ogre::ColourValue colour_;60 int numberOfEmitters_;58 private: 59 Ogre::SceneNode *sceneNode_; 60 Ogre::SceneManager *sceneManager_; 61 Ogre::ParticleSystem *particleSystem_; 62 Real distance_; 63 Real velocity_; 64 int rate_; 65 ColourValue colour_; 66 int numberOfEmitters_; 61 67 62 void standardizeEmitters();63 };68 void standardizeEmitters(); 69 }; 64 70 65 71 } 72 66 73 #endif /* _ParticleInterface_H__ */ -
code/branches/FICN/visual_studio/FICN.sln
r682 r708 23 23 EndProjectSection 24 24 ProjectSection(ProjectDependencies) = postProject 25 {35575B59-E1AE-40E8-89C4-2862B5B09B68} = {35575B59-E1AE-40E8-89C4-2862B5B09B68} 26 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 27 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 25 28 {4733BD1A-E04C-458D-8BFB-5010250EA497} = {4733BD1A-E04C-458D-8BFB-5010250EA497} 26 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86}27 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}28 {35575B59-E1AE-40E8-89C4-2862B5B09B68} = {35575B59-E1AE-40E8-89C4-2862B5B09B68}29 29 {E283910F-F911-40FB-A09D-D025CA821912} = {E283910F-F911-40FB-A09D-D025CA821912} 30 30 EndProjectSection … … 42 42 EndProjectSection 43 43 ProjectSection(ProjectDependencies) = postProject 44 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 44 45 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 45 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86}46 46 EndProjectSection 47 47 EndProject … … 50 50 Debug.AspNetCompiler.Debug = "True" 51 51 Release.AspNetCompiler.Debug = "False" 52 EndProjectSection 53 EndProject 54 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestProj", "testproj.vcproj", "{97B226C5-8FD9-4A1E-B50B-5CBF79CF46F5}" 55 ProjectSection(WebsiteProperties) = preProject 56 Debug.AspNetCompiler.Debug = "True" 57 Release.AspNetCompiler.Debug = "False" 58 EndProjectSection 59 ProjectSection(ProjectDependencies) = postProject 60 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 52 61 EndProjectSection 53 62 EndProject … … 82 91 {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Release|Win32.ActiveCfg = Release|Win32 83 92 {2240ECD7-2F48-4431-8E1B-25466A384CCC}.Release|Win32.Build.0 = Release|Win32 93 {97B226C5-8FD9-4A1E-B50B-5CBF79CF46F5}.Debug|Win32.ActiveCfg = Debug|Win32 94 {97B226C5-8FD9-4A1E-B50B-5CBF79CF46F5}.Release|Win32.ActiveCfg = Release|Win32 84 95 EndGlobalSection 85 96 GlobalSection(SolutionProperties) = preSolution -
code/branches/FICN/visual_studio/audio.vcproj
r678 r708 177 177 </File> 178 178 </Filter> 179 <Filter180 Name="Resource Files"181 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"182 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"183 >184 </Filter>185 179 </Files> 186 180 <Globals> -
code/branches/FICN/visual_studio/base_properties.vsprops
r686 r708 11 11 AdditionalIncludeDirectories=""$(SolutionDir)\..\src";"$(OGRE_HOME)\Dependencies\include";"$(OGRE_HOME)\OgreMain\include";"$(ORXONOX_HOME)\dependencies\include"" 12 12 PreprocessorDefinitions="WIN32;__WIN32__;_WIN32;BOOST_ALL_DYN_LINK" 13 WarningLevel=" 2"13 WarningLevel="3" 14 14 Detect64BitPortabilityProblems="true" 15 15 DebugInformationFormat="3" -
code/branches/FICN/visual_studio/base_properties_release.vsprops
r678 r708 17 17 Name="VCLinkerTool" 18 18 LinkIncremental="1" 19 GenerateDebugInformation="true" 19 20 OptimizeReferences="2" 20 21 EnableCOMDATFolding="2" -
code/branches/FICN/visual_studio/benixonox.vcproj
r682 r708 177 177 > 178 178 </File> 179 <File180 RelativePath="..\src\orxonox\SpaceshipSteering.cc"181 >182 </File>183 179 <Filter 184 180 Name="hud" … … 187 183 RelativePath="..\src\orxonox\hud\HUD.cc" 188 184 > 189 <FileConfiguration190 Name="Debug|Win32"191 >192 <Tool193 Name="VCCLCompilerTool"194 ObjectFile="$(IntDir)\$(InputName)1.obj"195 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"196 />197 </FileConfiguration>198 <FileConfiguration199 Name="Release|Win32"200 >201 <Tool202 Name="VCCLCompilerTool"203 ObjectFile="$(IntDir)\$(InputName)1.obj"204 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"205 />206 </FileConfiguration>207 185 </File> 208 186 </Filter> … … 310 288 > 311 289 <File 312 RelativePath="..\src\orxonox\AIClass.h"313 >314 </File>315 <File316 RelativePath="..\src\orxonox\Arrival.h"317 >318 </File>319 <File320 RelativePath="..\src\orxonox\Flocking.h"321 >322 </File>323 <File324 290 RelativePath="..\src\orxonox\GraphicsEngine.h" 325 291 > … … 339 305 <File 340 306 RelativePath="..\src\orxonox\OrxonoxPrereqs.h" 341 >342 </File>343 <File344 RelativePath="..\src\orxonox\SpaceshipSteering.h"345 307 > 346 308 </File> … … 461 423 > 462 424 <File 425 RelativePath="..\src\misc\ColourValue.h" 426 > 427 </File> 428 <File 429 RelativePath="..\src\misc\Math.h" 430 > 431 </File> 432 <File 433 RelativePath="..\src\misc\Matrix3.h" 434 > 435 </File> 436 <File 437 RelativePath="..\src\misc\Quaternion.h" 438 > 439 </File> 440 <File 441 RelativePath="..\src\misc\Sleep.h" 442 > 443 </File> 444 <File 445 RelativePath="..\src\misc\String.h" 446 > 447 </File> 448 <File 463 449 RelativePath="..\src\misc\String2Number.h" 464 450 > … … 466 452 <File 467 453 RelativePath="..\src\misc\Tokenizer.h" 454 > 455 </File> 456 <File 457 RelativePath="..\src\misc\Vector2.h" 458 > 459 </File> 460 <File 461 RelativePath="..\src\misc\Vector3.h" 462 > 463 </File> 464 <File 465 RelativePath="..\src\misc\Vector4.h" 468 466 > 469 467 </File> … … 476 474 > 477 475 <File 476 RelativePath="..\bin\media.cfg" 477 > 478 </File> 479 <File 480 RelativePath="..\bin\ogre.cfg" 481 > 482 </File> 483 <File 484 RelativePath="..\bin\Ogre.log" 485 > 486 </File> 487 <File 488 RelativePath="..\bin\orxonox.ini" 489 > 490 </File> 491 <File 492 RelativePath="..\bin\orxonox.log" 493 > 494 </File> 495 <File 496 RelativePath="..\bin\plugins.cfg" 497 > 498 </File> 499 <File 500 RelativePath="..\bin\plugins_d.cfg" 501 > 502 </File> 503 <File 504 RelativePath="..\bin\quake3settings.cfg" 505 > 506 </File> 507 <File 508 RelativePath="..\bin\resources.cfg" 509 > 510 </File> 511 <File 478 512 RelativePath="..\bin\levels\sample.oxw" 513 > 514 </File> 515 <File 516 RelativePath="..\bin\translation_default.lang" 517 > 518 </File> 519 <File 520 RelativePath="..\bin\translation_german.lang" 479 521 > 480 522 </File> -
code/branches/FICN/visual_studio/core.vcproj
r686 r708 54 54 Name="VCLinkerTool" 55 55 AdditionalDependencies="OgreMain_d.lib" 56 OutputFile="$(OutDir)\$(ProjectName)_d.dll" 56 57 /> 57 58 <Tool … … 183 184 </File> 184 185 <File 186 RelativePath="..\src\orxonox\core\Language.cc" 187 > 188 </File> 189 <File 185 190 RelativePath="..\src\orxonox\core\MetaObjectList.cc" 186 191 > … … 213 218 </File> 214 219 <File 220 RelativePath="..\src\orxonox\core\ColourValue.h" 221 > 222 </File> 223 <File 215 224 RelativePath="..\src\orxonox\core\ConfigValueContainer.h" 216 225 > … … 253 262 </File> 254 263 <File 264 RelativePath="..\src\orxonox\core\Language.h" 265 > 266 </File> 267 <File 255 268 RelativePath="..\src\orxonox\core\MetaObjectList.h" 256 269 > … … 272 285 > 273 286 </File> 274 </Filter>275 <Filter276 Name="Resource Files"277 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"278 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"279 >280 287 </Filter> 281 288 </Files> -
code/branches/FICN/visual_studio/loader.vcproj
r682 r708 153 153 </File> 154 154 </Filter> 155 <Filter156 Name="Resource Files"157 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"158 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"159 >160 </Filter>161 155 </Files> 162 156 <Globals> -
code/branches/FICN/visual_studio/network.vcproj
r678 r708 235 235 </File> 236 236 </Filter> 237 <Filter238 Name="Resource Files"239 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"240 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"241 >242 </Filter>243 237 </Files> 244 238 <Globals> -
code/branches/FICN/visual_studio/tinyxml.vcproj
r678 r708 163 163 </File> 164 164 </Filter> 165 <Filter166 Name="Resource Files"167 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"168 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"169 >170 </Filter>171 165 </Files> 172 166 <Globals>
Note: See TracChangeset
for help on using the changeset viewer.