I have an avatar sitting in a turret way off center from the root object in a vehicle. (OK, actually the avatar is actually wearing the turret) As the vehicle moves the turret swivels independently. I have successfully rotated the avatar and the turret, but the camera angle stays fixed relative to the vehicle, not the avatar or the turret.
I tried using llSetCameraParams to change the avatar’s view to follow the turret. There is no CAMERA_ROTATION, but I have a vector pointing in the direction the turret is facing and I can use that to set CAMERA_POSITION a few meters behind the avatar and this does the correct thing. HOWEVER, every time I call llSetCameraParams the camera view jumps foreword, back, the horizon rises then drops down again. I’ve got a splitting headache from watching it! How can I make this move more smoothly, or at least jump to one camera setting without bouncing up and down?
vector pos=llGetPos()+sitpos*dockrot;
llSetCameraParams([CAMERA_POSITION,pos-6.0*fwd+<0,0,4>]);
sitpos is the original sit position of the avatar, dockrot is the rotation of the whole vehicle, fwd is a unit vector pointing in the direction the avatar is facing.
Oh, and another thing: How come when the avatar unseats, the debug window pops up and says “Script trying to clear camera parameters but PERMISSION_CONTROL_CAMERA permission not set!” even though I was granted permission AND was able to control the camera. What gives with this? Does permission get taken away when the avatar unseats? Is there no good reason to call llClearCameraParams( ); after unseating? I can’t call it before the avatar unseats, unless there is an event that warns you before the unseating? That would be useful!
