   Problems with line-circle collision detection (part 2)
  ...it won't let me post the second chunk : \  .....I'm gonna try it without source tags   
usingmy SetupWorld method that pulls data from "world.txt", parses it andplaces it in a SECTOR object.-------------------------------void SetupWorld(){float x, y, z, u, v;int numtriangles;FILE *filein;char oneline[255];//char word[20];filein = fopen("data/world.txt", "rt");readstr(filein, oneline);sscanf(oneline, "NUMPOLLIES %i\n", &numtriangles);sector1.numTriangles = numtriangles; sector1.triangle = new TRIANGLE[sector1.numTriangles];sector1.SectorWalls = new WALL[(sector1.numTriangles/2) - 2]; sector1.numWalls = 0;//initialize the number of Walls;  This will be incrementally controlled//through code further downfor(int loop = 0; loop < numtriangles; loop++){ //add vertex to triangle vertex arrayfor(int vert = 0; vert < 3; vert++){readstr(filein, oneline);sscanf(oneline, "%f %f %f %f %f", &x, &y, &z, &u, &v);sector1.triangle[loop].vertex[vert].x = x;sector1.triangle[loop].vertex[vert].y = y;sector1.triangle[loop].vertex[vert].z = z;sector1.triangle[loop].vertex[vert].u = u;sector1.triangle[loop].vertex[vert].v = v; }//if triangle is part of a wall, numWalls+= 1//Triangle is a wall:**> If the y value of any of the 3 vertices is different from the other 2VERTEX v1;VERTEX v2;VERTEX v3;v1.x = sector1.triangle[loop].vertex[0].x;v1.y = sector1.triangle[loop].vertex[0].y;v1.z = sector1.triangle[loop].vertex[0].z; v2.x = sector1.triangle[loop].vertex[1].x;v2.y = sector1.triangle[loop].vertex[1].y;v2.z = sector1.triangle[loop].vertex[1].z; v3.x = sector1.triangle[loop].vertex[2].x;v3.y = sector1.triangle[loop].vertex[2].y;v3.z = sector1.triangle[loop].vertex[2].z;TWODPOINT pt1;TWODPOINT pt2;if(v1.y != v2.y || v1.y != v3.y || v2.y != v3.y){//add the vertices to the SectorWalls array//and increment sector1.numWalls//---------------------------------------------//Add wall first to maintain proper indexing//--------------------------------------------- //add the points that are on the same plane//in order to reduce a triangle into a singular line//points on the same plane will have identical y values//***************************************************************//* NOTE:  This method will only work for walls that are parallel//*   to the y axis.  Any implementation that would want to have//*   "skewed" walls, such as to approximate a hill or something//*   similar would have to have its own 'walls algorithm'//*************************************************************** if(v1.y == v2.y){pt1.x = v1.x;pt1.z = v1.z;pt2.x = v2.x;pt2.z = v2.z;}else if(v1.y == v3.y){pt1.x = v1.x;pt1.z = v1.z;pt2.x = v3.x;pt2.z = v3.z; }else if(v2.y == v3.y){pt1.x = v2.x;pt1.z = v2.z;pt2.x = v3.x;pt2.z = v3.z; }//**************************************************//There are going to be duplicate sets of "wallpoints" (One for the top//edge of the wall and one for the bottom edge)  To simplify collision detection//and to reduce memory usage (The collision detection is going to have to be performed//for EACH wall EVERY frame)  Logically, if there is no collision with the top edge,//there won't be a collision with the bottom edge.  Only one of each of these sets//of points needs to be stored, in order to cut the fat from the collision detection//routine//**************************************************//Verify that wall does not already exist in SectorWalls[]bool exists = false;for(int i = 0; i < sector1.numWalls; i++){if( sector1.SectorWalls.wallPoints[0].x == pt1.x &&sector1.SectorWalls.wallPoints[0].z == pt1.z &&sector1.SectorWalls.wallPoints[1].x == pt2.x &&sector1.SectorWalls.wallPoints[1].z == pt2.z){exists = true;}}if(!exists){sector1.SectorWalls[sector1.numWalls].wallPoints[0].x = pt1.x;sector1.SectorWalls[sector1.numWalls].wallPoints[0].z = pt1.z;sector1.SectorWalls[sector1.numWalls].wallPoints[1].x = pt2.x;sector1.SectorWalls[sector1.numWalls].wallPoints[1].z = pt2.z;sector1.numWalls++;}  }}fclose(filein); return;};  ...wow, at least it let it go through that time : o \  ....has anybody else had problems with post.asp locking up on them when trying to post a lot of code?   