How do I get the position of a prim attached to an avatar?
|
|
Betty66 Ling
Coke refill!
Join date: 27 May 2007
Posts: 2
|
09-22-2008 07:44
Hiya  We have a prim that is supposed to "drip" - it rezzes prim "drops" that then fall. works great until we attach it to an avatar. then the drops appear at the avatar's position instead of the position of the attached drop generator. The generator is even in a child prim in a link set. llRezObject("drop",llGetPos()+<0,0,0>,ZERO_VECTOR,llGetRot(),1); Can someone please help us out?
|
|
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
|
09-22-2008 08:08
edit: removed as i was wrong 
|
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
09-22-2008 08:09
IIRC, attachments can't know where they actually are because animations are played by the client and appear differently on every viewer's client.
So the only thing you can do is to add an offset to have your objects being rezzed (vaguely) in the direction of where the attachment is thanks to llGetRootPosition() and llGetRootRotation() which give you the position of the avatar... when called from the root of the attachment.
And using an offset of <0, 0, 0> is a total waste. Anything plus zero equals the same thing, so there's no need to do the operation in the first place.
|
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
09-22-2008 09:20
I think animations must be synchronized somehow between clients, otherwise how would multi-avatar animations (like couples dancing) work?
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
09-22-2008 09:27
From: Pedro McMillan I think animations must be synchronized somehow between clients, otherwise how would multi-avatar animations (like couples dancing) work? because it sync's them up when the second avatar "sits" and periodically checks if it needs to sync them again
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
09-22-2008 18:06
This is why "dripping" attachments all use particles.
You could also use a flexi, with a dripping texture.
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
09-23-2008 01:35
I hop on this thread as this is a problem I have as well...
So - from what I read here - it's actually impossible to determine the position and rotation of an object when it's attached? Meaning, rezing an object exactly at the same position and rotation like the one that's attached to the agent won't work? (What a bummer!)...
|
|
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
|
09-23-2008 02:04
Unless you edit the viewer itself to communicate with your scripts, it's not going to happen. :<
|
|
Solomon Devoix
Used Register
Join date: 22 Aug 2006
Posts: 496
|
09-23-2008 08:07
From: Haruki Watanabe I hop on this thread as this is a problem I have as well...
So - from what I read here - it's actually impossible to determine the position and rotation of an object when it's attached? Meaning, rezing an object exactly at the same position and rotation like the one that's attached to the agent won't work? (What a bummer!)... Pretty much, yeah. I ran into this almost 2 years ago with one of the first things I tried to build. What a royal pain...
_____________________
From: Jake Black I dont know what the actual answer is.. I just know LLs response was at best...flaccid. From: Solomon Devoix That's a very good way to put it, and now I know why we still haven't seen the promised blog entry...
...the Lindens are still waiting for their shipment of Lie-agra to come in to firm up their flaccid reasoning.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
09-23-2008 23:52
to expand on Kaluura's explanation, the only thing that the server tracks on an av is it's base position and the facing... everything else is a reference from those figures done locally by each client... and if the server doesn't track it, neither can lsl.
from those 2 figures the client extrapolates the position and distance of your arms for instance, based on a one time download of the avs shape numbers, and then applies to that the currently running animation....
for the server to calculate the position of your arm (and whatever attachment) it would have to actively calculate and store all that additional information, and transmit it all... which is a huge amount of processing, memory and bandwidth to consume for EACH av... and that's why it's not done, or available
the reason particles work for this is because they are also local effects, so your client knows where to place them because it had to place the source on screen (using a different method than the world placement)
hope that made sense =)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
09-24-2008 06:08
You can't get the position, but you can "force" it - by running a known animation yourself (which affects all limbs), and then getting the world offset of the avatar's limb in that animation, either by calculating it from the avatar bounding box or asking the user to align it manually once and then saving the resulting offset. But it's not ideal at all  But you're right - the server has no idea about animations. Client animations are done just by sending the start commands at the same time so that they seem, as it happens, to synchronize on the client.
|
|
Betty66 Ling
Coke refill!
Join date: 27 May 2007
Posts: 2
|
03-08-2009 21:10
Thanks for the replies everyone!
_____________________
べっち
|