Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 14, 2016, 3:57:03 PM (8 years ago)
Author:
ooguz
Message:

Bugs fixed

Location:
code/branches/QuestGuide_HS16/src/modules/waypoints
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/QuestGuide_HS16/src/modules/waypoints/CMakeLists.txt

    r11274 r11287  
    1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
     1ADD_SOURCE_FILES(WAYPOINTS_SRC_FILES
    22
    33  Waypointarrow.cc
     
    66)
    77
     8
     9ORXONOX_ADD_LIBRARY(waypoints
     10  MODULE
     11  FIND_HEADER_FILES
     12  LINK_LIBRARIES
     13    orxonox
     14    overlays
     15    objects
     16  SOURCE_FILES ${WAYPOINTS_SRC_FILES}
     17)
  • code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.cc

    r11274 r11287  
    55#include "util/OrxAssert.h"
    66#include "core/CoreIncludes.h"
     7#include "core/XMLPort.h"
     8
    79
    810namespace orxonox
     11
     12
    913{
    1014    RegisterClass(Waypoint);
     
    3741    void Waypoint::XMLPort(Element& xmlelement, XMLPort::Mode mode){
    3842        SUPER(Waypoint, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
    39         XMLPortParam(Waypoint, "order", getOrder, setOrder, xmlelement, mode);
     43       
     44        XMLPortParam(Waypoint, "order", setOrder, getOrder, xmlelement, mode);
    4045
    4146    }
  • code/branches/QuestGuide_HS16/src/modules/waypoints/Waypoint.h

    r11274 r11287  
    55
    66#include "OrxonoxPrereqs.h"
    7 #include "StaticEntity.h"
     7#include "worldentities/StaticEntity.h"
    88#include "graphics/Model.h"
    9 #include "modules/objects/triggers/DistanceTrigger.h"
     9#include "objects/triggers/DistanceTrigger.h"
    1010
    1111#include <map>
     
    4343            }
    4444
     45            inline void setOrder(int number){
     46                this->order = number;
     47            }
    4548
    4649            inline int getOrder(){
    47                 return order;
     50                return this->order;
    4851            }
    4952
  • code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.cc

    r11274 r11287  
    44#include <BulletDynamics/Dynamics/btRigidBody.h>
    55#include "util/OrxAssert.h"
     6#include "WaypointGroup.h"
    67#include "core/CoreIncludes.h"
     8#include "core/XMLPort.h"
     9
    710
    811namespace orxonox
     
    1215    WaypointGroup::WaypointGroup(Context* context) : StaticEntity(context)
    1316    {
    14         /*RegisterObject(Waypoint);
    15         model = new Model(this->getContext());
    16         model->setMeshSource("cube.mesh");  // Name of the arrow file for now bottle
    17         this->attach(model);
    18         model->setScale(3);
     17        RegisterObject(WaypointGroup);
     18        //model = new Model(this->getContext());
     19        //model->setMeshSource("cube.mesh");  // Name of the arrow file for now bottle
     20        //is->attach(model);
     21        //model->setScale(3);
    1922        //model->setOrientation(Vector3(0,0,-1));
    20         model->setPosition(Vector3(0.0,0.0,0.0));        // this is wrong, it has to be triggered
    21         waypoint_active = false;
    22         distancetrigger = new DistanceTrigger(this->getContext());   
    23         distancetrigger->setDistance(100);
    24         this->attach(distancetrigger);
    25         */
     23        //model->setPosition(Vector3(0.0,0.0,0.0));        // this is wrong, it has to be triggered
     24        //waypoint_active = false;
     25        //distancetrigger = new DistanceTrigger(this->getContext());   
     26        //distancetrigger->setDistance(100);
     27        //this->attach(distancetrigger);
     28       
    2629    }
    2730
     
    3538     //setOrientation()
    3639
    37     Waypoint* WaypointGroup::getWaypoint(){
    38         for (Waypoint* waypoint : this->waypoints_){
    39             if(!(waypoint->waypoint_actived)){
    40                 waypoint->enable_waypoint();
    41                 return waypoint;
     40 
     41
     42
     43    Waypoint* WaypointGroup::getWaypoint(unsigned int index)
     44    {
     45        unsigned int i = 0;
     46        for (Waypoint* child : this->waypoints_)
     47        {
     48            if (i == index)
     49                return child;
     50            ++i;
     51        }
     52        return nullptr;
     53    }
     54
     55    void WaypointGroup::setWaypoint(Waypoint* object)
     56    {
     57        this->waypoints_.insert(object);
     58    }
     59
     60
     61    Waypoint* WaypointGroup::getActive(){
     62          for (Waypoint* object : this->waypoints_){
     63            if(!(object->waypoint_actived)){
     64                object->enable_waypoint();
     65                return object;
    4266            }
    4367        }
     
    4569
    4670
    47     Waypoint* WaypointGroup::getWaypoint(unsigned int index)
    48     {
    49         unsigned int i = 0;
    50         for (Waypoint* waypoint : this->waypoints_)
    51         {
    52    
    53             if (i == index)
    54                 return waypoint;
    55             ++i;
    56         }
    57         return nullptr;
    58     }
    5971
    60     void WaypointGroup::addWaypoint(Waypoint* object)
    61     {
    62         this->waypoints_.insert(object);
     72   
     73
     74    void WaypointGroup::XMLPort(Element& xmlelement, XMLPort::Mode mode){
     75        SUPER(WaypointGroup, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
     76        XMLPortObject(WaypointGroup, Waypoint, "waypoints", setWaypoint, getWaypoint, xmlelement, mode);
     77
    6378    }
    6479
    6580
    6681
    67     void Waypoint::XMLPort(Element& xmlelement, XMLPort::Mode mode){
    68         SUPER(Waypoint, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
    69         XMLPortObject(WaypointGroup, Waypoint, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
    70 
    71     }
    72 
    73 
    7482}
  • code/branches/QuestGuide_HS16/src/modules/waypoints/WaypointGroup.h

    r11274 r11287  
    11
    22
    3 #ifndef _Waypoint_H__
    4 #define _Waypoint_H__
     3#ifndef _WaypointGroup_H__
     4#define _WaypointGroup_H__
    55
    66#include "OrxonoxPrereqs.h"
    7 #include "StaticEntity.h"
     7#include "worldentities/StaticEntity.h"
    88#include "graphics/Model.h"
    9 #include "modules/objects/triggers/DistanceTrigger.h"
     9#include "objects/triggers/DistanceTrigger.h"
    1010
    1111#include <map>
    1212#include <string>
    1313
     14#include "core/CoreIncludes.h"
    1415#include "util/OgreForwardRefs.h"
    15 #include "tools/interfaces/Tickable.h"
    16 #include "Waypoints.h"
     16#include "Waypoint.h"
    1717
    1818namespace orxonox
     
    4040            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4141
     42        //Waypoint* getWaypoint();
    4243        Waypoint* getWaypoint(unsigned int index);
     44        void setWaypoint(Waypoint* object);
    4345
    44         Way
     46
     47       
    4548
    4649
     
    5457            //virtual bool isCollisionTypeLegal(CollisionType type) const override;
    5558         
    56         std::set<Waypoint*> waypoints;
     59        std::set<Waypoint*> waypoints_;
    5760
    5861            // network callbacks
  • code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.cc

    r11274 r11287  
    1414        RegisterObject(Waypointarrow);
    1515        model = new Model(this->getContext());
    16         model->setMeshSource("Arrow.mesh");  // Name of the arrow file for now bottle
     16        model->setMeshSource("cokebottle.mesh");  // Name of the arrow file for now bottle
    1717        this->attach(model);
    1818        model->setScale(3);
    19         model->setOrientation(Vector3(0,0,-1));
     19       // model->setOrientation(Vector3(0,0,-1));
    2020        model->setPosition(Vector3(0,15,0));
     21       
    2122    }
    2223
  • code/branches/QuestGuide_HS16/src/modules/waypoints/Waypointarrow.h

    r11274 r11287  
    11
    22
    3 #ifndef _Waypoint_H__
    4 #define _Waypoint_H__
     3#ifndef _Waypointarrow_H__
     4#define _Waypointarrow_H__
    55
    66#include "OrxonoxPrereqs.h"
    7 #include "StaticEntity.h"
     7#include "worldentities/StaticEntity.h"
    88#include "graphics/Model.h"
    99
    10 #include <map>
    1110#include <string>
    1211
     
    1514#include "interfaces/RadarListener.h"
    1615#include "WaypointGroup.h"
     16#include "core/XMLPort.h"
     17
    1718
    1819namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.