The rotation whose X vector is to be returned.
Returns a unit vector that is the local X vector for that rotation.
<1, 0, 0>*rot
, except for the fact that the vector is normalized. When working with rotations that are guaranteed to be normalized (such as the ones that llGetRot
, llEuler2Rot
etc. return), it's faster to use <1, 0, 0>*rot
than llRot2Fwd.llRot2Fwd(llGetRot())
(or equivalently, <1,0,0>*llGetRot()
) used in the root of an attachment gives the direction the avatar is facing; vehicles also use the X vector as the direction to move towards by default.This script, if used in an attachment, will rez an object 1.5 m in front of the avatar's center when touched. If used in an object that is not attached, it will rez the object 1.5m away in the direction of its local X axis.
default { touch_start(integer num) { vector pos = llGetPos() + llRot2Fwd(llGetRot())*1.5; llRezObject("Object", pos, <0,0,0>, llGetRot(), 1); } }
llRot2Left
returns the local Y axis of a rotation.llRot2Up
returns the local Z axis of a rotation.llAxes2Rot
takes local X, Y, and Z unit vectors and converts them to a rotation.