Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

vector odity with llSetLinkPrimitiveParams

Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
06-12-2008 08:16
This one eludes me..
I have a two obj linked Prim. The child moves from one pos to another -alt least it tells me that it moves -It actuallay does not move at all..

In a timer in root i have
{
pos=llGetPos();//tested llGetLocalPos() ..no...
pos=pos+<0,3,0>;
llSetLinkPrimitiveParams(id, [PRIM_POSITION, pos] );
}
and then shift back
:
pos=pos+<0,0,0>;

The debug shows
obj: pos: <87.88179, 189.40472, 297.58188>
obj: pos: <87.88179, 192.40472, 297.58188>
obj: pos: <87.88179, 189.40472, 297.58188>

But NO movement
If i on the other hand does this:
llSetLinkPrimitiveParams(id, [PRIM_POSITION, <0,0,0>] );
and the shift
llSetLinkPrimitiveParams(id, [PRIM_POSITION, <0,3,0>] );
..Then the child DO move..
Why does that act this way?
tyia.
_____________________
BR ab
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-12-2008 09:50
First off, you DO want llGetLocalPos(), because the position you set with llSetPos() or llSetPrimitiveParams()/PRIM_POSITION is local (in the root prim's coordinate system) for a child prim. The code you show should move the prim once provided that pos+<0,3,0> is within 10m of the root prim's center. After that, it depends on whether you use llGetLocalPos() to set 'pos' again when you do the second move (in which case 'pos+<0,0,0>'--which is the same as just 'pos'--is not going to move it at all, and more than likely the next 'llGetLocalPos()+<0,3,0>' is going to be outside the 10m link distance and the move won't happen) or if 'pos' is a global variable whose value isn't changed until the next llSetPos()/llSetPrimitiveParams() (in which case the second move SHOULD be working).
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
06-13-2008 02:32
Q
provided that pos+<0,3,0> is within 10m of the root prim's center.
q
...ofcause :/ -i was so confused -if only an error would popup when the limit is broken..
Thanks Hewee!
_____________________
BR ab
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
06-13-2008 19:08
From: Abraxes Binder
Q
provided that pos+<0,3,0> is within 10m of the root prim's center.
q
...ofcause :/ -i was so confused -if only an error would popup when the limit is broken..
Thanks Hewee!


We would all be spammed to death if it did!
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
06-14-2008 02:29
Do you have the object selected when the script is running? I find the viewer still doesn't always like to show prim movements all the time if an object is selected
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)