Difference between revisions of "Talk:LlSitTarget"
Jump to navigation
Jump to search
m (Talk:LSL llSitTarget moved to Talk:LlSitTarget: removing prefix) |
|||
Line 1: | Line 1: | ||
===Optimization=== | |||
<pre> | |||
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 | |||
</pre> |
Revision as of 08:34, 1 September 2007
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