# SL Physics and ballistics

Please take a moment to consider if this thread is worth bumping.

## Recommended Posts

This came up in the course of a discussion with a customer, and I haven't got the faintest idea what the answer is.

If I launch a physical projectile at -- for example -- 45 degrees to the horizontal using llRezAtRoot(), how (if at all) will the parabola it describes differ from the behaviour of a similar projectile in RL?   I haven't got wind resistance to worry about in SL, I guess (or have I?) but is there anything else that's going to be markedly different?

##### Share on other sites

I developed a Dart Game here in SL and for all intensive purposes mass, acceleration due to gravity, and velocity in SL "roughly " work out the same as in RL.

One can pour through to adjust for the tiniest details but it really isn't necessary IMHO... the parabolas will be the same.

:-)

##### Share on other sites

Maybe the height .

Normally the gravity is very lightly different with the height .

In SL we can go from 0 to 4000 in an instant , and we could see some differences between the 2 experiences , one shot at 0 m and one shot at 4000 . It can surprise because we are not used to this comportment in real life

Nevertheless , the delta diffrence should be at the maximum 0.001 m.s-2 . Normally on real earth it s more the latitude and longitude who make changes on gravity

In real , the height gives some different pressures too . So the measures in real are difficult  to interprete and can be different than in SL . The wind resistence is different too.

Neverthess , if they were some differences between sl and rl , it s more probably because of imprecions of computing

##### Share on other sites

the basic math should work out the same, aerodynamics aren't going to show up in SL as they do in RL... no Drag, no Lift, no Weighted facing. pretty much expect the basic algebraic curve.

##### Share on other sites

Thanks, everyone.   That simplifies things for me considerably.

##### Share on other sites

No air resistance, distance from earth's center does not affect gravity, gravitational constant afaik is 9.81 in SL (9.8067﻿ in real life), and of course your velocity limit is 202.8 m/s.

Collisions are also different because they're calculated per-frame instead of continuously, so of course we have a gap between each projectile's frame of [(velocity/45) - ProjectileLength] meters.

##### Share on other sites

Gravity is a hardcoded constant acceleration of 9.8m/s downwards. There is no air resistance / friction in SL (atleast.. not for physics objects, avatars is a whole different story). For llRezObject, there is a cap on the velocity magnitude at around 250m/s. I think this doesn't apply to objects gaining speed by falling from great height (or by llSetForce for that matter), but I am not entirely sure.

If you want to adjust gravity, you could always change the gravitational force on the object with llSetBuoyancy(float buoyancy). This function is equivalent to an additional force which counter-acts gravity: llSetForce(<0,0,9.8 * buoyancy﻿ * llGetMass()>, FALSE). Setting buoyancy﻿﻿ to 0 will not affect it, setting it to 1 will negate gravity completely. Note that this function still counts towards prim energy.

Any projectile in SL should describe a more-or-less perfect parabolic arc. This will be roughly equivalent to the arc a cannonball for example might make in a vacuum. In RL, objects with a low density (say, a soccer ball), will tend to describe a different trajectory, mostly due to air resistance. It won't be much different from a parabolic arc though, maybe a bit shorter. I think the resulting trajectory can be approximated by just having a smaller launch velocity.

If you want to simulate the launch of a projectile which has complex areodynamic properties (wings), you might want to script the projectile itself to constantly update a llSetForce correction or something similar. This can get really difficult to get right though.