Hi people!
In fg/osg if you successfully catch a wire during carrier landing fg
"freezes": no screen updates whatsoever.
I have traced this bug to FGGroundCache::get_wire_ends().
Looks like during the rewrite to use overloaded operators a mistake
was made in the pivotoff calculation.
The original version (rev 1.17):
sgdVec3 pivotoff;
sgdCopyVec3(end[k], wires[i].ends[k]);
sgdSubVec3(pivotoff, end[k], wires[i].rotation_pivot);
Next version (rev 1.18):
SGVec3d pivotoff = end[k] - wires[i].rotation_pivot;
Note that at this point end[k] is still uninitialized.
The correct code imho would be:
SGVec3d pivotoff = wires[i].ends[k] - wires[i].rotation_pivot;
Diff attached, comments welcome.
Not sure what this has to do with OSG though.
Greets,
Csaba
Index: groundcache.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/groundcache.cxx,v
retrieving revision 1.25
diff -u -b -w -r1.25 groundcache.cxx
--- groundcache.cxx 30 Jan 2007 20:13:36 -0000 1.25
+++ groundcache.cxx 1 Apr 2007 19:05:35 -0000
@@ -713,7 +713,7 @@
for (size_t i = 0; i < sz; ++i) {
if (wires[i].wire_id == wire_id) {
for (size_t k = 0; k < 2; ++k) {
- SGVec3d pivotoff = end[k] - wires[i].rotation_pivot;
+ SGVec3d pivotoff = wires[i].ends[k] - wires[i].rotation_pivot;
vel[k] = wires[i].velocity + cross(wires[i].rotation, pivotoff);
end[k] = wires[i].ends[k] + t*vel[k];
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel