Jump to content

For llTeleportAgent, How do I get the avatar rotations?


Estelle Pienaar
 Share

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

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

Recommended Posts

I want to trigger an llTeleportAgent function in an experience_permission event. After the avatar teleported, it is looking in the wrong direction.

So far I have used "llTeleportAgent(av, "teleporttarget", ZERO_VECTOR, ZERO_VECTOR);" After the teleport the avatar is looking East. But the avatar has to look West.

I get that the last vector in the llTeleportAgent function the "vector look_at". If I read the Wiki page, it is not very helpful: http://wiki.secondlife.com/wiki/Category:LSL_Vector/direction.

It only explains the vector for East ( <1,0,0> ) which seems to be the ZERO_VECTOR anyway. How can I find out the vectors for North, South, West or North-West, North-East etc.?

 

Link to comment
Share on other sites

If you rez a prim on the region, and inspect it using the editor (with the World ruler selected) you will see that due East is the direction in which  the object's positive X axis points -- in other words llGetPos() + <1.0, 0.0,0.0>.    So the object's negative X axis, <-1.0, 0.0,0.0>, points due West,   North is the object's positive Y axis, 0.0, 1.0, 0.0>, and South is the negative Y axis.

North East, therefore, is going to be a position at <1.0,  1.0, 0.0>, and so on.

So, if you're using llTeleportAgent and including a landmark for the target, 

 llTeleportAgent(teleportee, llGetInventoryName(INVENTORY_LANDMARK,0),ZERO_VECTOR, <-1.0, 0.0,0.0>);

should have you facing due West when you arrive.

Edited by Innula Zenovka
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Despite the wiki claim, " 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. ", which may be the case with region to region teleports where you are not a child agent of destination region, I've always used destination postion + local lookat.

So if you were teleporting in the same region to say <128,128,0> and want to face north, lookat would be <128,128,0> + <0,1,0>. Again, this is what I have success with for intra-sim teleporting only. If you wanted to maintain the direction you're facing, lookat would be <128,128,0> + llRot2Fwd(llList2Rot(llGetObjectDetails(agent_id,[OBJECT_ROT]),0) where agent_id is the key of the person being teleported.

I'm seeing this behaviour in my experience based teleporter which was made prior to the release of Experiences. It doesn't seem like anything has changed since.

  • Thanks 1
Link to comment
Share on other sites

14 hours ago, Estelle Pienaar said:

Thank you for your replies! When teleporting to other sims, it does get complicated!


One thing that seems couter intuitive to me is that: ZERO_VECTOR = <0,0,0> equals <1,0,0> equals East. Why is that?

Because, by default, SL inter-region teleports (and possibly intra-region ones too -- I can't remember) have always, since well before llTeleportAgent was thought of,  placed you facing East.    So if, by using ZERO_VECTOR,  you don't specify a LookAt direction, the simulator uses the default, East.

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2382 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...