Changeset 7365 in orxonox.OLD for branches/cd/src/world_entities
- Timestamp:
- Apr 25, 2006, 3:17:20 PM (19 years ago)
- Location:
- branches/cd/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cd/src/world_entities/environment.cc
r7193 r7365 37 37 this->init(); 38 38 this->loadModel("models/ships/bolido.obj"); 39 // if(this->obbTree == NULL) 40 // this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); 39 41 } 40 42 -
branches/cd/src/world_entities/test_entity.cc
r7198 r7365 38 38 { 39 39 this->init(); 40 this->md2Model = new MD2Model("models/droidika.md2", "models/droideka.pcx"); 40 41 } 41 42 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); 42 47 43 48 -
branches/cd/src/world_entities/world_entity.cc
r7230 r7365 207 207 * @param depth the depth to calculate 208 208 */ 209 bool WorldEntity::buildObbTree( unsignedint depth)209 bool WorldEntity::buildObbTree(int depth) 210 210 { 211 211 if (this->obbTree) … … 214 214 if (this->models[0] != NULL) 215 215 { 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); 220 217 return true; 221 218 } 222 219 else 223 220 { 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"); 225 222 this->obbTree = NULL; 226 223 return false; … … 468 465 * @param drawMode the mode to draw this entity under 469 466 */ 470 void WorldEntity::drawBVTree( unsignedint depth, int drawMode) const467 void WorldEntity::drawBVTree(int depth, int drawMode) const 471 468 { 472 469 glMatrixMode(GL_MODELVIEW); … … 480 477 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 481 478 479 482 480 if (this->obbTree) 483 481 this->obbTree->drawBV(depth, drawMode); 482 483 484 484 glPopMatrix(); 485 485 } -
branches/cd/src/world_entities/world_entity.h
r7221 r7365 2 2 * @file world_entity.h 3 3 * Definition of the basic WorldEntity 4 */4 */ 5 5 6 6 #ifndef _WORLD_ENTITY_H … … 42 42 inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; } 43 43 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 48 44 /** @param visibility if the Entity should be visible (been draw) */ 49 45 void setVisibiliy (bool visibility) { this->bVisible = visibility; }; … … 58 54 59 55 virtual void tick (float time); 60 61 56 virtual void draw () const; 62 57 58 bool buildObbTree(int depth); 63 59 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; 66 63 67 64 void debugWE() { this->debugEntity(); } … … 78 75 79 76 void toList(OM_LIST list); 77 80 78 81 79 /** @returns a Reference to the objectListNumber to set. */ … … 102 100 void setHealthMax(float healthMax); 103 101 void createHealthWidget(); 102 104 103 // CharacterAttributes* charAttr; //!< the character attributes of a world_entity 105 104 private:
Note: See TracChangeset
for help on using the changeset viewer.