RUCCUS
When you use float dbIntersectObject ( int iObject, float fX, float fY, float fZ, float fToX, float fToY, float fToZ ) does it pass through all the loaded object and test each one for an intersection?
If it does that and I am using it in a for loop already of the surrounding 6x6 square then each pass casues it to loop through all objects each time.
The following function is what I was using to test intersection for a LOS culling system. Please take a look and make any suggestions or point out flaws you see.
void CRandomFloor::LOSCulling(float x,float z)
{
int i = 0;
int j = 0;
if(FindFloorTile(x,z,&i,&j))
{
for(int xx = i - 6;xx < i + 6;xx++)
{
for(int yy = j - 6;yy < j + 6;yy++)
{
if(xx > -1 && xx < MAX_WIDTH && yy > -1 && yy < MAX_DEPTH)
{
float distance = 0.0f;
tag_WallData *w = Floor->Layout[xx][yy].Walls;
while(w)
{
if(dbIntersectObject(PLAYER_ID,x,0.0f,z,xx * 10.0f,0.0f,yy * 10.0f) == 0.0f)
dbShowObject(w->WallID);
w = w->Next;
}
dbShowObject(Floor->Layout[xx][yy].TileID);
}
}
}
}
}
I would realy like to understand why it would check hidden object also, and if that is the case a nice bool switch to ignore hidden in test would realy be nice.
Also thanks all for you input, looking into any other aps regulating FPS
Modis