Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7365 in orxonox.OLD for branches/cd/src/world_entities


Ignore:
Timestamp:
Apr 25, 2006, 3:17:20 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/cd: merged the new collision-detection back.
merged and collissions resolved.

Location:
branches/cd/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/cd/src/world_entities/environment.cc

    r7193 r7365  
    3737  this->init();
    3838  this->loadModel("models/ships/bolido.obj");
     39//   if(this->obbTree == NULL)
     40//     this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
    3941}
    4042
  • branches/cd/src/world_entities/test_entity.cc

    r7198 r7365  
    3838{
    3939  this->init();
     40  this->md2Model = new MD2Model("models/droidika.md2", "models/droideka.pcx");
    4041}
    4142
     43
     44//   this->md2Model = new MD2Model("models/tris.md2", "models/tris.pcx");
     45// this->md2Model = new MD2Model("models/goblin.md2", "maps/goblin.bmp");
     46//   this->obbTree = new OBBTree(4, (sVec3D*)this->md2Model->data->pVertices, this->md2Model->data->numVertices);
    4247
    4348
  • branches/cd/src/world_entities/world_entity.cc

    r7230 r7365  
    207207 * @param depth the depth to calculate
    208208 */
    209 bool WorldEntity::buildObbTree(unsigned int depth)
     209bool WorldEntity::buildObbTree(int depth)
    210210{
    211211  if (this->obbTree)
     
    214214  if (this->models[0] != NULL)
    215215  {
    216     PRINTF(4)("creating obb tree\n");
    217 
    218 
    219     this->obbTree = new OBBTree(depth, (sVec3D*)this->models[0]->getVertexArray(), this->models[0]->getVertexCount());
     216    this->obbTree = new OBBTree(depth, models[0]->getModelInfo(), this);
    220217    return true;
    221218  }
    222219  else
    223220  {
    224     PRINTF(2)("could not create obb-tree, because no model was loaded yet\n");
     221    PRINTF(1)("could not create obb-tree, because no model was loaded yet\n");
    225222    this->obbTree = NULL;
    226223    return false;
     
    468465 * @param drawMode the mode to draw this entity under
    469466 */
    470 void WorldEntity::drawBVTree(unsigned int depth, int drawMode) const
     467void WorldEntity::drawBVTree(int depth, int drawMode) const
    471468{
    472469  glMatrixMode(GL_MODELVIEW);
     
    480477  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    481478
     479
    482480  if (this->obbTree)
    483481    this->obbTree->drawBV(depth, drawMode);
     482
     483
    484484  glPopMatrix();
    485485}
  • branches/cd/src/world_entities/world_entity.h

    r7221 r7365  
    22 * @file world_entity.h
    33 * Definition of the basic WorldEntity
    4 */
     4 */
    55
    66#ifndef _WORLD_ENTITY_H
     
    4242  inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; }
    4343
    44   bool buildObbTree(unsigned int depth);
    45   /** @returns a reference to the obb tree of this worldentity */
    46   BVTree* getOBBTree() const { return this->obbTree; };
    47 
    4844  /** @param visibility if the Entity should be visible (been draw) */
    4945  void setVisibiliy (bool visibility) { this->bVisible = visibility; };
     
    5854
    5955  virtual void tick (float time);
    60 
    6156  virtual void draw () const;
    6257
     58  bool buildObbTree(int depth);
    6359  virtual void collidesWith (WorldEntity* entity, const Vector& location);
    64   void drawBVTree(unsigned int depth, int drawMode) const;
    65 
     60  /** @returns a reference to the obb tree of this worldentity */
     61  inline BVTree* getOBBTree() const { return this->obbTree; };
     62  void drawBVTree(int depth, int drawMode) const;
    6663
    6764  void debugWE() { this->debugEntity(); }
     
    7875
    7976  void toList(OM_LIST list);
     77
    8078
    8179  /** @returns a Reference to the objectListNumber to set. */
     
    102100  void setHealthMax(float healthMax);
    103101  void createHealthWidget();
     102
    104103  //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
    105104private:
Note: See TracChangeset for help on using the changeset viewer.