CODE
llSetCameraEyeOffset(eyeOffset) ;
llSetCameraAtOffset(targetOffset) ;
llForceMouselook(FALSE) ;
of course. The problem is how to calculate "eyeOffset" and "targetOffset" vectors. This is what I did, but it does not work as expected:
CODE
vector eyePosition = <...fixed value...> ;
vector targetPosition = <...fixed value...> ;
...
eyeOffset = eyePosition - llGetPos() ;
targetOffset = targetPosition - llGetPos() ;
In theory the rotation of sit should not apply. But I do not get what I want. So I changed it to
CODE
eyeOffset = (eyePosition - llGetPos())*llGetLocalRot() ;
targetOffset = (targetPosition - llGetPos())*llGetLocalRot() ;
Better. It semed that rotation should be applied, but the result is that I point to the target, but from the sit position. So if the angle between sit-taget and eye-target is wide, I get the target from a side, not front.
Any idea how to fix this?