@setrot:<angle>=force turns the avatar to face a compass direction. 0 is north (+Y), π/2 is east (+X), π is south.

Syntax

@setrot:<angle_in_radians>=force

Parameters

angle_in_radians
Parsed with atof; any value is accepted (it is effectively taken modulo 2π). Non-numeric text gives 0 (north).

Specification

The viewer rotates the vector (0, 1, 0) by −angle around Z, starts a camera animation, and calls gAgent.resetAxes with that facing. There is no restriction form, and no other restriction blocks it.

Caveats

Examples

// Face the object issuing the command
vector d = llGetPos() - llList2Vector(llGetObjectDetails(llGetOwner(), [OBJECT_POS]), 0);
float angle = PI_BY_TWO - llAtan2(d.y, d.x);
llOwnerSay("@setrot:" + (string)angle + "=force");

See also

Implementation notes

RRInterface.cpp:2307-2318. The function returns false only if the agent avatar doesn't exist; the dispatcher ignores the return value.

Client differences

No differences found between Marine's RLV and CoolVL (mkrlinterface.cpp:2802-2811). CoolVL lists setrot among its non-blacklistable miscellaneous commands.

Comparison with RLVa

No significant differences from RLVa's @setrot.