Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3463 in orxonox.OLD for orxonox/branches/trackManager/src


Ignore:
Timestamp:
Mar 9, 2005, 10:50:20 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/trackManager: backloop-check created

Location:
orxonox/branches/trackManager/src
Files:
6 edited
2 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/trackManager/src/Makefile.am

    r3430 r3463  
    3131                 p_node.cc \
    3232                 null_parent.cc \
     33                 track_node.cc \
    3334                 base_object.cc \
    3435                 helper_parent.cc \
     
    3738                 curve.cc \
    3839                 glmenu_imagescreen.cc \
    39                  skysphere.cc
     40                 skysphere.cc 
    4041
    4142noinst_HEADERS = ability.h \
  • orxonox/branches/trackManager/src/Makefile.in

    r3430 r3463  
    6161        objModel.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
    6262        texture.$(OBJEXT) list.$(OBJEXT) p_node.$(OBJEXT) \
    63         null_parent.$(OBJEXT) base_object.$(OBJEXT) \
    64         helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \
    65         matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
    66         skysphere.$(OBJEXT)
     63        null_parent.$(OBJEXT) track_node.$(OBJEXT) \
     64        base_object.$(OBJEXT) helper_parent.$(OBJEXT) \
     65        track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \
     66        glmenu_imagescreen.$(OBJEXT) skysphere.$(OBJEXT)
    6767orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    6868orxonox_LDADD = $(LDADD)
     
    8787@AMDEP_TRUE@    ./$(DEPDIR)/player.Po ./$(DEPDIR)/skysphere.Po \
    8888@AMDEP_TRUE@    ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \
    89 @AMDEP_TRUE@    ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \
     89@AMDEP_TRUE@    ./$(DEPDIR)/track_manager.Po \
     90@AMDEP_TRUE@    ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \
    9091@AMDEP_TRUE@    ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
    9192CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     
    240241                 p_node.cc \
    241242                 null_parent.cc \
     243                 track_node.cc \
    242244                 base_object.cc \
    243245                 helper_parent.cc \
     
    246248                 curve.cc \
    247249                 glmenu_imagescreen.cc \
    248                  skysphere.cc
     250                 skysphere.cc 
    249251
    250252noinst_HEADERS = ability.h \
     
    396398@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
    397399@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
     400@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_node.Po@am__quote@
    398401@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    399402@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world.Po@am__quote@
  • orxonox/branches/trackManager/src/track_manager.cc

    r3432 r3463  
    8888
    8989
     90/**
     91   \brief checks if there are any BackLoops in the Track
     92   \param trackElem the trackElement to check about
     93   it simply does this by looking if the current trackElem is found again somewhere else in the Track
     94*/
     95bool TrackElement::backLoopCheck(TrackElement* trackElem)
     96{
     97  if (this->childCount == 0)
     98    return true;
     99  else
     100    {
     101      for (int i = 0; i < this->childCount; i++)
     102        if(!this->children[i]->backLoopCheck(trackElem))
     103          return false;
     104     
     105      return true;
     106    }
     107}
    90108
    91109
     
    137155TrackManager* TrackManager::getInstance(void)
    138156{
    139   if (singletonRef)
    140     return singletonRef;
     157  if (TrackManager::singletonRef)
     158    return TrackManager::singletonRef;
    141159  else
    142     return singletonRef = new TrackManager();
     160    return TrackManager::singletonRef = new TrackManager();
    143161}
    144162
     
    370388{
    371389  printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]);
     390
     391  // checking if there is a back-loop-connection and ERROR if it is.
     392  TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]);
     393  if (!tmpTrackElem->backLoopCheck(tmpTrackElem))
     394    PRINTF(1)("Backloop connection detected at joining trackElements\n");
    372395
    373396  // chanching work-on to temporary value. going back at the end.
  • orxonox/branches/trackManager/src/track_manager.h

    r3430 r3463  
    3535
    3636  TrackElement* findByID(unsigned int trackID);
     37  bool backLoopCheck(TrackElement* trackElem);
    3738
    3839  bool isFresh;              //!< If no Points where added until now
  • orxonox/branches/trackManager/src/track_node.cc

    r3455 r3463  
    1212
    1313   ### File Specific:
    14    main-programmer: Patrick Boenzli
     14   main-programmer: Benjamin Grauer
    1515   co-programmer: ...
    1616*/
    1717
    1818
     19#include "track_node.h"
     20
    1921#include "null_parent.h"
    2022
     23#include "track_manager.h"
    2124
    2225using namespace std;
    2326
    24 NullParent* NullParent::singletonRef = 0;
     27TrackNode* TrackNode::singletonRef = 0;
    2528
    26 NullParent* NullParent::getInstance ()
     29TrackNode* TrackNode::getInstance ()
    2730{
    28   if( singletonRef == NULL)
    29     singletonRef = new NullParent ();
     31  if (singletonRef == NULL)
     32    singletonRef = new TrackNode ();
    3033  return singletonRef;
    3134}
     
    3639   \todo this constructor is not jet implemented - do it
    3740*/
    38 NullParent::NullParent ()
     41TrackNode::TrackNode ()
    3942{
    40   this->parent = this;
     43  this->setParent(NullParent::getInstance());
     44  this->trackManager = TrackManager::getInstance();
    4145  this->mode = ALL;
    4246}
    4347
    4448
    45 NullParent::NullParent (Vector* absCoordinate)
     49TrackNode::TrackNode (Vector* absCoordinate)
    4650{
    47   this->parent = this;
     51  this->parent = NullParent::getInstance();
     52  this->trackManager = TrackManager::getInstance();
    4853  this->mode = ALL;
    4954  this->absCoordinate = *absCoordinate;
     
    5661   \todo this deconstructor is not jet implemented - do it
    5762*/
    58 NullParent::~NullParent ()
     63TrackNode::~TrackNode ()
    5964{
    60   delete singletonRef;
    6165  singletonRef = NULL;
    6266}
    63 
    64 
    65 
    6667
    6768/**
     
    7273   worry, normaly...
    7374*/
    74 void NullParent::update (float timeStamp)
     75void TrackNode::update (float timeStamp)
    7576{
    76   this->absCoordinate = this->relCoordinate;
    77   this->absDirection = parent->getAbsDir () * this->relDirection;
     77  this->absCoordinate = trackManager->calcPos();
     78  this->absDirection = Quaternion(trackManager->calcDir(), Vector(0,1,0));
    7879 
    7980  PNode* pn = this->children->enumerate ();
  • orxonox/branches/trackManager/src/track_node.h

    r3455 r3463  
    11/*!
    2     \file proto_class.h
    3     \brief Definition of the proto class template, used quickly start work
     2    \file track_node.h
     3    \brief Definition of the TrackNode are located here
     4   
     5    the TrackNode is the node, that follows the Track (and the TrackManager)
     6    through the level.
     7    Under normal confitions the Plyaer(s) are
    48*/
    59
    610
    7 #ifndef _NULL_PARENT_H
    8 #define _NULL_PARENT_H
     11#ifndef _TRACK_NODE_H
     12#define _TRACK_NODE_H
    913
    10 #include "stdincl.h"
    1114#include "p_node.h"
    1215
     16/* FORWARD DEFINITION */
     17class TrackManager;
    1318
    14 class NullParent : public PNode {
     19class TrackNode : public PNode {
    1520
    1621 public:
    17   static NullParent* getInstance ();
    18   ~NullParent ();
     22  static TrackNode* getInstance ();
     23  ~TrackNode ();
    1924 
    20   static NullParent* singletonRef;
    21 
    2225  virtual void update (float timeStamp);
    2326
    2427 private:
    25   NullParent ();
    26   NullParent (Vector* absCoordinate);
     28  TrackNode ();
     29  TrackNode (Vector* absCoordinate);
     30
     31  static TrackNode* singletonRef;
     32  TrackManager* trackManager;
    2733
    2834};
    2935
    30 #endif /* _NULL_PARENT_H */
     36#endif /* _TRACK_NODE_H */
  • orxonox/branches/trackManager/src/world.cc

    r3430 r3463  
    2828#include "glmenu_imagescreen.h"
    2929#include "skysphere.h"
     30#include "track_node.h"
    3031
    3132using namespace std;
     
    294295            env->setName ("env");
    295296            this->spawn(env, es, qs);
    296             trackManager->setBindSlave(env);
     297           
     298            trackNode = TrackNode::getInstance();
     299
     300            env->setParent(trackNode);
     301
     302            trackManager->setBindSlave(trackNode);
    297303
    298304            break;
  • orxonox/branches/trackManager/src/world.h

    r3430 r3463  
    8080 
    8181  PNode* nullParent;
     82  PNode* trackNode;
    8283 
    8384  void mainLoop ();
Note: See TracChangeset for help on using the changeset viewer.