Jump to content

llGetPrimitiveParams position not always region anymore?


Guest
 Share

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

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

Recommended Posts

I call    llSay(0,"stem,"+(string)(llList2String(llGetPrimitiveParams([PRIM_POSITION]),0)));

in both an attachment's child prim on me, and a free-floating box pretty much next to it (minimized in size and phantom'ed)

My attachment: (located on spine, and placed on the upper back:

<61.085810, 60.700470, 32.626830>

The box

<61.045460, 60.567360, 33.088830>

From http://wiki.secondlife.com/wiki/LlGetPrimitiveParams

position is always in region coordinates, even if the prim is a child or the root prim of an attachment.

Which means they should be very very close, but the child prim is reporting my coordinates, not region.

 

Did this get stealth changed in and the wiki is now wrong?

Link to comment
Share on other sites

The Wiki article on llGetPos says 


When called from the root of an attachment, returns the wearer's region position. To see the position used, enable Develop>Avatar>Display Agent Target and use the red crosshair. If the avatar is sitting on an object, the red crosshair may be hidden by the white one, in the same position

When called in an attachment's child prim, the position given is again relative to the avatar's root position and rotation, but with the correct offset. Moving the attachment's root or changing the attachment point will not affect the reported position. Avatar animation is invisible to the simulator, so it also does not affect the reported position


That applies to llGetPrimitiveParams and similar, or always has done.  

I suspect that the apparent discrepancy is to do with whatever avatar animation is playing, because llGetPP and similar can't see that.    You might see the free-standing box and the child prim as being next to each other, but the sim almost certainly doesn't.

What are you trying to do?  There may be another way round it.   

 

Link to comment
Share on other sites

Looking at the two sets of coordinates you've supplied and the slight differences between them, I wonder if what you have got are accurate region coordinates, and that although you say the box is "pretty much next to it", you are of course getting the reported position of the centre of the box, and the attachment. If they were both 0.5 metre cubes, you would expect to see about 0.5 metres difference between thge two prim positions if they were adjacent and actually touching.

 

Have you checked your results in several different versions of the servers, such as Blue Steel and Le Tigre, as well and SecondLife mains server channels, to be sure you aren't seeing an anomaly in different servers?

 

ETA I just read Cerise's post and the updated wiki, which was added while I was typing, so what I wrote is a load of twaddle, please ignore.

Link to comment
Share on other sites

To draw a particle stream between an emitter and another object, all you need to know is the object's UUID.  Supply that to PSYS_SRC_TARGET_KEY and set PSYS_PART_TARGET_LINEAR_MASK and you're good to go.  No position information needed.

Attachment points have well-defined positions but those positions vary from one avatar to the next because we all modify our shapes.  And, of course, attachment points move in complex ways as we are animated.  In theory, I suppose in might be possible to calculate what those positions are for a particular av, given its shape settings and given detailed information from animations, but we have no way to do that with LSL.  We are simply given a blind reference to attachment points themselves.  Objects that are attached are positioned local to the attach point, not to the avatar's root position.  Their global position and angle are affected by the position and rotation of the avatar and the playing animations, and are not accessible by LSL functions.

EDIT:  I, too, was typing as Cerise was updating the wiki.  :smileyhappy:  Well said, Cerise.

Link to comment
Share on other sites


Windancer Farslider wrote:

It has to be possible. Things like llParticleSystem are able to draw between attachments on an avatar... so somewhere there is ability to get the positions of attachments. Perhaps there is no function/API to it, but internally, it exists.

Particles, like animations, are rendered client side by your CPU and GPU.   When it's drawing a line of particles between two attachments, or an attachment and a static object, your computer knows where it's drawing the emitter and the target, and knows where to draw the particles.   It also knows how it's moving you around when it plays the animation, and can move the particles accordingly.

The sim doesn't know anything about this, though.

Link to comment
Share on other sites

So in otherwords its working just like it should, just not like I want.      Well nuts.

Application wise, what I wanted to be able to do was to be able to guide an object, like a hose, from the world to connect to an attachment, like a re-fueling stem/port on the avatar. Its was just for show/nice effect without trying to use a particle hose.

Link to comment
Share on other sites

What you're talking about then could be done per-avatar with a variation on a Sit Setter (of which there are many free versions).  The person controlling the avatar would have to 'sit' on your refuelling-point and manually edit/adjust the hose so it fitted properly.  Then the co-ordinates are stored either by the avatar's attachment or the refueller for all avatars.

Whenever they re-visit the hose can use the stored animation(s) and settings to 'dock' perfectly.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3917 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...