Game Development Community

Bug fix for disappearing mesh roads and rivers

by Dave Wagner · in Torque 3D Professional · 03/14/2012 (12:57 pm) · 3 replies

I was having this issue with our mesh road getting culled when the camera was close to one end and very close to one side of the road. This is a fairly hard to reproduce bug but here is the fix.

In function _generateSlices() in the files messRoad.cpp and river.cpp change the following line:

if( i == 0 )
{
   box.minExtents = slice.p0;
   box.maxExtents = slice.p2;
   box.extend( slice.pb0 );
   box.extend( slice.pb2 );
}

to:

if( i == 0 )
{
   box.minExtents = slice.p0;
   box.maxExtents = slice.p0;
   box.extend( slice.p2);
   box.extend( slice.pb0 );
   box.extend( slice.pb2 );
}

#1
03/14/2012 (1:01 pm)
Moved to T3D Private.
#2
03/14/2012 (1:45 pm)
Quote:I was having this issue with our mesh road getting culled when the camera was close to one end and very close to one side of the road.

i have seen that once.but thought it was for my hardware limitation.
#3
03/14/2012 (1:52 pm)
I was only able to recreate the problem by rotating the starting point of the road, which my artist had done to level the road to try and match the intersection object in the level.