Tuesday, 28 September 2010

A Hovercraft project in OpenSim

Its usual at around the summer break for me to set myself a project of some kind. This year there have in fact been a couple of little projects but for this post its about my decision to get a vehicle to work reliably enough in OpenSim that is stable enough on the one hand and use-ably fun on the other. It was during the students projects of the summer term that I first really became aware of the issues here, as one group tried it seems very much in vain to get vehicles running around without aircraft zooming of to some distant a horizon, cars flipping over onto a front bumper or boats turning turtle and plunging to the depths of the virtual ocean . Initially my approach had been to supply them with some basic SL scripts and get them to try them out, make a few changes and see which worked the best, but clearly it was not going to be as simple as that.
For my own project I decided upon a hovercraft, a bit of an easy one maybe, because it would only be running across a flat sea. I decided to use one of the scripts that my students had been playing around with and found the first thing that I needed to do was make sure that the vehicle was only going to run on water

llSetVehicleFlags(VEHICLE_FLAG_HOVER_WATER_ONLY);

In fact this very small adjustment did seem to make a difference.

I did seem to have some difficulty with the buoyancy setting, but eventually got it to settle down between session OK with a suitable value.



To have a hovercraft of course, I needed a rotor and that caused some difficulty in that the craft would be running around all over the place, so I basically copt-out of this one by using rotating textures (sneaky) but to reasonable effect.

I then installed a particle script for the spray and a suitable wav file that I found on the net, I think it was the sound of a piston engine biplane. And the results of all this you can see in the two accompanying screen shots. Not much by way of banking at the moment, so motion is a little wooden, but I am working on that.

The whole project went really well really and I am putting together a video that I will post to this blog later. If you have had any experience with vehicles in OpenSim then please feel free to comment.

regards Vega