Jon
12-05-2007 23:56:05
I started looking into this since it is an area which depends on rectangular tiles linked together. Here are a couple of observtions:
1) It seems like these intersections could be computed by the page, and probably more efficiently. (Note the 36 stack frames due to recursive calls)
2) In PagingLandScapeTile::intersectSegmentFromBelow, if the ray starts out with a negative Y component and is pointing down, it will never intersect, yet the ray in practice is propagated from tile to tile, page to page. At a bare minimum I want to add a check here and in intersectSegmentFromAbove to check for that.
Now one might ask, how is it possible to start with a negative Y? I'm not sure of the exact details, but I set a breakpoint and clicked on the terrain, and started out with:
* ray start {x=-3282.6833 y=-153.61951 z=-8905.7705 }
* ray direction {x=0.50141233 y=-0.15366226 z=0.85145384 }
3) There seems to be a problem with tile linkage across page boundaries:
4) As suspected, there is a similar problem with PagingLandScapeTile::intersectSegmentFromAbove where the ray starts out below the local max (which seems reasonable), but pointed down and therefore unable to reach the local max. Frankly an intersection check against the max perplexes me.
4.5) Maybe this is why I've been unable to place a sphere on the terrain using the PLSM demo application under Eihort.
1) It seems like these intersections could be computed by the page, and probably more efficiently. (Note the 36 stack frames due to recursive calls)
2) In PagingLandScapeTile::intersectSegmentFromBelow, if the ray starts out with a negative Y component and is pointing down, it will never intersect, yet the ray in practice is propagated from tile to tile, page to page. At a bare minimum I want to add a check here and in intersectSegmentFromAbove to check for that.
Now one might ask, how is it possible to start with a negative Y? I'm not sure of the exact details, but I set a breakpoint and clicked on the terrain, and started out with:
* ray start {x=-3282.6833 y=-153.61951 z=-8905.7705 }
* ray direction {x=0.50141233 y=-0.15366226 z=0.85145384 }
3) There seems to be a problem with tile linkage across page boundaries:
# 3,1,5,0 (south to)
# 3,1,5,1 (east to)
# 3,1,6,1 (south to)
# 3,1,6,2 (south to)
# 3,1,6,3 (east to)
# 3,1,7,3 (south to)
# 3,1,7,4 (south to)
# 3,1,7,5 (east to)
# 4,1,0,5 (south to)
# 4,1,0,6 (east to)
# 4,1,1,6 (south to)
# 4,1,1,7 (south to)
# 4,2,1,0 (east to)
# 4,2,2,0 (south to)
# 4,2,2,1 (south to)
# 4,2,2,2 (east to)
# 4,2,3,2 (south to)
# 4,2,3,3 (east to)
# 4,2,4,3 (south to)
# 4,2,4,4 (south to)
# 4,2,4,5 (east to)
# 4,2,5,5 (south to)
# 4,2,5,6 (south to)
# 4,2,5,7 (east to)
# 4,2,6,7 (south to)
# 4,3,6,0 (south to)
# 4,3,6,1 (east to)
# 4,3,7,1 (south to)
# 5,3,7,2 (east to) !!!
# 5,3,0,2 (south to)
# 5,3,0,3 (south to)
# 5,3,0,4 (east to)
# 5,3,1,4 (south to)
# 5,3,1,5 (east to)
# 5,3,1,5 (south to)
# 5,3,2,6 (south to)
# 5,3,2,7 (east to)
# 5,3,3,7 (runs south off loaded pages, negative result)
# final ray position {x=12640.270 y=-5034.0562 z=18140.979 }
4) As suspected, there is a similar problem with PagingLandScapeTile::intersectSegmentFromAbove where the ray starts out below the local max (which seems reasonable), but pointed down and therefore unable to reach the local max. Frankly an intersection check against the max perplexes me.
4.5) Maybe this is why I've been unable to place a sphere on the terrain using the PLSM demo application under Eihort.