Jump to content

This doesn't make sense to me - but perhaps it does to you


Phil Deakins
 Share

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

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

Recommended Posts

I'm writing a root prim script in which moves a child prim. Things weren't working as I thought they should, so I did the following test:-

The root script got the PRIM_POS_LOCAL of the child prim, so the child's position is with respect to the root, an d immediately set the child prim to that PRIM_POS_LOCAL.

To my way of thinking, the child prim shouldn't move, but not only does it move to the opposite side of the root prim, but it also sinks 0.18 into the floor.

Why would the child prim's position change so drastically when setting it's position to the exact vector value that the script has just obtained as its position? I'm flummoxed.

Link to comment
Share on other sites

I can not read your script snipet so have a guess. The local is relative to the root, so going by what you wrote seems the root prim is rotated, also the local needs to set with

llSetLinkPrimitiveParams

 this should work.

llSetLinkPrimitiveParamsFast(child_prim_linknum,[PRIM_POS_LOCAL,<x,y,z>]);

 

Link to comment
Share on other sites


steph Arnott wrote:

I can not read your script snipet so have a guess. The local is relative to the root, so going by what you wrote seems the root prim is rotated, also the local needs to set with
llSetLinkPrimitiveParams

 this should work.
llSetLinkPrimitiveParamsFast(child_prim_linknum,[PRIM_POS_LOCAL,<x,y,z>]);

 

Well,

llSetLinkPrimitiveParamsFast(child_prim_linknum,[PRIM_POS_LOCAL,<x,y,z>*llGetRot()])

After all, as you pointed out, correctly, Phil forgot to take rotation of the root prim into account.:smileywink:

EDIT: I'd say Ooops quietly and delete my post, but that would be intellectually dishonest.  I screwed up.  :smileyembarrassed:

Link to comment
Share on other sites

If I do this:

vector lPos;integer S;default {    touch_start(integer total_number) {        if (S = !S) {            lPos = llList2Vector(llGetLinkPrimitiveParams(2, [PRIM_POS_LOCAL]), 0);            llOwnerSay("POS_lOCAL vector = " + (string)lPos);        }        else {            llSetLinkPrimitiveParams(2, [PRIM_POS_LOCAL, lPos]);            llOwnerSay("POS_LOCAL set");        }    }}

the child prim does not move, no matter what rotation the object has.. 

So you must be doing something wrong.

Link to comment
Share on other sites

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