From: Dave R. <tr...@us...> - 2004-08-12 17:53:07
|
Update of /cvsroot/bzflag/bzflag/src/bzfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30737/src/bzfs Modified Files: WorldInfo.cxx WorldInfo.h bzfs.cxx Log Message: - infinite walls do not belong in an octree - speed up the get3DNormal() for tetras Index: WorldInfo.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzfs/WorldInfo.cxx,v retrieving revision 1.54 retrieving revision 1.55 diff -w -u -r1.54 -r1.55 --- WorldInfo.cxx 12 Aug 2004 10:13:17 -0000 1.54 +++ WorldInfo.cxx 12 Aug 2004 17:52:41 -0000 1.55 @@ -155,7 +155,7 @@ void WorldInfo::loadCollisionManager() { - collisionManager.load(walls, boxes, bases, pyramids, tetras, teleporters); + collisionManager.load(boxes, bases, pyramids, tetras, teleporters); return; } @@ -163,7 +163,7 @@ { if (collisionManager.needReload()) { // reload the collision grid - collisionManager.load(walls, boxes, bases, pyramids, tetras, teleporters); + collisionManager.load(boxes, bases, pyramids, tetras, teleporters); } return; } @@ -219,16 +219,14 @@ const float* pos, float radius, float height) { - checkCollisionManager(); // FIXME - this is lame - if (height < Epsilon) { height = Epsilon; } *location = NULL; + // check everything but walls const ObsList* olist = collisionManager.cylinderTest (pos, radius, height); - for (int i = 0; i < olist->count; i++) { const Obstacle* obs = olist->list[i]; if (obs->inCylinder(pos, radius, height)) { @@ -252,17 +250,15 @@ const float* pos, float angle, float width, float breadth, float height) { - checkCollisionManager(); // FIXME - this is lame - if (height < Epsilon) { height = Epsilon; } *location = NULL; + // check everything but walls const ObsList* olist = collisionManager.boxTest (pos, angle, width, breadth, height); - for (int i = 0; i < olist->count; i++) { const Obstacle* obs = olist->list[i]; if (obs->inBox(pos, angle, width, breadth, height)) { @@ -299,9 +295,6 @@ else if (obstacle->getType() == Teleporter::getClassName()) { return IN_TELEPORTER; } - else if (obstacle->getType() == WallObstacle::getClassName()) { - return IN_WALL; - } else { // FIXME - choke here? printf ("*** Unknown obstacle type in WorldInfo::boxInBuilding()\n"); Index: WorldInfo.h =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzfs/WorldInfo.h,v retrieving revision 1.34 retrieving revision 1.35 diff -w -u -r1.34 -r1.35 --- WorldInfo.h 12 Aug 2004 10:13:17 -0000 1.34 +++ WorldInfo.h 12 Aug 2004 17:52:41 -0000 1.35 @@ -42,8 +42,7 @@ IN_BOX_DRIVETHROUGH, IN_PYRAMID, IN_TETRA, - IN_TELEPORTER, - IN_WALL + IN_TELEPORTER } InBuildingType; Index: bzfs.cxx =================================================================== RCS file: /cvsroot/bzflag/bzflag/src/bzfs/bzfs.cxx,v retrieving revision 1.817 retrieving revision 1.818 diff -w -u -r1.817 -r1.818 --- bzfs.cxx 11 Aug 2004 20:50:31 -0000 1.817 +++ bzfs.cxx 12 Aug 2004 17:52:41 -0000 1.818 @@ -3994,6 +3994,10 @@ **/ int i; while (!done) { + + // see if the octree needs to be reloaded + world->checkCollisionManager(); + maxFileDescriptor = 0; // prepare select set fd_set read_set, write_set; |