Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4919 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Jul 21, 2005, 12:49:18 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: CDEngine knows player and gets the array offsets

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/cd_engine.cc

    r4918 r4919  
    2020#include "debug.h"
    2121#include "abstract_model.h"
     22#include "list.h"
     23
    2224#include "world_entity.h"
    23 #include "list.h"
     25#include "terrain.h"
     26#include "player.h"
     27
     28#include "spatial_separation.h"
     29#include "quadtree.h"
     30#include "quadtree_node.h"
     31
    2432
    2533using namespace std;
     
    93101void CDEngine::checkCollisionGround()
    94102{
    95 
     103  Quadtree* q = this->terrain->ssp->getQuadtree();
     104  q->getQuadtreeFromPosition(this->player->getAbsCoor());
    96105
    97106}
  • orxonox/trunk/src/lib/collision_detection/cd_engine.h

    r4918 r4919  
    1616class OBBTree;
    1717class Terrain;
     18class Player;
    1819
    1920
     
    4748  inline void setEntityList(tList<WorldEntity>* entityList) { this->entityList = entityList; }
    4849  inline void setTerrain(Terrain* terrain) { this->terrain = terrain; }
     50  inline void setPlayer(Player* player) { this->player = player; } /* only for debug purposes \todo: delete*/
    4951
    5052  void drawBV(int depth, int drawMode) const;
     
    7274
    7375  Terrain*                terrain;                          //!< this it a ref to the terrain, serving as a ground for all WE
     76  Player*                 player;
    7477};
    7578
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h

    r4889 r4919  
    3333    Quadtree* createQuadtree(AbstractModel* model);
    3434
     35    inline Quadtree* getQuadtree() { return this->quadtree; }
    3536
    3637    void drawQuadtree();
  • orxonox/trunk/src/story_entities/world.cc

    r4918 r4919  
    377377          // if we load a 'Player' we use it as localPlayer
    378378          //todo do this more elegant
    379           if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
     379          if( element->Value() != NULL && !strcmp( element->Value(), "Player"))
     380          {
     381            localPlayer = (Player*) created;
     382            CDEngine::getInstance()->setPlayer(localPlayer);
     383          }
    380384          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
    381385          if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
  • orxonox/trunk/src/world_entities/terrain.h

    r4889 r4919  
    3737  virtual void draw();
    3838
     39  public:
     40    SpatialSeparation* ssp;
     41
    3942 private:
    4043  int objectList;
    41   SpatialSeparation* ssp;
     44
    4245};
    4346
Note: See TracChangeset for help on using the changeset viewer.