User:Ugleh Ulrik/Vector2List
< User:Ugleh Ulrik
Jump to navigation
Jump to search
Revision as of 20:19, 16 April 2010 by Ugleh Ulrik (talk | contribs) (Created page with 'This UD Function I made creates a list of a vector. For Example list thislist = Vector2List(llGetPos()); As a list, would output list thislist = [x,y,z]; '''Function''' <pre>...')
This UD Function I made creates a list of a vector. For Example list thislist = Vector2List(llGetPos()); As a list, would output list thislist = [x,y,z];
Function
list Vector2List(vector v){ list alist = llParseString2List((string)v,[",", ">", "<"],[]); return alist; }
An Example
list Vector2List(vector v){ list alist = llParseString2List((string)v,[",", ">", "<"],[]); return alist; } default { touch_start(integer total_number) { list thislist = Vector2List(llGetPos()); string x = llList2String(thislist,0); string y = llList2String(thislist,1); string z = llList2String(thislist,2); llOwnerSay("X Axis: " + x); llOwnerSay("Y Axis: " + y); llOwnerSay("Z Axis: " + z); } }