Andy Ross writes:
> This gear collision stuff is going in horrific circles, and I've
> clearly done a piss poor job of explaining it.  Here is what I want,
> from the top:
> 
>    I want a gear interface where I specify the following two (2) points
>    in 3D space: One is the point of gear minimum compression, the other
>    is the point of full extension.
> 
>    I want the scenery code to compute an intersection between the gear
>    and the ground that lies between these two points, based on the
>    scene geometry.
> 
>    I want the returned intersection point to disambiguate the following
>    two edge cases: one where the gear minimum compression point is
>    under ground, and one where the maximum compression point is above
>    ground.
> 
>    If there are more than two geometry intersections along that line, I
>    want the one closes to the minimum compression point.
> 
> Forget anything else you might think I want.  I don't want that.  I
> want the above interface.  That is all I want.  I no longer claim
> (publically) that this interface is better.  I no longer claim that
> any other interfaces are wrong.  I just want them, OK?
> 
> Does anyone have a reason why such interface should not be duly
> granted to the poor YASim developer?  Speak now, or forever hold your,
> ... whatever.
> 
> Did I mention that it's really a very simple interface?

The code is pretty much there to do this already.  Norman's hitlist
class allows you to specify a portion of the scene graph to intersect
against as well as an origin and direction vector (in 'scenery_center'
coordinates.)

Your YASim.cxx could create a 'hitlist' instance and query any kind of
point / vector you'd like.  In fact, this is probably the appropriate
thing to do.  FlightGear provides the elevation of the ground below
the CG of the aircraft, but the FDM knows all about the gear geometry
and it's current relative orientation.  Any thing I can think of that
passes the desired locations out on the 'bus' and then receives the
values back the next frame (i.e. a frame late) is ugly.  Also, this
would allow you to run the gear code at any hz you want and query
contact points as much as you like.  You could run 10 gear iterations
for every fdm iteration for instance if you wanted to run the gear at
1200 hz.

hitlist returns a list of all the intersection points along the
specified line, so you'd have to write a bit of code to find the one
you want, but that can't be too hard.

hitlist.cxx:fgCurrentElev() is just a wrapper around this which passes
in current location as the point and 'up' as the vector.

I'm thinking you'd need to write at most a page of code to do the
scenery elevation querying.  Let me know if you have any questions.
Norman would be the guy to ask if you have specific questions about
what's inside the hitlist class.

Regards,

Curt.
-- 
Curtis Olson   IVLab / HumanFIRST Program       FlightGear Project
Twin Cities    [EMAIL PROTECTED]                  [EMAIL PROTECTED]
Minnesota      http://www.menet.umn.edu/~curt   http://www.flightgear.org

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to