Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Example of VEHICLE_FLAG_MOUSELOOK_STEER that works?

Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
03-28-2009 04:02
Title about says it.

What I'm getting at the moment makes no sense, but as best I can describe it: with Mouselook camera steering, when the cam is to the left of the vehicle's center plane, the arrow keys affect the angular motor more or less as normal, and when the cam is to the right, their effect is inverted. The closer to the center, the less effect the keys have. Cam direction seems to have no effect on the angular motor at all, except this modification of key control. VEHICLE_FLAG_CAMERA_DECOUPLED seems to let the cam move more freely from the vehicle's center axis, but the same arrow key behavior obtains.

I've never played with this flag before, so... am I supposed to be tracking the camera separately, generating my own input to the angular motor for cam motion independent of keyboard input? (but if so, what's the point of this flag?) :confused:

[EDIT: Okay, I think I understand how this works now, thanks to some ancient text in http://lslwiki.net/lslwiki/wakka.php?wakka=llSetVehicleFlags. Seems that while in mouselook cam steering, one just has to feed the maximum magnitude of steering into the angular motor, and the mouse position scales it according to cam direction. That would explain what I was seeing because the only source of angular motor input in my script had been control keys. I can't get in-world to test this for a while, but unless the above is wrong, it's "probably solved."]
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
03-28-2009 08:19
Correct on the EDIT.

Good ones to start with:

global:
vector msteer = <0, 0, 2 >;

FLAG:
llSetVehicleFlags(VEHICLE_FLAG_MOUSELOOK_STEER | VEHICLE_FLAG_CAMERA_DECOUPLED);

& in a timer:
CODE

integer mlook = llGetAgentInfo(llGetOwner());
if (mlook & AGENT_MOUSELOOK) {
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, msteer);
}
else {
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, <0, 0, 0 >);
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum