Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

attachment positioning

Gruff Grut
Registered User
Join date: 13 Jun 2008
Posts: 7
08-27-2008 14:54
Challenge positioning attachment:-

imagine one prim 0.5,0.5,0.5, in its contents is another prim which is rezzed at exactly the same location as the first prim, size 1.0, 1.0, 0.25.
When the first prim is sat upon (offset <1.0, 0.0, 1.0> & ZERO_ROTATION) it whispers to the newly rezzed prim (sends it the offset details) which offers itself for attachment to avatar - attach is at pelvis. Upon attaching llSetPos is used to 'reverse' the av offset position - this is in an attempt to make the attached prim stay in exactly the same 'in world' position that it was at before attaching.

However, there seems to be an additional offset value required, I can determine this for my av and after that whatever height I make myself the offset is ok; but, if another av uses it the attached prim does not go back to the correct location in world. Is there some sort of magic formula that has to take into account the size of the avatar?

As an extra, when the prim is attached, right clicking it can cause it to jump about 0.013 M - but this is not consistent - anybody got any thoughts on the solution?

Additionally, I have attempted nothing with the rotation yet, but if you have any info on that it would be most welcome.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
08-27-2008 23:54
From: Gruff Grut
Is there some sort of magic formula that has to take into account the size of the avatar?
Unfortunately, this varies depending on avatar shape parameters such as height and leg length... even the thickness of currently-worn shoes will have an effect. The problem is that the sit target doesn't position to the avatar's pelvis, or any other skeletal component, but probably the center of the avatar collision boundary, an imaginary box around the avatar which is used to determine when it runs into prims/ground or interpenetrates phantom prims. The pelvis doesn't occupy any particular location within this box, as it's affected not only by the shape parameters (which LSL has no access to), but whatever animation/pose is in use at the time (which are also LSL-inacessible, since animations run client-side only).
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
08-28-2008 01:35
Wait till you find out the position for objects worn on the left upper arm is different to the right upper arm in 2 axis...................
_____________________
Level 38 Builder [Roo Clan]

Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107)

Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107)
Gruff Grut
Registered User
Join date: 13 Jun 2008
Posts: 7
thanks guys
08-28-2008 01:52
Thanks Deanna,
I hear what your saying but when I change my av from min to max height it always works with me with my 'fixed' extra offsets on the x and z axis (0.27 & 0.3 I think) - so I guess my question is "is there a formula which takes into account the avatar measurents that I can use to determine these 'additional' offsets for any specific avatar"? I use the pelvis as it is (I believe) the most stable point and depending on ani used, not subject to twisting when camera moves around.
I have seen attachments in world that do this setting exactly but no one is willing to assist me other than ask for large sums of money (which I don't have)