[Opensim-dev] Questions about Vehicle scripting calls
Mike Higgins
mike at kayaker.net
Thu Jun 7 07:09:54 UTC 2012
On 6/6/12 12:48 AM, Bengt Falke wrote:
> I am also interested in physics for vehicles mainly for creating
> working yacht and for making my free moving scripted animals to work
> in a smooth way.
> If there is a way I can contribute I will try to do so.
>
Also at the recent OpenSim developers meeting, Andrew Hellershanks
said (about llSetTImerEvent minimum time limits) "Not sure why you would
want to use something other [less] than 1.0". I think the developers
need to know that there are 1000's of scripters in SL DESPERATELY trying
to find ANY WAY to make simple things like a fish move smoothly through
the water at a constant velocity. In SL you can usually get timer()
events as often as once every 0.2 seconds, which is not quite often
enough for smooth looking motion. timer events more often would be one
way to get smoother looking motion. I've seen people write scripts that
had abominations like: while (1) { moveit(); llSleep(0.05); } The
OpenSim developers need to throw these guys a bone so they will NOT DO
THAT HERE!
Of course, LL only recently threw them the llSetKeyframedMotion()
bone. Before that, people tried to use physics and llMoveToTarget()
which was NEVER DESIGNED TO GENERATE LINEAR MOTION (it is always
damped). Although you can play games with it and find reasonably linear
portions of the curve. But that requires accurate llSetTimerEvent
durations to stop the llMoveToTarget part way through a damped move. And
in OpenSim, llMoveToTarget is damped 9 times faster than SL (mantis
issue 5968) which requires pushing it nine times harder to try to
capture a linear section and even more accurate llSetTimerEvent times to
prevent the object from running away from you...
The only other way in SL (before llSetKeframedMotion) to get
something to move smoothly at a constant velocity is to make it a
vehicle. Which is sort of like using a 4 ton hydrolic press to insert
thumbtacks in a cork board. And even in SL, the vehicle functions are
really squirrely.
So the major reason I am testing the OpenSim vehicle routines is to
see if I can find a reliable subset of them, or a set of workarounds,
that will allow me to move a fish smoothly through the water at a
constant velocity.
So far I have found a few problems and some workarounds:
1) Vehicles crash and burn at the sim boundary, the workaround is to add
code to detect the sim boundary before the vehicle gets there and
prevent it from even getting close. But if llSetTimerEvent is not
accurate, if your timer() event is not called regularly to do this
check, the vehicle runs into the sim boundary and goes crazy.
2) The angular motor rotates around the wrong axes, but you can
workaround that by multiplying your vectors by llGetRot (mantis issue
6039). I'm guessing that nobody noticed this before because cars and
boats and helicopters are usually horizontal and their local Z axis is
aligned with the region Z axis.
3) The linear motor vector is clamped or projected onto the region XY
plane. (mantis issue 6040) A car or a boat or a helicopter might never
notice this, but with no Z values allowed in linear motors, how can
airplanes glide up or down? Someone please tell me how to get this to work!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20120607/e81ac87d/attachment-0001.html>
More information about the Opensim-dev
mailing list