Curtis L. Olson writes:
>
>Norman Vine writes:
>> David Megginson writes:
>>
>> >We need two relatively complicated pieces of self-contained code
>> >written to move much further with FlightGear:
>> >
>> >1. a function that, given an ssgBranch and the current viewer
>> > transformation, can return the descendant of the branch (if any)
>> > under a specific screen coordinate; and
>>
>> ssgCullAndPick() perchance ?
>
>I've never messed with this, but it sounds promising.
This is exactly what it is intended for,
but you might have to use the ssgGetEntityTransform()
code from hitlist.cxx to get the proper matrix.
>> >2. a new intersect routine that starts by looking
>downwards, so that a
>> > plane (for example) can taxi into a hangar or under a bridge
>> > without suddenly jumping on top.
>>
>> hmm... I thought that the current routine did this as is
>
>Given that the intersection routine returns a list of all "terrain"
>intersections and then you just need to reject all the ones that are
>above your current aircraft elevation.
After looking at this some more it seems as if my last optimization
takes advantage of too much for this to work
However I think the following patch will make it 'all better' again
and still take advantage of a 'good' shortcut :-)
The fgCurrentElev() routines will still need a little tweaking
to discard those distances that are less then zero except
in the case when all entries are less then zero
FYI
I have reworked hitlist.xxx to where it is free of all FlightGear
dependencies and could be moved into SimGear or PLib
for that matter by not using the SimGear Logging class
Note this allows moving fgCurrentElev() out of hitlist.cxx :-)
I'll get the new files to somebody this evening
Norman
int FGHitList::IntersectLeaf( ssgLeaf *leaf, const sgdMat4 m,
sgdVec3 orig, sgdVec3 dir,
const GLenum primType )
{
........
if( sgdPointInTriangle( point, tri ) ) {
// transform point into passed coordinate frame
sgdXformPnt3( point, point, m );
add(leaf,n,point,plane);
- test_dist = tmp_dist;
+ if( tmp_dist >= 0 )
+ test_dist = tmp_dist;
num_hits++;
}
}
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel