Jump to content

How to rotate about an arbitrary object in a link chain?


Dinox Whitfield
 Share

You are about to reply to a thread that has been inactive for 3635 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have 3 objects linked together: root, child1, child2. The default behavior of rotation functions and functions returning position and orientation info is to return those in either World (region-relative) coordinates or Local (root-relative) coordinates. This is useful for rotation about the region's origin or the root. What I want to achieve instead is to rotate child2 around child1. Unfortunately when I do the necessary calculations (transform child2's position to child1's basis, rotate child2, transform hild2's position back to region coords) and invoke llSetPos() in the child2's script, it doesn't change it's position. Calculations are correct cause I checked the outputs and the pre-transform and post-transform values are different so even if there was a mistake, llSetPos() should've at least move the object somewhere. But nothing happens. Child2 stays where it is.

Link to comment
Share on other sites

Without seeing the code, it's kind of shooting in the dark, but a couple of things come to mind.

Are the distances large enough that it's hitting the 55m link limit?

And are you sure it's not moving? (That is, does it report the same position, or does it just look the same in the viewer? The sending of updates for child prims is kind of buggy.)

Link to comment
Share on other sites

I managed to solve it. The problem was in how llSetPos() interpreted the coordinates. They were region-relative whereas the function expected them root-relative. I simply transformed the coordinates to the root basis. Btw, the "erroneous" region coordinates' X, Y, Z values exceeded the 55m limit so that too prevented the script from working as expected.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3635 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...