Difference between revisions of "Category:LSL Link/Get"
Jump to navigation
Jump to search
m |
m |
||
Line 24: | Line 24: | ||
{//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments. | {//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments. | ||
vector pos = llGetRootPosition(); | vector pos = llGetRootPosition(); | ||
if(llGetLinkNumber() > 1) | |||
if( | return (llList2Vector(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_POS) + pos, 0) - pos) / llGetRootRotation(); | ||
return (llList2Vector(llGetObjectDetails( | |||
return pos; | return pos; | ||
} | } | ||
Line 33: | Line 32: | ||
{//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments. | {//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments. | ||
rotation rot = llGetRootRotation();//There is no llGetAttachmentRot :( | rotation rot = llGetRootRotation();//There is no llGetAttachmentRot :( | ||
if(llGetLinkNumber() > 1) | |||
if( | return llList2Rot(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_ROT) + rot, 0) / rot; | ||
return llList2Rot(llGetObjectDetails( | |||
return rot; | return rot; | ||
}</lsl> | }</lsl> | ||
}} | }} |
Revision as of 06:34, 25 August 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Useful Snippets
<lsl>list GetLinkDetails(integer link, list OBJECT_FLAGS) {//simple wrapper
return llGetObjectDetails(llGetLinkKey(link), OBJECT_FLAGS);
}
key GetLinkCreator(integer link) {
return llList2Key(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_CREATOR) + NULL_KEY, 0);
}
key GetLinkGroup(integer link) {
return llList2Key(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_GROUP) + NULL_KEY, 0);
}
string GetLinkDesc(integer link) {
return (string)llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_DESC);
}
vector GetLinkLocalPos(integer link) {//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments.
vector pos = llGetRootPosition(); if(llGetLinkNumber() > 1) return (llList2Vector(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_POS) + pos, 0) - pos) / llGetRootRotation(); return pos;
}
rotation GetLinkLocalRot(integer link) {//This function may not produce a perfect result, expect there to be some drift. This will not work in attachments.
rotation rot = llGetRootRotation();//There is no llGetAttachmentRot :( if(llGetLinkNumber() > 1) return llList2Rot(llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_ROT) + rot, 0) / rot; return rot;
}</lsl>
Pages in category "LSL Link/Get"
The following 5 pages are in this category, out of 5 total.