Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Spot the difference :) llSetPrimitiveParams question

Dominus Skye
Bug Magnet
Join date: 31 Oct 2004
Posts: 54
08-10-2007 06:08
Hi everyone,

Trying to move and rotate simultaneously a child prim in a linked set. Using llSetLocalRot() and llSetPos(llGetLocalPos()+offset) works fine in a 2 step implementation. However attempting to perform the same with llSetPrimitiveParams is performing odd rotations.

Working Code:

vector offsetx = <0,0.5,0>;
rotation z_10;

default
{
state_entry()
{
z_10=llEuler2Rot(<10*DEG_TO_RAD,0,0>;);
}

touch_start(integer n)
{
llSetLocalRot(llGetLocalRot()*z_10);
llSetPos(llGetLocalPos()+offsetx);
}
}



Not Working Code :)

vector offsetx = <0,0.5,0>;
rotation z_10;

default
{
state_entry()
{
z_10=llEuler2Rot(<10*DEG_TO_RAD,0,0>;);
}

touch_start(integer n)
{
llSetPrimitiveParams([PRIM_ROTATION,llGetLocalRot()*z_10,PRIM_POSITION,llGetLocalPos()+offsetx]);
}
}


Could someone point me in the right direction here? The (old) LSL wiki states under llSetLocalRot() that:

"Q: How do I perform this with llSetPrimitiveParams on a child of an attached prim?
A: You need to know the local rotation of the root prim of the the attachment and divide your target rotation by the root's local rotation."

Could I get a practical example please?

Thanks as always!
Dominus
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
08-10-2007 06:30
Unfortunately, this is the reason you need to use the localpos and rot commands.

You might be able to do it with llSetLinkPrimitiveParams(LINK_THIS,[]); instead, but I haven't used this much myself.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
08-10-2007 09:02
The problem is that PRIM_ROTATION is broken in child prims: http://jira.secondlife.com/browse/SVC-93
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
08-10-2007 10:43
From: Lex Neva
The problem is that PRIM_ROTATION is broken in child prims: http://jira.secondlife.com/browse/SVC-93


So I'm assuming that would apply to LinkPrimitiveParams as well then? As I said I've never messed with it much since it only works on the standard link flags and has the 0.2s forced delay.

If I could put a list of link #'s, I'd probably use it all the time though.

Basically the problem I know of with llSetPrimitiveParams on a child prim is it will only work properly if the root prim is rotated to 0,0,0
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
08-11-2007 08:15
From: Tiarnalalon Sismondi
So I'm assuming that would apply to LinkPrimitiveParams as well then?


Yup, and even llSetRot() in a child prim is broken.

From: someone

Basically the problem I know of with llSetPrimitiveParams on a child prim is it will only work properly if the root prim is rotated to 0,0,0


Right, that's one way of interpreting the underlying bug... at (0,0,0) rotation, the underlying bug won't show up.