Changeset 4695 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 24, 2005, 11:15:12 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/bv_tree.h
r4635 r4695 14 14 // FORWARD DEFINITION 15 15 class BoundingVolume; 16 class BVTreeNode; 16 17 17 18 typedef enum DrawMode … … 38 39 virtual void flushTree() = NULL; 39 40 41 virtual void collideWith(BVTree* tree) = NULL; 42 40 43 virtual void drawBV(int depth, int drawMode) const = NULL; 44 41 45 42 46 protected: -
orxonox/trunk/src/lib/collision_detection/bv_tree_node.h
r4635 r4695 29 29 inline const int getIndex() { return this->treeIndex; } 30 30 31 virtual void collideWith( const BVTree &tree) = NULL;31 virtual void collideWith(BVTreeNode* treeNode) = NULL; 32 32 33 33 virtual void drawBV(int depth, int drawMode) const = NULL; -
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4694 r4695 54 54 55 55 56 /** 57 \brief this is the collision checking function 58 59 there are some speed improvements that can be done here. a rewrite of the list a would be appropriate to 60 be able to enhance iteration speed. 61 */ 56 62 void CDEngine::checkCollisions() 57 63 { -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4682 r4695 103 103 104 104 105 void OBBTree::collideWith(const OBBTree &tree) 106 {} 105 void OBBTree::collideWith(BVTree* tree) 106 { 107 //this->rootNode->collideWith(tree->); 108 } 107 109 108 110 -
orxonox/trunk/src/lib/collision_detection/obb_tree.h
r4682 r4695 27 27 virtual void flushTree(); 28 28 29 v oid collideWith(const OBBTree &tree);29 virtual void collideWith(BVTree* tree); 30 30 31 31 virtual void drawBV(int depth, int drawMode) const; -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4688 r4695 530 530 tList<sVec3D> partition2; //!< the vertex partition 2 531 531 532 printf("vertex index: %i, of %i\n", vertexIndex, box->numOfVertices);532 PRINTF(3)("vertex index: %i, of %i\n", vertexIndex, box->numOfVertices); 533 533 this->separationPlane = new Plane(box->axis[axisIndex], box->vertices[vertexIndex]); //!< separation plane 534 534 this->sepPlaneCenter = &box->vertices[vertexIndex]; … … 604 604 605 605 606 void OBBTreeNode::collideWith(const BVTree &tree) 607 {} 608 609 606 void OBBTreeNode::collideWith(BVTreeNode* treeNode) 607 { 608 /* if the obb overlap, make subtests: check which node is realy overlaping */ 609 if( this->overlapTest(this->bvElement, ((OBBTreeNode*)treeNode)->bvElement)) 610 { 611 /* check if left node overlaps */ 612 if( unlikely( this->nodeLeft != NULL)) 613 if( this->overlapTest(this->nodeLeft->bvElement, ((OBBTreeNode*)treeNode)->bvElement)) 614 this->nodeLeft->collideWith(((OBBTreeNode*)treeNode)->nodeLeft); 615 /* check if right node overlaps */ 616 if( unlikely( this->nodeRight != NULL)) 617 if(this->overlapTest(this->nodeRight->bvElement, ((OBBTreeNode*)treeNode)->bvElement)) 618 this->nodeLeft->collideWith(((OBBTreeNode*)treeNode)->nodeRight); 619 } 620 } 621 622 623 624 bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB) 625 { 626 627 } 610 628 611 629 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
r4685 r4695 33 33 inline void setTreeRef(OBBTree* tree) { this->obbTree = tree;} 34 34 35 virtual void collideWith( const BVTree &tree);35 virtual void collideWith(BVTreeNode* treeNode); 36 36 37 37 virtual void drawBV(int depth, int drawMode) const; … … 45 45 void forkBox(OBB* box); 46 46 47 bool overlapTest(OBB* boxA, OBB* boxB); 47 48 48 49 protected: -
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4694 r4695 69 69 b->setRelCoor(0.0, 0.0, -10.0); 70 70 71 TestEntity* c = new TestEntity(); c->setName("Colwn2");72 c->setRelCoor(0.0, 0.0, -20.0);71 // TestEntity* c = new TestEntity(); c->setName("Colwn2"); 72 // c->setRelCoor(0.0, 0.0, -20.0); 73 73 74 74 entityList->add(a); 75 75 entityList->add(b); 76 entityList->add(c);76 // entityList->add(c); 77 77 78 78 CDEngine::getInstance()->setEntityList(entityList); … … 204 204 { 205 205 206 CDEngine::getInstance()->checkCollisions();206 //CDEngine::getInstance()->checkCollisions(); 207 207 208 208 currentFrame = SDL_GetTicks(); … … 220 220 /* the frame-rate is limited to 100 frames per second, all other things are for nothing. 221 221 */ 222 SDL_Delay( (unsigned int)(10-dt));222 SDL_Delay(1); 223 223 dt = 10; 224 224 } … … 240 240 void Framework::moduleDraw() const 241 241 { 242 //CDEngine::getInstance()->drawBV(depth, drawMode);242 CDEngine::getInstance()->drawBV(depth, drawMode); 243 243 LightManager::getInstance()->draw(); 244 244 -
orxonox/trunk/src/world_entities/world_entity.cc
r4689 r4695 124 124 /** 125 125 \brief this function is called, when two entities collide 126 \param other: the world entity with whom it collides 127 \param ownhitflags: flags to the CollisionCluster subsections that registered an impact 128 \param otherhitflags: flags to the CollisionCluster subsections of the other entity that registered an impact 126 \param entity: the world entity with whom it collides 129 127 130 128 Implement behaviour like damage application or other miscellaneous collision stuff in this function 131 129 */ 132 void WorldEntity::collideWith(WorldEntity* entity) {} 130 void WorldEntity::collideWith(WorldEntity* entity) 131 { 132 this->obbTree->collideWith(entity->obbTree); 133 134 } 133 135 134 136
Note: See TracChangeset
for help on using the changeset viewer.