Jump to content

llTeleportAgentGlobalCoords look_at BUG-214737 and SVC-7987


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

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

Recommended Posts

Question: Am I overlooking anything?

Background:

I believe that the llTeleportAgentGlobalCoords( key agent, vector global_coordinates, vector region_coordinates, vector look_at ) does not respond to the vector look_at parameter when teleporting within a Region. When teleporting to another region (meaning different from where avatar started), the vector look_at parameter works fine.

I submitted a bug report at: 
https://jira.secondlife.com/browse/BUG-214737

, which is related to an old comment
https://jira.secondlife.com/browse/SVC-7987

Others have discussed this in another topic at 

This is the test code I used in https://jira.secondlife.com/browse/BUG-214737 .  

/*

Step One. Go to Linden public sandbox region named "Sandbox Mirus".

Step Two. Place the following code in a default cube and touch it, being sure to accept the permissions request.

Step Three. Observe that the Telport within the region named "Sandbox Mirus" __ DOES NOT __ point you to the specified vector look_at direction.

Step Four. Pick the cube up and place the cube in the adjacent region named "Sandbox Peritus."

Step Five. Once again touch the cube, being sure to accept the permissions request. The script will teleport you back to region named "Sandbox Mirus".

Step Six. Observe that your avatar is now indeed pointed in the direction vector look_at direction.

*/

key agent = NULL_KEY;

// Region "Sandbox Mirus" is at global coordinates <256512,130560,0>
// A Second Life Premium Sandbox
vector global_coordinates = <256512,130560,0>;

vector region_coordinates = <128,128,30>; // coordinates relative to region corner

// Vector to lookat-direction when landing after teleportation
// North is <0., 1., 0.> 
// South is <0., -1., 0.>
// East is <1.,0.,0.>
// West is <-1.,0.,0.>
// North West is <-1.,1.,0.>
// North East is <1.,1.,0.>
// South West is <-1.,-1.,0.>
// South East is <1.,-1.,0.>

vector look_at = <-1.,0.,0.>; // Points West

default
   {
   state_entry()

      { 
         agent = llGetOwner(); llRequestPermissions(agent, PERMISSION_TELEPORT); 
      }

   touch_start(integer total_number)
      {
         if ( agent == llDetectedKey(0) )

            { 
               llTeleportAgentGlobalCoords( agent, global_coordinates, region_coordinates, look_at ); 
            }
      }

   run_time_permissions(integer perm)
      {
         // if permission request has been denied (read ! as not)
         if (!(perm & PERMISSION_TELEPORT))

            { 
               llSay(PUBLIC_CHANNEL, "I need Owner permissions to teleport Owner!"); 
               llRequestPermissions(agent, PERMISSION_TELEPORT); 
            }
      }
}
 

 

Edited by Erwin Solo
typo fix
  • Like 1
Link to post
Share on other sites

Try this.  Put it in a prim, attach it to yourself somewhere convenient, and click it several times.  No matter which of the four destinations you go to, you'll always land facing the region's center (<128,128, 23>).  The point is that for llTeleportAgent the look_at vector is not a compass direction.  It's the location of a point in the region that you want to look at on arrival. That's not clear in the documentation.

list lDestinations = [<50,50,23>,<206,50,23>,<50,206,23>,<206,206,23>];
integer iCount;

default
{
    touch_start(integer total_number)
    {
        iCount = (++iCount%4);
        llRequestExperiencePermissions(llDetectedKey(0),"");
    }
    
    experience_permissions(key av)
    {
        llTeleportAgent(av,"",llList2Vector(lDestinations,iCount),<128,128,23>  );
    }
}

EDIT: Since you are the object's owner, it doesn't make any difference whether you compile this in an Experience or not.  If you wanted t to teleport other people, of course, you'd need an Experience.

Edited by Rolig Loon
Link to post
Share on other sites

Aha. Right you are. Sorry about that.  I focused on your sentence, "When teleporting to another region (meaning different from where avatar started), the vector look_at parameter works fine," and translated that into a comment about llTeleportAgent, since I would not usually think of using llTeleportAgentGlobalCoords within the same region. OK, then, try this one:

list lDestinations = [<50,50,23>,<206,50,23>,<50,206,23>,<206,206,23>];
integer iCount;

default
{
    touch_start(integer total_number)
    {
        iCount = (++iCount%4);
        llRequestExperiencePermissions(llDetectedKey(0),"");
    }
    
    experience_permissions(key av)
    {
        llTeleportAgentGlobalCoords(av,llGetRegionCorner(),llList2Vector(lDestinations,iCount),<llCos(-PI/4),llSin(-PI/4),0.0>  );
    }
}

It's the same script, modified for llTeleportAgentGlobalCoords.  As the note in the LSL wiki for that function says ...

look_at is not the coordinates of a point in the region. The look_at vector is <llCos(facing), llSin(facing), 0.0> where facing is the angle towards which the arriving avatar is to look.

So that's what I used as the look_at param in this example. When I test with this script, I end up looking at the SW corner of the region after each TP.  To be honest, that's not where I expected to be looking, but it's consistent.  I have to think for a while about why it's the SW corner when I expected the NE one..... :S

  • Like 1
Link to post
Share on other sites

I just tried this again, and as I noted in SVC-7987 I'm seeing that llTeleportAgentGlobalCoords within a region orients the avatar to face the direction the camera was pointed if alt-zoomed at time of teleport, independent of whatever look_at parameter is specified.

(Unfortunately I see my comment in that jira contains an embarrassing "intra" / "inter" error that I guess I'll correct with a note after all this time.)

  • Like 1
Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 955 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...