Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list destinazioni=[
- <203.044815,119.010872, 23.117887>,
- <203.044815,75.823448, 23.117887>,
- <203.313675,47.176334, 23.117887>,
- <157.466354,47.176334, 23.117887>,
- <157.466354,76.147148, 23.117887>,
- <135.841629,76.147148, 23.117887>,
- <100.128853,76.147148, 23.117887>,
- <99.157257,118.852654, 23.117887>,
- <178.305634,119.010872, 23.117887>
- ];
- integer index=0;
- rotation getRotToPointAxisAt(vector axis, vector target) {
- vector mypos=llGetPos();
- target=<target.x,target.y,mypos.z>;
- return llGetRot() * llRotBetween(axis * llGetRot(), target - llGetPos());
- }
- default
- {
- state_entry()
- {
- llSitTarget(<0,0,0.5>,llEuler2Rot(<0,0,PI/2>));
- }
- touch_start(integer count)
- {
- llOwnerSay("Touched");
- llSetTimerEvent(0.1);
- index=0;
- }
- timer(){
- // llOwnerSay("Timer index:"+(string)index);
- llSetTimerEvent(0.0);
- vector destinazione=llList2Vector(destinazioni,index);
- rotation r=getRotToPointAxisAt(<1,0,0>,destinazione);
- llRotLookAt(r,1.0,10.0);
- // llSetRot(r);
- integer reached;
- do
- {
- float dist = llVecDist(destinazione,llGetPos());
- reached = dist < 1.3f;
- // llOwnerSay("Reached: "+(string)reached + " Dist "+(string)dist+" SetPos "+(string)destinazione);
- llSetPos(destinazione);
- dist = llVecDist(destinazione,llGetPos());
- llSleep(0.1);
- } while(reached==0);
- index = index+1;
- if(index>=llGetListLength(destinazioni)){
- index=0;
- }
- llSetTimerEvent(0.01);
- //llSetRot(r1);
- }
- }
Add Comment
Please, Sign In to add comment