Jump to content
Sign in to follow this  
VirtualKitten

is it possible to push an object in a circle

Recommended Posts

Hi scriptwriters and scribblers

I am back with another question . 

Can i push an object in a circle with an angular impulse if so how do i set diameter of this circumference  as an angular vector

I have 

          target_relative_direction = pos - llGetPos();
          vector target_normalised_vector = llVecNorm(target_relative_direction);
          float push = 1;
          llPushObject( intruder_key, ((push/100.0)*2147483647)*target_normalised_vector, ZERO_VECTOR, FALSE );
   

 

Which pushes in a straight line on global co-ordinates . If I want to get a circle can i change ZERO_VECTOR to an angular rotation and how and what  and will this be in relation to diameter of circle pushed around ?

 

Thank you for looking :)

Share this post


Link to post
Share on other sites
Posted (edited)

i understand Since the arclength around a circle is given by the radius*angle (l = r*theta), you can convert an angular velocity w into linear velocity v by multiplying it by the radius r, so v = rw.

but not sure how to apply this to angular vector

 

Edited by VirtualKitten

Share this post


Link to post
Share on other sites
Posted (edited)

look up example scripts of llKeyFramedMotion for methods to plot points on the circumference of a circle

then a way is use a timer event to push the agent toward the next point in the sequence

a thing is that we can't rotate an agent with a script (agent can only rotate itself using its own input device/keyboard/mouse/etc) so it can look a bit naff as without agent input the agent will always be facing the same direction as it travels the circle

being able to rotate a agent with a script has often been requested but Linden haven't give it to us. Maybe one day hopefully

when we go down the path of pushing agents then we are on a journey to writing a impulse engine.  Argent Stonecutter's Flight Feather is an implementation of an agent impulse engine and I think it can still be gotten full permissions inworld on his parcel for some small amount of L$. I don't have a parcel SLURL for it but am pretty sure it can be found in inworld search

 

edit add:

i crossed out the bit about rotating not able to be done.  Wulfie showed me how llPushObject actually works when we apply/simulate angular impulse in code. Which is a pretty good thing to know about.  I ask Wulfie to post what he told me as I think is a good thing when we all can know about these things

 

Edited by Mollymews

Share this post


Link to post
Share on other sites
7 hours ago, Mollymews said:

being able to rotate a agent with a script has often been requested but Linden haven't give it to us. Maybe one day hopefully

There's always opencollar, that manages it :)

Share this post


Link to post
Share on other sites
8 minutes ago, Profaitchikenz Haiku said:

There's always opencollar, that manages it :)

yes is true about the RLV engine.  I often tend to overlook things that 3rd party viewers can do.  My thoughts are always pretty much along what we can/can't do out of the Linden box

this said it would be pretty interesting to see an avatar impulse engine that incorporates the Z-rotational capability of RLV

Share this post


Link to post
Share on other sites

i have a script that pushes for magic . This works in a straight line without open collar or llKeyFrame

 

 link_message(integer sender, integer num, string str, key _key) {
         if (llGetAgentSize(intruder_key) == <0.0,0.0,0.0>) return;
         
         
          list tmp = llParseString2List(str,["|"],[]);
          string _name = llList2String(tmp,0); //llGetSubString(str,  0, llSubStringIndex(str,"|") - 1);
          vector pos = (vector)llList2String(tmp,1); 
          vector target_relative_direction;
          float push = .010;
          target_relative_direction = pos - llGetPos();
          vector target_normalised_vector = llVecNorm(target_relative_direction);
          string action = "Push";

          if (llGetAgentSize(_key) == <0.0,0.0,0.0>) return;
          llPushObject( _key, ((push/100.0)*2147483647)*target_normalised_vector,  link_message(integer sender, integer num, string str, key intruder_key) {
       
         
        

 

i tried      llPushObject( intruder_key, ((push/100.0)*2147483647)*target_normalised_vector, <0.3,0.3,0.0>, FALSE ); using <0.3,0.3,0.3> as the angular vector but it still travels the avatar in a straight line . I don't understand these angular pushes  can anyone sagest how you get an angular vector that pushes in a circle 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...