the cause for the disappearing shadows is, that SimGear doesn't tell plib
to call the pre-traversal-callback function on culled objects. These calls,
however, are necessary to execute the transform animation that does, for
example, translate a shadow back into the frustum! Curretnly, the callback
is only executed, and the shadow only magically pops up again, when the object
enters the frustum because the view has changed significantly.
The plib documentation does only talk about TRUE and FALSE for possible
return values from the pre-traversal-callback. But src/ssgEntity.cxx reads
like this:
int ssgEntity::preTravTests ( int *test_needed, int which )
...
int result = (*preTravCB)(this,which) ;
if ( result == 0 ) return FALSE ;
if ( result == 2 ) *test_needed = 0 ;
...
So the return value needs to be 2 to bypass the cull test for pretraversal,
and get the pretraversal in any case. I only changed the return values in
four animations: scale, rotate, translate, and range, because these are
the most likely to move an object out of the frustum. It's not necessary
for blend/alpha/texture manipulation etc. Of course, this is a bit more work
for plib, but the performance will probably not be affected, because:
* these four animations are mainly used for the aircraft model (the spin
and billboard (trees!) animations are not affected)
* the number of extra nodes to process is quite low
* a part of the time spent for the extra nodes to be processed, was before
used for workarounds that are now not necessary any more