Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

An experiment in ballistics

Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
07-27-2005 02:42
I've been investigating the physics engine, in particular thinking about the aiming of objects that will fall through the air under gravity. There seem to be vague references to "wind resistance" around, but no formulae or rules as far as I can see.

So, the set up of my experiment:

A launcher, set up at one end of a sim, at a height of around 170 metres, set to fire a projectile (me, as it happens), at precisely controllable initial horizontal velocities. I then recorded where I landed. I took a few shots at each velocity to check that nothing strange had happened, threw out a few outliers (accidentally changing speed using key presses whilst falling through the air will totally screw up one's results).

First interesting observation: it is generally very accurate. I set up plywood cubes where I landed, and generally hit it on the nose, or very close (out by 0.5 metres or so) every time.

Attached is a graph of the results: distance travelled horizontally whilst falling a distance of approx 146.9 metres, with a horizontal velocity as given on the x-axis.

The red line is what one would expect if the only force acting on a falling avatar were gravity, at -9.8m/s^2. As you can see, it's almost exactly the same, well within my experimental errors.

So, I'm inclined to say that there is no appreciable wind resistance. However, something else happens as the speed increases further: just for the hell of it, I tried setting the speed to 100, then 500, and 1000. This of course put me in the next sim (and who knows what sim boundaries do to your error bounds), but all of the large speeds landed very close to each other (although I don't have quantitative results here).

My guess is that there is some sort of maximum speed happening, which I'm hitting up against. So terminal velocity is really just that - a maximum speed. But below that speed, calculations based only on objects following parabolic paths should be pretty good.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
07-27-2005 09:30
Regarding sim borders, you actually collide with the sim border before you cross into the next so that is probably why they all landed in roughly the same place.

You can get around this fault by using a script that monitors the current region and velocity and if the region changes, do a llApplyImpulse(previousVelocity * llGetMass()). It works surprisingly well.
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
07-27-2005 11:47
Hmm, good to know. I'm working on a system that doesn't require any attachments on the avatar, so that workaround wouldn't work for this situation, but will no doubt be handy for some other project.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
07-28-2005 09:43
How did you set up the system that applied a precise velocity to an object? The only way I know of doing that is to use llApplyImpulse(), which requires compensation for the mass of the pushing object, the mass of the pushed object, and the distance between them. Ugh.
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
07-28-2005 12:49
I'm using llPushObject, so only have to worry about the mass of the object I'm pushing. The distance is still an issue, but I'm (a) pushing the target whilst it's inside the pushing object, and (b) using multiple pushers that tell me the velocity of the object they're pushing before they push. The last pusher invariably is doing no pushing at all in the horizontal direction and measures my horizontal velocity before it pushes me (slightly up, to counter the effect of gravity since the previous pusher), to be what I want it to be to around 5 decimal places.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG