Change font size
It is currently Sat May 18, 2013 2:40 pm

Forum rules


Image



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: llLookAt alternative
PostPosted: Thu Jul 01, 2010 2:44 pm 
User avatar

Joined: Thu Aug 06, 2009 9:11 pm
Posts: 41
Location: NYC
I know llLookAt isn't yet implemented in opensim but what could be an alternative? I have a script from SL with the command
Code:
llLookAt(a, 1.0, 0.05);

in which a is a vector pulled from a notecard, so a prim finds the center of anotehr prim and rotates its z-axis to it.
Thanks for any suggestions.
-Erik


Top
 Profile  
 
 Post subject: Re: llLookAt alternative
PostPosted: Sat Jul 03, 2010 5:50 pm 
Furious Typer

Joined: Fri Dec 12, 2008 9:47 am
Posts: 245
try this

Code:
rotation rot6X     = llGetRot() * llRotBetween(<0.0 ,0.0 ,1.0 > * llGetRot(), a - llGetPos());
llSetRot( rot6X);

_________________
ImageImageImage


Top
 Profile  
 
 Post subject: Re: llLookAt alternative
PostPosted: Sat Jul 03, 2010 9:24 pm 
User avatar

Joined: Thu Aug 06, 2009 9:11 pm
Posts: 41
Location: NYC
Wow, looks nice. I can't wait to try it out on Tuesday. Will let you know.
-Erik


Top
 Profile  
 
 Post subject: Re: llLookAt alternative
PostPosted: Tue Jul 06, 2010 4:26 am 
User avatar

Joined: Thu Aug 06, 2009 9:11 pm
Posts: 41
Location: NYC
Works perfectly. Thank you soooo much!


Top
 Profile  
 
 Post subject: Re: llLookAt alternative
PostPosted: Mon Nov 07, 2011 3:41 pm 
Furious Typer

Joined: Sun Nov 22, 2009 5:28 pm
Posts: 64
Only problem with this one. its haveing a slightly delay of 0.2 seconds.
If the LL document times are the same in opensim

llLookat dont have any delay.


Top
 Profile  
 
 Post subject: Re: llLookAt alternative
PostPosted: Mon Nov 07, 2011 10:33 pm 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 360
Location: Australia
Quote:
llLookat dont have any delay.

A function may not have any built in delay such as llSetRot does, however consider the following,
By the time the call is sent to activate the script, the script starting and running, sending a call to the agents (viewers within given distances) and viewer producing the required animation ie, turn to look, (all this being sent across internet lines) any script running llLookat is surely going to take more than 0.2 seconds.
I think 0.2 seconds should be fairly acceptable, besides it would take longer than that for the turn animation to ease in, turn, ease out of the anim.

In fact looking at the list of built in delays, we might see the logic, here is a couple...
llGiveInventory has 3 second delay, and
llTeleportAgentHome has a 5 second delay, it seems to me that these delays are built in for the purpose of allowing the transaction to be completed before the script continues, else risk a new command interfering with the action just called.

In any case the delay doesnt actually delay the function, it delays the script AFTER the function
Quote:
Each of these functions performs its task first, then delays the script

Also bare in mind that each event carries a default delay of 0.1 second, so a script with 10 events is always going to take one whole second to complete a single iteration of the script (this answers a question about a strobe light I have had for some time)
Quote:
By default the delay is .1 seconds between the end of an event and when the next event is fired off
The workaround for this is to put each event in a separate script.
All this information was taken from http://lslwiki.net/lslwiki/wakka.php?wakka=ScriptDelay
Regards
Cam


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net