Difference between revisions of "LlGetPrimitiveParams"
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
{//Returns a list that can be fed to llSetPrimitiveParams | {//Returns a list that can be fed to llSetPrimitiveParams | ||
list output; | list output; | ||
integer c = | integer c = [] != input; | ||
integer flag; | integer flag; | ||
integer side; | integer side; | ||
while(c & 0x80000000) | while(c & 0x80000000) | ||
{ | { | ||
if(~llListFindList([PRIM_BUMP_SHINY, PRIM_COLOR, PRIM_TEXTURE, PRIM_FULLBRIGHT, PRIM_TEXGEN], [ flag = llList2Integer(input, c++) ])) //pop the stack | |||
if(~llListFindList([PRIM_BUMP_SHINY, PRIM_COLOR, PRIM_TEXTURE, PRIM_FULLBRIGHT, PRIM_TEXGEN], [flag])) | |||
{ | { | ||
side = llList2Integer(input, c++) | if(~(side = llList2Integer(input, c++)))//pop the stack | ||
output = (output + flag) + (side + llGetPrimitiveParams([ flag, side ])); | |||
else | |||
{ | { | ||
side = llGetNumberOfSides(); | side = llGetNumberOfSides(); | ||
do //we return the sides in reverse order, easier to code; runs faster. | |||
output + | output = (output + flag) + (side + llGetPrimitiveParams([ flag, --side ])); | ||
while(side); | |||
} | } | ||
} | } | ||
else | else | ||
output += flag + llGetPrimitiveParams([flag]); | output += flag + llGetPrimitiveParams([ flag ]); | ||
} | } | ||
return output; | return output; |
Revision as of 10:58, 24 February 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: list llGetPrimitiveParams( list params );279 | Function ID |
0.2 | Forced Delay |
10.0 | Energy |
Returns a list that is the primitive parameters specified in the params list.
• list | params | – | PRIM_* flags |
Caveats
Examples
Useful Snippets
list GetPrimitiveParams(list input) {//Returns a list that can be fed to llSetPrimitiveParams list output; integer c = [] != input; integer flag; integer side; while(c & 0x80000000) { if(~llListFindList([PRIM_BUMP_SHINY, PRIM_COLOR, PRIM_TEXTURE, PRIM_FULLBRIGHT, PRIM_TEXGEN], [ flag = llList2Integer(input, c++) ])) //pop the stack { if(~(side = llList2Integer(input, c++)))//pop the stack output = (output + flag) + (side + llGetPrimitiveParams([ flag, side ])); else { side = llGetNumberOfSides(); do //we return the sides in reverse order, easier to code; runs faster. output = (output + flag) + (side + llGetPrimitiveParams([ flag, --side ])); while(side); } } else output += flag + llGetPrimitiveParams([ flag ]); } return output; } //Contributed by Strife Onizuka
See Also
Functions
• | llSetPrimitiveParams | – | Set many primitive parameters |