- Timestamp:
- Jun 7, 2006, 2:40:46 PM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
- 10 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defs/class_id.h
r8068 r8186 182 182 CL_BUILDING = 0x00000310, 183 183 CL_MAPPED_WATER = 0x00000311, 184 CL_BSP_ENTITY = 0x00000312, 184 185 185 186 // Playables … … 259 260 CL_OBB = 0x00720000, 260 261 CL_BOUNDING_SPHERE = 0x00740000, 262 261 263 262 264 … … 285 287 CL_HEIGHT_MAP = 0x0000090a, 286 288 CL_GRID = 0x0000090b, 287 289 CL_BSP_MODEL = 0x0000090c, //!FIXME 290 288 291 CL_MATERIAL = 0x00000810, 289 292 CL_SHADER = 0x00000811, -
trunk/src/lib/collision_detection/cd_engine.cc
r7739 r8186 29 29 #include "quadtree_node.h" 30 30 31 31 #include "bsp_manager.h" 32 32 33 33 using namespace std; … … 95 95 * this checks the collisions with the ground 96 96 */ 97 void CDEngine::checkCollisionGround( )97 void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1) 98 98 { 99 99 if( likely( this->terrain != NULL)) 100 100 { 101 101 Quadtree* q = dynamic_cast<Terrain*>(this->terrain)->ssp->getQuadtree(); 102 103 102 // QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor()); 104 103 } 105 //sTriangleExt* tri = q->getTriangleFromPosition(this->player->getAbsCoor()); 104 105 if( likely( this->bspManager != NULL)) 106 { 107 std::list<WorldEntity*>::iterator iterator; 108 PRINTF(3)("checking for collisions\n"); 109 110 iterator = list1.begin(); 111 while (iterator != list1.end()) 112 { 113 bspManager->checkCollision(*iterator); 114 iterator++; 115 } 116 } 106 117 } 107 118 -
trunk/src/lib/collision_detection/cd_engine.h
r7739 r8186 17 17 class OBBTree; 18 18 class Terrain; 19 class BspManager; 19 20 //class Player; 20 21 … … 50 51 51 52 inline void setTerrain(Terrain* terrain) { this->terrain = terrain; } 53 inline void setBSPModel(BspManager* bspManager) { this->bspManager = bspManager; } 52 54 53 55 void checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2); 56 void checkCollisionGround(std::list<WorldEntity*>& list1); 54 57 55 58 void drawBV(const std::list<WorldEntity*>& drawList, int level) const; … … 69 72 70 73 void checkCollisionObjects(); 71 void checkCollisionGround(); 74 72 75 73 76 void debugSpawnTree(int depth, sVec3D* vertices, int numVertices); … … 81 84 82 85 Terrain* terrain; //!< this it a ref to the terrain, serving as a ground for all WE 86 BspManager* bspManager; 83 87 }; 84 88 -
trunk/src/lib/coord/p_node.h
r7954 r8186 191 191 /** tells the child that the parent's Direction has changed */ 192 192 inline void parentDirChanged () { this->bRelDirChanged = true; } 193 public: 193 194 /** @returns the last calculated coordinate */ 194 195 inline Vector getLastAbsCoor() { return this->lastAbsCoordinate; } 195 196 private: 196 197 static PNode* createNullParent(); 197 198 void reparent(); -
trunk/src/lib/graphics/importer/Makefile.am
r6532 r8186 16 16 height_map.cc \ 17 17 media_container.cc \ 18 movie_player.cc 18 movie_player.cc \ 19 \ 20 bsp_manager.cc \ 21 bsp_file.cc \ 22 bsp_tree_node.cc \ 23 bsp_tree_leaf.cc 24 25 19 26 20 27 libtc_a_SOURCES = tc.cc 21 28 22 29 23 noinst_HEADERS = model.h \ 24 tc.h \ 25 vertex_array_model.h \ 26 grid.h \ 27 static_model.h \ 28 objModel.h \ 29 primitive_model.h \ 30 md2Model.h \ 31 material.h \ 32 texture.h \ 33 texture_sequence.h \ 34 height_map.h \ 35 anorms.h \ 36 anormtab.h \ 37 media_container.h \ 38 movie_player.h 30 noinst_HEADERS = \ 31 model.h \ 32 tc.h \ 33 vertex_array_model.h \ 34 grid.h \ 35 static_model.h \ 36 objModel.h \ 37 primitive_model.h \ 38 md2Model.h \ 39 material.h \ 40 texture.h \ 41 texture_sequence.h \ 42 height_map.h \ 43 anorms.h \ 44 anormtab.h \ 45 media_container.h \ 46 movie_player.h\ 47 \ 48 bsp_manager.h \ 49 bsp_file.h \ 50 bsp_tree_node.h \ 51 bsp_tree_leaf.h -
trunk/src/world_entities/WorldEntities.am
r8068 r8186 15 15 world_entities/test_entity.cc \ 16 16 world_entities/planet.cc \ 17 world_entities/bsp_entity.cc \ 17 18 \ 18 19 world_entities/weapons/test_gun.cc \ … … 67 68 test_entity.h \ 68 69 planet.h \ 70 bsp_entity.h \ 69 71 \ 70 72 weapons/test_gun.h \ -
trunk/src/world_entities/world_entity.cc
r8037 r8186 312 312 313 313 /** 314 * this function is called, when two entities collide 315 * @param entity: the world entity with whom it collides 316 * 317 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 318 */ 319 void WorldEntity::collidesWithGround(const Vector& location) 320 { 321 PRINTF(0)("BSP_GROUND: %s collides \n", this->getClassName() ); 322 } 323 324 void WorldEntity::collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2) 325 { 326 327 // PRINTF(0)("BSP_GROUND: Player collides \n", this->getClassName() ); 328 329 Vector v = this->getAbsDirX(); 330 v.x *= 10; 331 v.y *= 10; 332 v.z *= 10; 333 Vector u = this->getAbsDirY(); 334 335 if(feet.x == (u.x+this->getAbsCoor().x) && feet.y == u.y +this->getAbsCoor().y && feet.z == this->getAbsCoor().z) 336 { 337 338 this->setAbsCoor(ray_2 - v); 339 } 340 else 341 { 342 if(ray_1.x == this->getAbsCoor().x + v.x && ray_1.y == this->getAbsCoor().y + v.y + 0.1 && ray_1.z ==this->getAbsCoor().z + v.z) 343 { 344 this->setAbsCoor(feet -u ); 345 } 346 347 this->setAbsCoor(ray_2 - v); 348 349 } 350 } 351 352 /** 314 353 * this is called immediately after the Entity has been constructed, initialized and then Spawned into the World 315 354 * -
trunk/src/world_entities/world_entity.h
r8037 r8186 63 63 bool buildObbTree(int depth); 64 64 virtual void collidesWith (WorldEntity* entity, const Vector& location); 65 /** @returns a reference to the obb tree of this worldentity */ 65 virtual void collidesWithGround(const Vector& location); 66 virtual void collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2); 67 68 69 /** @returns a reference to the obb tree of this worldentity */ 66 70 inline BVTree* getOBBTree() const { return this->obbTree; }; 67 71 void drawBVTree(int depth, int drawMode) const;
Note: See TracChangeset
for help on using the changeset viewer.