|
Don Bricklin
Registered User
Join date: 28 Aug 2006
Posts: 10
|
10-28-2006 21:48
Does anyone know how llGetLocalPos() and llGetLocalRot() are derived? If so do you have an example script of what a version of these two routines would look like for two unlinked roots? In otherwords one relative to the other. (Or just give me an lsl version of those two routines and I can make my own once I see how they work). For unlinked versions I will query the information over a private channel.
I am using the local functions with linked objects now very successfully to rotate all kinds of child prims around in different positions no matter what pos/rot the root is in for a particular object. Now I would like to do it with two objects using the roots in each object relative to the other. (i.e. One objects root can play child, and the other objects root can play root)
Thank you advance for any information Don
|
|
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
|
10-28-2006 23:31
rotation child_rot(rotation rotB, rotation rotA) //gives what llGetLocalRot would for object B if it were a child prim of object A { return rotB / rotA; } vector child_pos(vector posB, vector posA, rotation rotA) //gives what llGetLocalPos would for object B if it were a child prim of object A { return (posB - posA) / rotA; }
I think these are what you're after. This is from memory so I could be wrong, so test them.
_____________________
-Seifert Surface 2G!tGLf 2nLt9cG
|
|
Don Bricklin
Registered User
Join date: 28 Aug 2006
Posts: 10
|
10-29-2006 16:40
From: Seifert Surface
I think these are what you're after. This is from memory so I could be wrong, so test them.
Thank you Seifert. After using these as a direct replacement to to llGetLocalPos() and llGetLocalRot() they worked perfectly. If you have the time could you shed some light on what the translation may look like that would run the relative positions calculated, into the new absolute positions required buy the unlinked set for use with llSetPos() and llSetRot()? With the linked pair I can use the Pos results directly and the Rot as ZERO_ROTATION * llGetLocalRot() / llGetRootRotation() and plug them into llSetPrimativeParams. A different conversion is needed I see to use llSetPos() and llSetRot() with the unlinked set because it requires the absolute values not relative ones. I guess the question is how to get from the the relative values now to the NEW absolute values for the llSetPos/Rot functions and preserve the relationship? Thank you again this is very helpful information Don
|
|
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
|
10-30-2006 00:11
Not entirely sure what you mean... do you mean how to do the reverse operation of the functions from my last post?
_____________________
-Seifert Surface 2G!tGLf 2nLt9cG
|
|
Don Bricklin
Registered User
Join date: 28 Aug 2006
Posts: 10
|
10-30-2006 00:54
From: Seifert Surface Not entirely sure what you mean... do you mean how to do the reverse operation of the functions from my last post? Not reversing them (althought that would be an intersting to see for the rotation). Mainly what further translations would be required to use the results from your functions in the last post in llSetPos() and llSetRot() functions I believe would be the proper question. The example I gave above works for llSetPrimitiveParms() (in linked sets) but not llSetPos() and llSetRot() which the unlinked objects roots would need to position them. If you spend any time in-world lately let me know your schedule or a time you might be on and I can show you what I am working on. I have a feeling you would move me past the roadblock much faster than I currently am  thx Don
|
|
Don Bricklin
Registered User
Join date: 28 Aug 2006
Posts: 10
|
10-30-2006 08:19
Hey Seifert,
What you have provided has worked perfect in helping solve the problem. I was running it this morning after your help last night (early hours of this morning). The missing piece last night had to do getting the update from the BoxA after its position or rotation had been modified. I really appreciate the time you took and never realized that part about the settings in llSetPrimParameters reverting to global values when unliked (or in root prim of linked set I presume). Makes perfect sense when you think about it.
Thanks again, the two boxes you saw me working with last night are aligning themselves perfectly based on your information and calculations.
Thanks again Don
|