Changeset 618
- Timestamp:
- Dec 18, 2007, 4:47:58 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/Arrival.h
r597 r618 6 6 #define Arrical_Class 7 7 8 #include <Ogre.h>8 // #include <Ogre.h> 9 9 #include <OgreVector3.h> 10 10 … … 21 21 22 22 public: 23 Vector3 location; //locationvector of the element24 Vector3 speed; //speedvector of the element25 Vector3 acceleration; //accelerationvector of the element26 Vector3 target; //target to arrive27 int accelerationForwards; //from steering-interface28 int MaxSpeed; //from steering-interface23 Vector3 location; //!< locationvector of the element 24 Vector3 speed; //!< speedvector of the element 25 Vector3 acceleration; //!< accelerationvector of the element 26 Vector3 target; //!< target to arrive 27 int accelerationForwards; //!< from steering-interface 28 int MaxSpeed; //!< from steering-interface 29 29 30 30 … … 70 70 speed = (speed+getDirection()); 71 71 speed.normalise(); 72 speed = speed*length; 72 speed = speed*length; 73 73 if (relativeDirectApproach > 4) { 74 74 //accelerate -
code/branches/FICN/src/orxonox/Flocking.h
r609 r618 5 5 #define Flocking_Class 6 6 7 #include <Ogre.h>7 // #include <Ogre.h> 8 8 #include <OgreVector3.h> 9 9 … … 19 19 20 20 public: 21 Ogre::Vector3 location; //locationvector of the element22 Ogre::Vector3 speed; //speedvector of the element23 Ogre::Vector3 acceleration; //accelerationvector of the element24 bool movable; //movability of the element, (false) gives the possiblity that an object can`t be moved by flocking but still gets into the calculation25 static int const SEPERATIONDISTANCE = 300; //detectionradius of seperation26 static int const ALIGNMENTDISTANCE = 300; //detectionradius of alignment27 static int const COHESIONDISTANCE = 5000; //detectionradius of cohesion28 static int const ANZELEMENTS = 9; //number of elements21 Ogre::Vector3 location; //!< locationvector of the element 22 Ogre::Vector3 speed; //!< speedvector of the element 23 Ogre::Vector3 acceleration; //!< accelerationvector of the element 24 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 25 static int const SEPERATIONDISTANCE = 300; //!< detectionradius of seperation 26 static int const ALIGNMENTDISTANCE = 300; //!< detectionradius of alignment 27 static int const COHESIONDISTANCE = 5000; //!< detectionradius of cohesion 28 static int const ANZELEMENTS = 9; //!< number of elements 29 29 30 // default constructor30 //! default constructor 31 31 Element() { 32 acceleration = (0,0,0);33 speed = (0,0,0);34 location = (0,0,0);32 acceleration = Ogre::Vector3(0,0,0); 33 speed = Ogre::Vector3(0,0,0); 34 location = Ogre::Vector3(0,0,0); 35 35 movable = true; 36 36 } 37 37 38 //constructor 38 /** constructor 39 * @param location_ sets locationvector of the element 40 * @param speed_ sets speedvector of the element 41 * @param acceleration_ sets accelerationvector of the element 42 * @param movable_ sets movability of the element 43 */ 39 44 Element(Ogre::Vector3 location_, Ogre::Vector3 speed_, Ogre::Vector3 acceleration_, bool movable_) { 40 45 acceleration = acceleration_; … … 44 49 } 45 50 46 // function to chance values of an element51 //! function to chance values of an element 47 52 void setValues(Ogre::Vector3 location_, Ogre::Vector3 speed_, Ogre::Vector3 acceleration_, bool movable_) { 48 53 acceleration = acceleration_; … … 52 57 } 53 58 54 //calculates the distance between the element and an other point given by temp 55 float getDistance(Element temp) { 56 Ogre::Vector3 distance = temp.location-location; 59 /** calculates the distance between the element and an other point given by temp 60 * @param e remote object to calculate distance to 61 */ 62 float getDistance(Element e) { 63 Ogre::Vector3 distance = e.location - location; 57 64 return distance.length(); 58 65 } 59 66 60 // updates the data of an element67 //! updates the data of an element 61 68 void update(Element arrayOfElements[]) { 62 69 if (this->movable == true) {calculateAcceleration(arrayOfElements);} //if element is movable, calculate acceleration 63 70 } 64 71 65 // calculates the new acceleration of an element72 //! calculates the new acceleration of an element 66 73 void calculateAcceleration(Element arrayOfElements[]) { 67 74 acceleration = separation(arrayOfElements) + alignment(arrayOfElements) + cohesion(arrayOfElements); //acceleration consisting of flocking-functions 68 75 } 69 76 70 // separation-function (keep elements separated, avoid crashs)77 //! separation-function (keep elements separated, avoid crashs) 71 78 Ogre::Vector3 separation(Element arrayOfElements[]) { 72 79 using namespace Ogre; … … 94 101 } 95 102 96 // alignment-function (lead elements to the same heading)103 //! alignment-function (lead elements to the same heading) 97 104 Ogre::Vector3 alignment(Element arrayOfElements[]) { 98 105 using namespace Ogre; … … 113 120 } 114 121 115 // cohseion-function (keep elements close to each other)122 //! cohseion-function (keep elements close to each other) 116 123 Ogre::Vector3 cohesion(Element arrayOfElements[]) { 117 124 using namespace Ogre; -
code/branches/FICN/src/orxonox/hud/HUD.cc
r588 r618 1 1 #include "HUD.h" 2 #include <Ogre.h>3 #include <OIS/OIS.h>2 // #include <Ogre.h> 3 // #include <OIS/OIS.h> 4 4 //#include <CEGUI/CEGUI.h> 5 5 //#include <CEGUIRenderer.h> -
code/branches/FICN/src/orxonox/hud/HUD.h
r609 r618 2 2 #define MODULE_HUD_H 3 3 4 #include <Ogre.h>5 #include <OIS/OIS.h>4 // #include <Ogre.h> 5 // #include <OIS/OIS.h> 6 6 //#include <CEGUI/CEGUI.h> 7 7 //#include <CEGUIRenderer.h> 8 #include <OgreOverlayManager.h> 9 #include <OgreOverlayElement.h> 10 #include <OgreStringConverter.h> 8 11 9 12 -
code/branches/FICN/src/orxonox/objects/Camera.cc
r614 r618 30 30 void Camera::loadParams(TiXmlElement* xmlElem) 31 31 { 32 32 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); 33 33 34 35 36 //<Camera name="Camera" pos="0,0,-250" lookat="0,0,0" />34 if (xmlElem->Attribute("name") && xmlElem->Attribute("pos") && xmlElem->Attribute("lookat") && xmlElem->Attribute("node")) 35 { 36 // <Camera name="Camera" pos="0,0,-250" lookat="0,0,0" /> 37 37 38 39 40 38 std::string name = xmlElem->Attribute("name"); 39 std::string pos = xmlElem->Attribute("pos"); 40 std::string lookat = xmlElem->Attribute("lookat"); 41 41 42 42 Ogre::Camera *cam = mgr->createCamera(name); 43 43 44 45 46 47 48 44 float x, y, z; 45 std::vector<std::string> posVec = tokenize(xmlElem->Attribute("pos"),","); 46 String2Number<float>(x, posVec[0]); 47 String2Number<float>(y, posVec[1]); 48 String2Number<float>(z, posVec[2]); 49 49 50 50 cam->setPosition(Vector3(x,y,z)); 51 51 52 53 54 55 52 posVec = tokenize(xmlElem->Attribute("lookat"),","); 53 String2Number<float>(x, posVec[0]); 54 String2Number<float>(y, posVec[1]); 55 String2Number<float>(z, posVec[2]); 56 56 57 57 cam->lookAt(Vector3(x,y,z)); 58 58 59 59 std::string node = xmlElem->Attribute("node"); 60 60 61 62 61 Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->createChildSceneNode(node); //getChild(node); 62 sceneNode->attachObject((Ogre::MovableObject*)cam); 63 63 64 64 65 65 Ogre::Viewport* vp = orxonox::Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam); 66 66 67 67 68 69 68 COUT(4) << "Loader: Created camera "<< name << std::endl << std::endl; 69 } 70 70 } 71 71 } -
code/branches/FICN/src/orxonox/objects/SceneNode.cc
r616 r618 25 25 void SceneNode::loadParams(TiXmlElement* xmlElem) 26 26 { 27 28 29 27 if (xmlElem->Attribute("name") && xmlElem->Attribute("pos")) 28 { 29 name_ = xmlElem->Attribute("name"); 30 30 31 32 33 34 35 31 std::vector<std::string> pos = tokenize(xmlElem->Attribute("pos"),","); 32 //float x, y, z_; 33 String2Number<float>(x_, pos[0]); 34 String2Number<float>(y_, pos[1]); 35 String2Number<float>(z_, pos[2]); 36 36 37 37 sx_ = 1; sy_ = 1; sz_ = 1; 38 38 if (xmlElem->Attribute("scale")) 39 39 { 40 41 42 43 40 pos = tokenize(xmlElem->Attribute("scale"),","); 41 String2Number<float>(sx_, pos[0]); 42 String2Number<float>(sy_, pos[1]); 43 String2Number<float>(sz_, pos[2]); 44 44 } 45 45 yaw_ = 0.0; … … 67 67 68 68 COUT(4) << "Loader: loaded node "<< name_ <<" : "<< x_ <<" " << y_ << " " << z_ << std::endl << std::endl; 69 69 } 70 70 } 71 71 -
code/branches/FICN/src/orxonox/particle/ParticleInterface.cc
r592 r618 27 27 28 28 #include "ParticleInterface.h" 29 #include <Ogre.h> 29 // #include <OgreParticleSystem.h> 30 // #include <Ogre.h> 30 31 //#include <OIS/OIS.h> 31 32 // #include <CEGUI/CEGUI.h> -
code/branches/FICN/src/orxonox/particle/ParticleInterface.h
r609 r618 3 3 4 4 // #include "ParticleInterface.h" 5 #include <Ogre.h>6 #include <OIS/OIS.h>5 // #include <Ogre.h> 6 // #include <OIS/OIS.h> 7 7 // #include <CEGUI/CEGUI.h> 8 8 // #include <CEGUIRenderer.h> 9 #include <OgreParticleSystem.h> 10 #include <OgreParticleEmitter.h> 11 #include <OgreSceneManager.h> 9 12 10 13
Note: See TracChangeset
for help on using the changeset viewer.