Difference between revisions of "User:Ugleh Ulrik/Vector2List"
Jump to navigation
Jump to search
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>...') |
Ugleh Ulrik (talk | contribs) |
||
Line 1: | Line 1: | ||
This UD Function I made creates a list of a vector. | This UD Function I made creates a list with 3 strings for the 3 cords of a vector. | ||
For Example | For Example | ||
list thislist = Vector2List(llGetPos()); | list thislist = Vector2List(llGetPos()); | ||
As a list, would output | As a list, would output | ||
list thislist = [x,y,z]; | list thislist = [x,y,z]; | ||
Revision as of 23:26, 18 April 2010
This UD Function I made creates a list with 3 strings for the 3 cords 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); } }