Talk:LlSitTarget

From Second Life Wiki
Revision as of 08:34, 1 September 2007 by Strife Onizuka (talk | contribs)
Jump to navigation Jump to search

Optimization

list GetSitTarget(integer prim, key av)
{//WARNING: llGetObjectDetails can introduce an error that goes as far as the 5th decimal place.
    if(prim == LINK_THIS)//llGetLinkKey doesn't like LINK_THIS
        prim = llGetLinkNumber();
    
    list details = OBJECT_POS + (list)OBJECT_ROT;
    vector tp = llGetAgentSize(av);
    rotation f = llList2Rot(details = (llGetObjectDetails(llGetLinkKey(prim), details) + llGetObjectDetails(av, details)), 1);
    
    return [(llRot2Up(f = (llList2Rot(details, 3) / f)) * tp.z * 0.02638) + ((llList2Vector(details, 2) - llList2Vector(details, 0)) / f) - <0.0, 0.0, 0.4>, f];
}//Written by Strife Onizuka