i've made an object tha follows my camera using ibm's camera follower script. currently, the object focuses on my own avatar. the documentation at the bottom of the script suggests that if i want the object to turn towards the camera's focus, i have to use llGetCameraRot, but is vague in it's description of how to do so, and the lsl wiki documentation did not have the info i needed. any suggestions on where i should put llGetCameraRot to make the object focus on the same direction as my camera?
here is the relevant portion of the script
{
// Here the timer uses llMoveToTarget() which simply moves the
// object to wherever the owner's camera is, and about 1 meter
// above (as to not obtruct the owner's view. The owner will
// not be able to see the object under most circumstances, so if
// the owner wants to get rid of the object, they must first say
// "stop" in chat to make the object stop moving. Then they can
// click on the object a lot easier to delete or take.
llMoveToTarget(llGetCameraPos() + <.0, .0, -1.0>, 0.20);
// Since the object looks a bit awkward only moving to position and
// not rotating properly, we call a simple sensor looking for the
// owner's current position.
llSensor("", llGetOwner(), AGENT, 96, PI);
}
sensor(integer num_detected)
{
// After we get the owner's position, we'll have the object just
// look at the owner using it's forward axis. This gives a nice
// effect. If you wanted to track the owners actual camera rotations
// then you would have to use llGetCameraRot() and make the correct
// calculations. We do it this way for simplicity.
llLookAt(llDetectedPos(0), 0.32, 0.32);
}
}