Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Steering a stationary vehicle by mouselook

Anna Bobbysocks
Registered User
Join date: 29 Jun 2005
Posts: 373
12-18-2005 07:07
Does anyone know what the flags would be to have a vehicle which doesn't move but spins based on mouselook? It's kind of like a turret that you control via mouselook.

This is what I have so far:


llRemoveVehicleFlags(-1);
llSetVehicleType(VEHICLE_TYPE_SLED);
llSetVehicleFloatParam(VEHICLE_HOVER_HEIGHT, HOVER_HEIGHT);
llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, 0.5);
llSetVehicleFloatParam(VEHICLE_HOVER_TIMESCALE, 0.1);
llSetVehicleFlags(VEHICLE_FLAG_NO_FLY_UP | VEHICLE_FLAG_MOUSELOOK_BANK);
llSetVehicleVectorParam( VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, PI*4> );

In a timer I apply a little bit of impulse to keep the turrest updated in terms of position.

Any thoughts, please let me know.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
12-26-2005 15:50
Hi. A friend of mine had this sort of setup some time ago. While I'm not a big fan of the vehicle system, you may want to fiddle with some of the attractor flags that keep the vehicle upright, as listed on the linked page.


Alternately, mouselook can also be expressed by taking llGetRot from an attachment or llDetectedRot when running a sensor through an avatar. While not the most elegant solution, you could then use llRotLookAt after you have the operator's rotation value to rotate the turret without having it move about.

llMoveToTarget and physics code might also help it move smoothly.
_____________________
---