Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Accuracy of llSetPos()

Selador Cellardoor
Registered User
Join date: 16 Nov 2003
Posts: 3,082
01-23-2006 05:10
I have recently completed an elevator script, and I am trying to get the elevator to stop relative to the floor level.

I have been using llSetPos() to do this, but I have found that each time the elevator stops, it does so in a slightly different position.

The final command in the script, after turning off physics, is llSetPos(), the last part of the vector being 747.40. The elevator tends to overshoot, and the final position of the parent prim can be as much as 747.82. I wondered if this was due to the previous velocity, and so I put in a delay of half a second before calling llSetPos(), but it doesn't seem to make any difference.

I was just wondering whether this is something that can be sorted out, or whether a degree of inaccuracy is to be expected.
_____________________
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
01-23-2006 06:40
From: Selador Cellardoor
The final command in the script, after turning off physics, is llSetPos(), the last part of the vector being 747.40. The elevator tends to overshoot, and the final position of the parent prim can be as much as 747.82. I wondered if this was due to the previous velocity, and so I put in a delay of half a second before calling llSetPos(), but it doesn't seem to make any difference.
The object's position is not the parent axis but the navel of whole linked objects, is it?
_____________________
:) Seagel Neville :)
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
01-23-2006 07:18
From: Seagel Neville
The object's position is not the parent axis but the navel of whole linked objects, is it?

That depends on where the script is located. I believe llSetPos uses the position of the parent prim.

As for this problem... are you 100% positive that youre storing and using the correct vector? Are you recalculating the destination position anywhere in your script after you store it?
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Selador Cellardoor
Registered User
Join date: 16 Nov 2003
Posts: 3,082
01-23-2006 07:25
Christopher,

I am using literals for the vector.
_____________________
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
01-23-2006 07:28
Does using llSetPrimitiveParams([PRIM_POSITION, ...]) affect the results? If I remember correctly, llSetPos has very recently been able to move to positions higher then 512m - it may be a bug related to that.
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Selador Cellardoor
Registered User
Join date: 16 Nov 2003
Posts: 3,082
01-23-2006 07:30
Here is the last part of this bit of the program:-


llSetStatus(STATUS_PHYSICS,FALSE);
moving=FALSE;
llSetPos(<157.933,113.704,747.40>;);
llPlaySound("electric garage door",1.0);
llSay(1,"open";);
}//end of moving=FALSE
}//end of message = "up"
_____________________
Selador Cellardoor
Registered User
Join date: 16 Nov 2003
Posts: 3,082
01-23-2006 07:30
From: Christopher Omega
Does using llSetPrimitiveParams([PRIM_POSITION, ...]) affect the results? If I remember correctly, llSetPos has very recently been able to move to positions higher then 512m - it may be a bug related to that.
==Chris


Haven't tried that yet. I'll give it a whirl, though.
_____________________