Difference between revisions of "LlSetAgentRot"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{LSL_Function |func_id=|func_sleep=0.0|func_energy=10.0 |func=llSetAgentRot |p1_type=rotation|p1_name=rot |func_desc=Sets the rotation the avatar to {{LSLP|rot}}. |return_tex...")
 
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
|func_id=|func_sleep=0.0|func_energy=10.0
|func_id=|func_sleep=0.0|func_energy=10.0
|func=llSetAgentRot
|func=llSetAgentRot
|p1_type=rotation|p1_name=rot
|p1_type=rotation|p1_name=rot|p1_desc=Rotation for avatar.
|p2_type=integer|p2_name=flags|p2_desc=Flags to control behavior of llSetAgentRot.
|func_desc=Sets the rotation the avatar to {{LSLP|rot}}.
|func_desc=Sets the rotation the avatar to {{LSLP|rot}}.
|return_text
|return_text
|spec=This function turns the avatar to face the direction indicated by {{LSLP|rot}}.
|spec=This function turns the avatar to face the direction indicated by {{LSLP|rot}}.
{{LSLP|flags}} is a placeholder for future expansion. There are no flags defined at this time, pass a constant value of 0.
|caveats=* This function requires PERMISSION_TRIGGER_ANIMATION.
|caveats=* This function requires PERMISSION_TRIGGER_ANIMATION.
* This function will only rotate an avatar around the yaw angle.
* This function will only rotate an avatar around the yaw angle.
Line 35: Line 39:
         if (perm & PERMISSION_TRIGGER_ANIMATION)
         if (perm & PERMISSION_TRIGGER_ANIMATION)
         {
         {
             llSetAgentRot(llGetRot());
             llSetAgentRot(llGetRot(), 0);
         }
         }
     }
     }

Latest revision as of 06:47, 14 November 2024

Summary

Function: llSetAgentRot( rotation rot, integer flags );
0.0 Forced Delay
10.0 Energy

Sets the rotation the avatar to rot.

• rotation rot Rotation for avatar.
• integer flags Flags to control behavior of llSetAgentRot.

Specification

This function turns the avatar to face the direction indicated by rot.

flags is a placeholder for future expansion. There are no flags defined at this time, pass a constant value of 0.

Caveats

  • This function requires PERMISSION_TRIGGER_ANIMATION.
  • This function will only rotate an avatar around the yaw angle.
    • More complex rotations may be passed in, but the yaw is extracted and then renormalized.
  • Rotating to ZERO_ROTATION will face an avatar due east.
  • This function will not change the rotation for a seated avatar. Update the agent's sit target instead.
    • Special case: If the agent is seated on a prim WITHOUT a sit target they will be turned to face the set rotation when they stand.

Examples

// Turn the touching avatar to face the same direction as the prim.

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);
        }
    }

}

See Also

Functions

•  llRequestPermissions

Deep Notes

Signature

function void llSetAgentRot( rotation rot, integer flags );