Jump to content

Avatar rotation?


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

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

Recommended Posts

You can't move an avatar directly using LSL, so the only way to do it is to rotate something that the avatar is linked to.  Treat it as a poseball exercise, as Peter suggests, and set the rotation in llSetTarget.  Unfortunately, that means your avatar will be immobile until s/he unlinks again, so you'll have to do any other movements either by triggering animations or by moving that "poseball".

Link to post
Share on other sites


Rolig Loon wrote:

You can't move an avatar directly using LSL, so the only way to do it is to rotate something that the avatar is linked to. 

If the avatar is linked to something (sitting on it) you can move it directly with PRIM_POSITION like any other child prim.  Link IDs for seated avatars start one after the highest real child prim.

PRIM_ROTATION works too, and I assume PRIM_ROT_LOCAL would as well, though I haven't tested it yet.

Interestingly, the avatar is not subject to the normal linking-distance rules here.   I have been able to move my avatar 1000 meters away from the root prim, and to explore underground.  I have only tested this sitting on a non-physical object.

I'm building a subway.

 

Link to post
Share on other sites

I have rotated and positioned avatars linked to physical objects using PRIM_ROTATION etc. My application is building kayaks and other vehicles that can paddle off-sim into the Void Sea. I  have discovered that the Physics Engine gets very confused when the avatar is over about 40 meters away from the root prim and off-sim. At 40 meters or more the whole build starts taking off and flying great distances (greater than 256 meters) before snapping back to where it belongs.

 

Link to post
Share on other sites
  • 1 year later...

Sure.  Drop this in a prim and click it.

default{    touch_start(integer total_number)    {        llSensor("","",AGENT_BY_LEGACY_NAME,10.0,PI);    }        sensor(integer num)    {        llSay(0,llDetectedName(0) + " is facing " + (string)llDetectedRot(0) + ". (That is, " + (string)(llRot2Euler(llDetectedRot(0))*RAD_TO_DEG) + ".");    }}

 It won't work if it's attached to the avatar, but you could modify it to be a follower......

Link to post
Share on other sites

Rolig, thanks for your tip,  I added your code to the second follower script found here and it seems to report only the rotation in one axis like this

Resident is facing <0.00000, 0.00000, 0.53724, 0.84343>. (That is, <0.00000, 0.00000, 64.99147>.

When I trigger an animation applied to the avi inworld that lays my avi sideways on the floor the rotation reported is the same as above.

I'd like to have have a report on what is the rotation of the avi when an animation is applied to it inworld.

Link to post
Share on other sites

Innula, I tried the following script put on a cube attached to my spine:

default
{
    touch_start(integer total_number)
    {
        llSay(0,(string)(llRot2Euler(llGetRot())*RAD_TO_DEG));
    }
}


But the script seems to report only the rotation in one axis (the last one):

 <0.00000, 0.00000, -96.84402>

And it returns the same value if I apply an inworld animation to the avi making it lay on the floor on its side.

Link to post
Share on other sites

Yes, you are getting the results I would expect.   When you are standing up, you will only be rotating on your z axis, at least normally.   

When you play an animation, the sim doesn't know about it -- it knows it's sent some instructions to the computers of everyone in draw distance about how to draw your avatar (laying down, standing on its head, whatever) but it has no idea what those instructions are.   As far as the sim is concerned,  when you're playing an animation, you are are just standing (or sitting) there motionless.

That's why, if you and I are dancing near each other,  we may find ourselves passing through each other like two ghosts.  If we stop dancing and one of us walks into the other, we collide.

There isn't,  I'm sorry to say, any way to find out what angle the animation is putting you without having access to the animation code itself (which we don't have unless we created it  and can look at the local copy of the .bvh or .anim file we've uploaded).

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...