LlAtan2/Compass QA: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Strife Onizuka (talk | contribs)
m LSL Editor has a multiplication bug between integers and floats that makes it non-reciprocal.
Draconis Neurocam (talk | contribs)
m Updating the syntax highlighting for this page.
 
Line 1: Line 1:
<lsl>default
<source lang="lsl2">
default
{
{
state_entry()
state_entry()
Line 15: Line 16:
}
}
}
}
}</lsl>
}
</source>

Latest revision as of 13:56, 22 March 2022

default
{
	state_entry()
	{
		vector p = llGetPos();
		integer a = 0;
		integer b = 72;
		float c = -TWO_PI / b;
		float d = 360.0 / b;
		while(a <= b)
		{
			vector target = (<0,1,0> * llEuler2Rot(<0, 0, c * a>));
			llOwnerSay(llDumpList2String([((integer)(d * a))] + compass(p + target), " "));
			a++;
		}
	}
}