Skip to content

[Viewer] Honor server autopilot orientation/NEW LSL llSetAgentRot(rotation rot); #2687

@Rider-Linden

Description

@Rider-Linden

Test plan:

https://github.com/secondlife/server/issues/966#issuecomment-2377490705

  1. Create two objects on the ground with the following scripts.
default
{
    state_entry()
    {
        llSetText("Avatar Rotator", llGetColor(ALL_SIDES), 1.0);
    }

    touch_start(integer total_number)
    {
        llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
    }
    
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetAgentRot(llGetRot(), 0);
            llSetTimerEvent(0.1);
        }
    }

    timer()
    {
        {
            llSetAgentRot(llGetRot(), 0);
        }
    }

}

and

default
{
    state_entry()
    {
        llSetTimerEvent(0.1);
    }

    timer()
    {
        rotation rot = llList2Rot(llGetObjectDetails(llGetOwner(), [OBJECT_ROT]), 0);
        llSetText("My owner's rotation is " + (string)rot, llGetColor(ALL_SIDES), 1.0);
    }
}
  1. Place those objects on the ground. Note the second object will display the current rotation of the object owner.
  2. Rotate your avatar. Note that the orientation display object updates its values.
  3. Sign in a second avatar near the test avatar.
  4. From the second avatar observe the direction the first avatar is facing.
  5. Have the first avatar touch the "Avatar Rotator" object (and accept the permission to Animate your avatar). Note the following:
    • The avatar rotation object updates to reflect the new rotation. (Does not need to be exact, just close)
    • The second avatar observes the first avatar has turned to face in the correct direction.
    • The first avatar observes themselves turn in the correct direction.
  1. Rotate the Avatar Rotator object in various ways. Verify the controlled avatar is rotated quickly, within a second.
  2. Verify that the direction of the controlled avatar is based on only the yaw of the control object. That is - the avatar rotation is based on the rotation of the object around it's Local Z axis. If the box is turned upside-down so the local z-axis (the blue arrow when editing position while Local coordinates are used) is pointing downward and then the box is rotated clockwise around the z-axis, the avatar will rotate counterclockwise.

Description

Viewer support for https://github.com/secondlife/server/issues/966

When the server indicates that it has taken control of the main agent using the FLAG_SERVER_AUTOPILOT flag, honor adjustments to the local avatar's rotation while processing object updates.


Testing Guidance

Requires Barbecue simulator or later.

  1. Trigger some form of autopilot from the simulator.
  2. Observe that the local avatar will turn to face the direction indicated by the simulator.
  3. Using Hypolizer observe that the Flags field in ObjectUpdate messages for the local avatar will have the 24th bit set.
    • Observe that this bit will never be set for other agents.

Triggering simulator autopilot.

From a script you can use the new llSetAgentRot function.

There is also a way to have the simulator automatically walk an avatar to a global position. I do not know how this is triggered from the client.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions