Jump to content
  • 0

In a script, I want to retrieve my LookAt vector, but I can't find an LL function for that. Help?


paratracker
 Share

You are about to reply to a thread that has been inactive for 3177 days.

Please take a moment to consider if this thread is worth bumping.

Question

1 answer to this question

Recommended Posts

  • 0

You can't, because there is no such LSL function.  You can answer some of the questions that you might be trying to address in other ways, though.  For example, if you're in mouselook you can use llCastRay to figure out what is along the vector between you and wherever your camera is pointing.  This code snippet

            vector start = llGetCameraPos();            list results = llCastRay(start, start+<50.0,0.0,0.0>*llGetCameraRot(),[RC_REJECT_TYPES,RC_REJECT_PHYSICAL|RC_REJECT_AGENTS|RC_REJECT_LAND,RC_DETECT_PHANTOM,FALSE,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,5]);

will direct a cast ray 50.0 m from you along your line of sight and will return the UUID and position of the first object that lies along that path.  That's considerably more reliable than the notoriously sloppy LookAt function in your viewer.

 

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3177 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...