[ODE] slider trouble
Nate W
coding at natew.com
Thu Oct 31 14:59:02 2002
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--1363170581-980581577-1036073289=:32303
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Thu, 31 Oct 2002, Russ Smith wrote:
> > so if you want I'll put together a bare-minimum test case for you.
>
> please.
I've attached test_sliderstops.cpp, a small demo in the drawstuff
tradition with two boxes and a slider between them. To get them flying,
they are dropped onto bouncy ground. The first bounce looks about right,
but before it hits the ground again the two-box system appears to gain a
lot of angular momentum. They mellow out after they hit the ground again.
The boxes start with altitudes of 7 and 8 units; if you raise those to 19
and 20 you get more 'air time' and more trouble. You have to be quick
with the mouse to follow them around the sky though.
--
Nate Waddoups
Redmond WA USA
http://www.natew.com
--1363170581-980581577-1036073289=:32303
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="test_sliderstops.cpp"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.21.0210310608090.32303@spiral>
Content-Description:
Content-Disposition: attachment; filename="test_sliderstops.cpp"
LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioNDQogKiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgKg0NCiAqIE9wZW4gRHluYW1pY3MgRW5naW5lLCBD
b3B5cmlnaHQgKEMpIDIwMDEsMjAwMiBSdXNzZWxsIEwuIFNtaXRoLiAgICAg
ICAqDQ0KICogQWxsIHJpZ2h0cyByZXNlcnZlZC4gIEVtYWlsOiBydXNzQHEx
Mi5vcmcgICBXZWI6IHd3dy5xMTIub3JnICAgICAgICAgICoNDQogKiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgKg0NCiA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