|
From: <Wol...@t-...> - 2001-06-18 19:08:25
|
Ok, I just had a look and maybe advanced a little bit.
The problem is that the hitcount is zero and therefore these lines are
taken:
SG_LOG( SG_TERRAIN, SG_INFO, "no terrain intersection" );
*terrain_elev =3D 0.0;
So the question is, why is the hitcount zero?
Look at:
bool FGTileMgr::current_elev_ssg( sgdVec3 abs_view_pos, double
*terrain_elev ) {
sgdVec3 view_pos;
sgdVec3 sc;
sgdSetVec3( sc, scenery.center.x(), scenery.center.y(),
scenery.center.z());
sgdSubVec3( view_pos, abs_view_pos, sc );
sgdVec3 orig, dir;
sgdCopyVec3(orig, view_pos );
sgdCopyVec3(dir, abs_view_pos );
hit_list.Intersect( terrain, orig, dir );
The bug has to be in these lines or before.
abs_view_pos is in the order of magnitude -2millions, -4millions,
3millions.
scenery.center.x(), scenery.center.y(), scenery.center.z() is
*exactly* the same, so that view_pos becomes exactly (0.0, 0.0, 0.0).
I think this is the problem:
I would guess that hit_list.Intersect looks from the "orig" point in
the direction dir. (and not backwards). That would mean, that orig has
to be above the terrain, but obviously it is *in* the terrain.
Bye bye,
Wolfram.
|