Jump to content
Lolita Erin

Find the Rotation of a Child Link

Recommended Posts

Hello, i have seach but no luck,

i need to be able to find in all the links prims the rotation, to fix it in case is move

if i have 80 prims linked and some of them the rotation has move i like to seach in all the links which are the one are move so i can fix it (maybe with same script will be great)

here is and example of 4 prims and one is move rotation, i need to be able to find using a script

https://gyazo.com/638f6598a614dd3d070e78b8ef613d7f

Thanks so much for any help

Share this post


Link to post
Share on other sites

here is an idea of what you might do?

list rot_list;

check_prims()
{     rot_list = []; 
      integer prims=llGetNumberOfPrims();  
      integer x;
      for(x = 1; x <= prims;++x)
      { key link_key = llGetLinkKey(x);       
        list temp = llGetLinkPrimitiveParams(x,[ PRIM_ROT_LOCAL ]  ); 
        rotation r = llList2Rot( temp,0); 
        rot_list += link_key;
        rot_list += r;
      }  
}
compare_lists();
{ // make a function to compare list elements, and return TRUE or FALSE
}
reset_rotations()
{ // make a function to reset all rotations
}
list start_rotations;
list chk_rotations;

default
{
    state_entry()
    {  check_prims();
       start_rotations = rot_list;
      
    }
    touch_start(integer total_number)
    {   check_prims();
        chk_rotations = rot_list;
        integer status = compare_lists();
       
      if( status )
        llOwnerSay("rotations correct");
      else
       reset_rotations();
    }
}

 

  • Like 1

Share this post


Link to post
Share on other sites

The check_prims() return this and not in Degres how can i conver this?

thanks

Hello, Avatar!
[18:46] Object: Link # 1 Rotation: <0.00000, 0.00000, 0.00000, 1.00000>
[18:46] Object: Link # 2 Rotation: <0.00000, 0.00000, 0.00000, 1.00000>
[18:46] Object: Link # 3 Rotation: <0.00000, 0.00000, 0.33381, 0.94264>
[18:46] Object: Link # 4 Rotation: <0.00000, 0.00000, 0.00000, 1.00000>

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×