Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llTakeControls and the camera

Zarf Vantongerloo
Obscure Resident
Join date: 22 Jun 2005
Posts: 110
08-07-2007 21:15
I seem to have a different problem with llTakeControls than I've read about here. I have an object that a user sits on, and it does all the correct scripting with setting the sit target, requesting permissions, and eventually calling:

llTakeControls(CONTROL_FWD | CONTROL_BACK, TRUE, FALSE).

The idea being that I want to grab those keys and use them for something else. I don't want them have their normal use, which when sitting would be to zoom the camera in and out. Indeed, the "..., TRUE, FALSE)" in the call does exactly that.

BUT -- In my use case, the user has almost always focused the camera on another object (a game board), using alt/option click to carefully position the camera. When they hit the up arrow key, the even though the key will not be used to zoom the camera, ==> it cancels the focused camera, returning it to the default avatar view <== This is the crux of the problem for me. I need it to leave the camera where the user positioned it.

Is there any way to circumvent this?

I suppose I could expressly position the camera for the users, but I'd prefer to not, since this lets the users decide exactly how to look at the board.
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
08-08-2007 00:47
Hmmm...I'm not sure that the up-arrow ever positions the camera in the first place? Doesn't one position the camera through CTRL + ALT + Mouse-move?

I believe you are just running into SL quirks here and you probably ought to do a force-camera if it's that important to you. As someone who is CONSTANTLY moving his camera as almost second nature...I find accidental camera movement from standing/sitting about as annoying as blinking. Do people really have issues with camera moving?
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
08-08-2007 02:47
Can't think of an alternative but would like to say that I doubt this is a bug, remember that the same control system is used for vehicles, if you were alt-zooming around while sitting in your car and then hit the gas (up) you'd want to return to your vehicle view (in most cases, obviously there are exceptions, i.e. filming yourself driving a car).
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-08-2007 03:12
It might work to llSetCameraParams corresponding to llGetCameraRot and llGetCameraPos (with the right permissions, etc.) to retain the view the sitter had as the default--what they get when they press Escape a superstitious number of times. They'd still be able to use the alt- and alt-control-drag controls to zoom and pan, as Kenn describes, but that default view should be controllable by the llSetCameraParams call--I think.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
08-08-2007 09:04
It's coded into SL that pressing ANY movement control will cancel a user camera position chosen via Alt+mouse.

The way around this is to request "track camera" position as well, and then regularly track the user's camera and use llSetCameraParams to position the camera to the same place it already is. It won't have any visible effect while the camera is being adjusted (the user-adjusted camera overrides a scripted camera anyway) but when the user camera is shut down, the scripted camera isn't, so the camera will appear to stay in place.