OsGetLinkPrimitiveParams

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Original page creation)
 
(Removed the "Bugs" section after submitting a patch to correct the issues with llGetPrimitiveParams() and osGetLinkPrimitiveParams().)
Line 9: Line 9:
  
 
This function has a [[threat level]] of High, to prevent unscrupulous users from easily retrieving the construction details of an entire linkset. Please see the [[threat level]] page for information on how to enable the use of this function securely.
 
This function has a [[threat level]] of High, to prevent unscrupulous users from easily retrieving the construction details of an entire linkset. Please see the [[threat level]] page for information on how to enable the use of this function securely.
 
'''Bugs:''' As of this writing (December 2009), some of the values returned are incorrect: specifically, the top shear value returned for '''PRIM_TYPE''' is incorrect if the shear is negative; the revolutions value returned for '''PRIM_TYPE''' is also incorrect (llGetPrimitiveParams() is affected by both of these issues as well). Furthermore, if the root prim of the linkset is rotated in any fashion, the '''PRIM_ROTATION''' values returned for child prims are incorrect.
 
  
 
Example script:
 
Example script:

Revision as of 17:06, 19 December 2009

Technical Reference -> Terms -> Status Page -> OSSL Implemented Functions -> osGetLinkPrimitiveParams


LSL: list osGetLinkPrimitiveParams( integer linknumber, list params )
C#: LSL_List osGetRegionStats( int linknumber, LSL_List params )

Returns the primitive parameters for the linkset prim or prims specified by linknumber. It is possible to use the linkset constants (e.g. LINK_SET, LINK_ALL_CHILDREN) in place of a specific link number, in which case the requested parameters of each relevant prim are concatenated to the end of the list. Otherwise, the usage is identical to llGetPrimitiveParams().

This function has a threat level of High, to prevent unscrupulous users from easily retrieving the construction details of an entire linkset. Please see the threat level page for information on how to enable the use of this function securely.

Example script:

// llGetLinkPrimitiveParams() example script
//
// Trivial example which averages the sizes of all the prims in the linkset and returns the resuilt.
//
default
{
    state_entry()
    {
        vector average = ZERO_VECTOR;
        list params = osGetLinkPrimitiveParams( LINK_SET, [ PRIM_SIZE ] );
        integer len = llGetListLength( params );
        integer i;
 
        for (i = 0; i < len; i++)
            average += llList2Vector( params, i );
 
        average /= (float) len;
        llOwnerSay( "The average size of the prims in this linkset is " + (string) average );
    }
}
Personal tools
General
About This Wiki