Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 618


Ignore:
Timestamp:
Dec 18, 2007, 4:47:58 PM (16 years ago)
Author:
nicolasc
Message:
  • changed comments to doxygen tags in flocking
  • reduced ogre depency in HUD and ParticleInterface
  • various
Location:
code/branches/FICN/src/orxonox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/Arrival.h

    r597 r618  
    66#define Arrical_Class
    77
    8 #include <Ogre.h>
     8// #include <Ogre.h>
    99#include <OgreVector3.h>
    1010
     
    2121
    2222  public:
    23     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
     23    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
    2929
    3030
     
    7070      speed = (speed+getDirection());
    7171      speed.normalise();
    72       speed = speed*length; 
     72      speed = speed*length;
    7373      if (relativeDirectApproach > 4) {
    7474        //accelerate
  • code/branches/FICN/src/orxonox/Flocking.h

    r609 r618  
    55#define Flocking_Class
    66
    7 #include <Ogre.h>
     7// #include <Ogre.h>
    88#include <OgreVector3.h>
    99
     
    1919
    2020  public:
    21     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
     21    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
    2929
    30   //default constructor
     30  //! default constructor
    3131  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);
    3535    movable = true;
    3636  }
    3737
    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   */
    3944  Element(Ogre::Vector3 location_, Ogre::Vector3 speed_, Ogre::Vector3 acceleration_, bool movable_) {
    4045    acceleration = acceleration_;
     
    4449  }
    4550
    46   //function to chance values of an element
     51  //! function to chance values of an element
    4752  void setValues(Ogre::Vector3 location_, Ogre::Vector3 speed_, Ogre::Vector3 acceleration_, bool movable_) {
    4853    acceleration = acceleration_;
     
    5257  }
    5358
    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;
    5764    return distance.length();
    5865  }
    5966
    60   //updates the data of an element
     67  //! updates the data of an element
    6168  void update(Element arrayOfElements[]) {
    6269    if (this->movable == true) {calculateAcceleration(arrayOfElements);} //if element is movable, calculate acceleration
    6370  }
    6471
    65   //calculates the new acceleration of an element
     72  //! calculates the new acceleration of an element
    6673  void calculateAcceleration(Element arrayOfElements[]) {
    6774    acceleration = separation(arrayOfElements) + alignment(arrayOfElements) + cohesion(arrayOfElements);  //acceleration consisting of flocking-functions
    6875  }
    6976
    70   //separation-function (keep elements separated, avoid crashs)
     77  //! separation-function (keep elements separated, avoid crashs)
    7178  Ogre::Vector3 separation(Element arrayOfElements[]) {
    7279    using namespace Ogre;
     
    94101  }
    95102
    96   //alignment-function (lead elements to the same heading)
     103  //! alignment-function (lead elements to the same heading)
    97104  Ogre::Vector3 alignment(Element arrayOfElements[]) {
    98105    using namespace Ogre;
     
    113120  }
    114121
    115   //cohseion-function (keep elements close to each other)
     122  //! cohseion-function (keep elements close to each other)
    116123  Ogre::Vector3 cohesion(Element arrayOfElements[]) {
    117124    using namespace Ogre;
  • code/branches/FICN/src/orxonox/hud/HUD.cc

    r588 r618  
    11#include "HUD.h"
    2 #include <Ogre.h>
    3 #include <OIS/OIS.h>
     2// #include <Ogre.h>
     3// #include <OIS/OIS.h>
    44//#include <CEGUI/CEGUI.h>
    55//#include <CEGUIRenderer.h>
  • code/branches/FICN/src/orxonox/hud/HUD.h

    r609 r618  
    22#define MODULE_HUD_H
    33
    4 #include <Ogre.h>
    5 #include <OIS/OIS.h>
     4// #include <Ogre.h>
     5// #include <OIS/OIS.h>
    66//#include <CEGUI/CEGUI.h>
    77//#include <CEGUIRenderer.h>
     8#include <OgreOverlayManager.h>
     9#include <OgreOverlayElement.h>
     10#include <OgreStringConverter.h>
    811
    912
  • code/branches/FICN/src/orxonox/objects/Camera.cc

    r614 r618  
    3030    void Camera::loadParams(TiXmlElement* xmlElem)
    3131    {
    32         Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
     32      Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
    3333
    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" />
     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" />
    3737
    38                 std::string name = xmlElem->Attribute("name");
    39                 std::string pos = xmlElem->Attribute("pos");
    40                 std::string lookat = xmlElem->Attribute("lookat");
     38        std::string name = xmlElem->Attribute("name");
     39        std::string pos = xmlElem->Attribute("pos");
     40        std::string lookat = xmlElem->Attribute("lookat");
    4141
    42                 Ogre::Camera *cam = mgr->createCamera(name);
     42        Ogre::Camera *cam = mgr->createCamera(name);
    4343
    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]);
     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]);
    4949
    50                 cam->setPosition(Vector3(x,y,z));
     50        cam->setPosition(Vector3(x,y,z));
    5151
    52                 posVec = tokenize(xmlElem->Attribute("lookat"),",");
    53                 String2Number<float>(x, posVec[0]);
    54                 String2Number<float>(y, posVec[1]);
    55                 String2Number<float>(z, posVec[2]);
     52        posVec = tokenize(xmlElem->Attribute("lookat"),",");
     53        String2Number<float>(x, posVec[0]);
     54        String2Number<float>(y, posVec[1]);
     55        String2Number<float>(z, posVec[2]);
    5656
    57                 cam->lookAt(Vector3(x,y,z));
     57        cam->lookAt(Vector3(x,y,z));
    5858
    59                 std::string node = xmlElem->Attribute("node");
     59        std::string node = xmlElem->Attribute("node");
    6060
    61                     Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->createChildSceneNode(node); //getChild(node);
    62                     sceneNode->attachObject((Ogre::MovableObject*)cam);
     61        Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->createChildSceneNode(node); //getChild(node);
     62        sceneNode->attachObject((Ogre::MovableObject*)cam);
    6363
    6464
    65                     Ogre::Viewport* vp = orxonox::Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     65        Ogre::Viewport* vp = orxonox::Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
    6666
    6767
    68                 COUT(4) << "Loader: Created camera "<< name  << std::endl << std::endl;
    69         }
     68        COUT(4) << "Loader: Created camera "<< name  << std::endl << std::endl;
     69      }
    7070   }
    7171}
  • code/branches/FICN/src/orxonox/objects/SceneNode.cc

    r616 r618  
    2525    void SceneNode::loadParams(TiXmlElement* xmlElem)
    2626    {
    27         if (xmlElem->Attribute("name") && xmlElem->Attribute("pos"))
    28         {
    29                 name_ = xmlElem->Attribute("name");
     27      if (xmlElem->Attribute("name") && xmlElem->Attribute("pos"))
     28      {
     29        name_ = xmlElem->Attribute("name");
    3030
    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]);
     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]);
    3636
    3737        sx_ = 1; sy_ = 1; sz_ = 1;
    3838        if (xmlElem->Attribute("scale"))
    3939        {
    40                   pos = tokenize(xmlElem->Attribute("scale"),",");
    41                   String2Number<float>(sx_, pos[0]);
    42                   String2Number<float>(sy_, pos[1]);
    43                   String2Number<float>(sz_, pos[2]);
     40          pos = tokenize(xmlElem->Attribute("scale"),",");
     41           String2Number<float>(sx_, pos[0]);
     42          String2Number<float>(sy_, pos[1]);
     43          String2Number<float>(sz_, pos[2]);
    4444        }
    4545        yaw_ = 0.0;
     
    6767
    6868        COUT(4) << "Loader: loaded node "<< name_ <<" : "<< x_ <<" " << y_ << " " << z_ << std::endl << std::endl;
    69         }
     69      }
    7070   }
    7171
  • code/branches/FICN/src/orxonox/particle/ParticleInterface.cc

    r592 r618  
    2727
    2828#include "ParticleInterface.h"
    29 #include <Ogre.h>
     29// #include <OgreParticleSystem.h>
     30// #include <Ogre.h>
    3031//#include <OIS/OIS.h>
    3132// #include <CEGUI/CEGUI.h>
  • code/branches/FICN/src/orxonox/particle/ParticleInterface.h

    r609 r618  
    33
    44// #include "ParticleInterface.h"
    5 #include <Ogre.h>
    6 #include <OIS/OIS.h>
     5// #include <Ogre.h>
     6// #include <OIS/OIS.h>
    77// #include <CEGUI/CEGUI.h>
    88// #include <CEGUIRenderer.h>
     9#include <OgreParticleSystem.h>
     10#include <OgreParticleEmitter.h>
     11#include <OgreSceneManager.h>
    912
    1013
Note: See TracChangeset for help on using the changeset viewer.