• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-4476
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: BETLOG Hax
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

llSetLinkPrimitiveParams(LINK_SET,[PRIM_ROTATION... yields twice the intended rotation on child prims

Created: 30/Jun/09 03:25 PM   Updated: 01/Jul/09 07:42 AM
Return to search
Component/s: Scripts
Affects Version/s: 1.26 Server
Fix Version/s: None

File Attachments: None
Image Attachments:

1. JIRA-llSetLinkPrimitiveParams(LINK_SET,[PRIM_ROTATION 01.jpg
(65 kB)
Environment:
Second Life 1.24.2 (123765) Jun 23 2009 03:32:30 (Automated Trunk Build)
Release Notes

Built with MSVC version 1400

You are at 132566.6, 243991.1, 25.6 in Tiahura Island located at sim8096.agni.lindenlab.com (216.82.37.163:13012)
Second Life Server 1.26.4.120562
Release Notes

CPU: Intel Core 2 Series Processor (2405 MHz)
Memory: 6143 MB
OS Version: Microsoft Windows Vista Service Pack 1 (Build 6001)
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce 8800 GT/PCI/SSE2
Windows Graphics Driver Version: 8.15.0011.8585
OpenGL Version: 3.0.0

libcurl Version: libcurl/7.16.4 OpenSSL/0.9.8j zlib/1.2.3
J2C Decoder Version: KDU
Audio Driver Version: FMOD version 3.740000
LLMozLib Version: [LLMediaImplLLMozLib] - 2.01.25031 (Mozilla GRE version 1.8.1.21_0000000000)
Packets Lost: 6/105190 (0.0%)
Issue Links:
Relates
 


 Description  « Hide
issue:
llSetLinkPrimitiveParams
when combined with
LINK_SET
and
PRIM_ROTATION
rotates the child prims twice the intended rotation

expected outcome:
llSetLinkPrimitiveParams(LINK_SET,[PRIM_ROTATION... will rotate the child prims the amount specified.

reproduction:
Drop the following script into a linkset of 3 prims
Let it self assemble
Follow the chat instructions regarding naming and cloning a test case for each of the 5 LINK_ constants
Touch each linkset to see its rotated form.

// BETLOG Hax
// Nomad Padar said "WTF is this doing..." so we tested it...and it was strange.
// UTC+10: 20090701 0633 [SLT: 20090630 1333]
list        gList = [
    "LINK_THIS"                 ,LINK_THIS
    ,"LINK_ROOT"                ,LINK_ROOT
    ,"LINK_SET"                 ,LINK_SET // THIS CONSTANT GIVES UNEXPECTED BUT PREDICTABLE RESULTS
    ,"LINK_ALL_OTHERS"          ,LINK_ALL_OTHERS
    ,"LINK_ALL_CHILDREN"        ,LINK_ALL_CHILDREN
];
integer gTog;
//----------------------------------
f_init()
{   if(llGetNumberOfPrims()!=3) return; //DON'T SIT ON ME - YOU NOOB :]
    if(llGetLinkNumber()>1)  llRemoveInventory(llGetScriptName());
    llSetLinkPrimitiveParams(LINK_SET,[
        PRIM_COLOR, 5, <0.0, 0.0, 0.5>, 1.0
        , PRIM_COLOR, 4, <0.5, 0.0, 0.0>, 1.0
        , PRIM_COLOR, 3, <0.0, 0.5, 0.0>, 1.0
        , PRIM_COLOR, 2, <1.0, 0.0, 0.0>, 1.0
        , PRIM_COLOR, 1, <0.0, 1.0, 0.0>, 1.0
        , PRIM_COLOR, 0, <0.0, 0.0, 1.0>, 1.0
        , PRIM_FULLBRIGHT, ALL_SIDES, 0
        , PRIM_FULLBRIGHT, 2, 1
        , PRIM_FULLBRIGHT, 1, 1
        , PRIM_FULLBRIGHT, 0, 1
        , PRIM_SIZE, <0.5, 0.5, 0.5>
        , PRIM_ROTATION, ZERO_ROTATION
    ]);
    llSetLinkPrimitiveParams(2,[
        PRIM_POSITION, <0.75, 0.75, 0.25>
    ]);        
    llSetLinkPrimitiveParams(3,[
        PRIM_POSITION, <-0.75, -0.75, -0.25>
    ]);        
    llSetScale(<1.0, 1.0, 1.0>);
    llSay(0, 
        "\n 1) Clone this linkset 5 times..."
        +"\n 2) Rename each root object as each of the following: "
        +"\n LINK_THIS"
        +"\n LINK_ROOT"
        +"\n LINK_SET"
        +"\n LINK_ALL_OTHERS"
        +"\n LINK_ALL_CHILDREN"
        +"\n Then touch each object to toggle the rotation, note that LINK_SET seems to double up on the child rotations."
    );    
}
//----------------------------------
default
{   on_rez(integer param) 
    {   
    }
    state_entry()
    {   f_init();
    }
    changed(integer change) 
    {   if(change & CHANGED_LINK)
            f_init();
    }
    touch_start(integer total_number)
    {   gTog=!gTog;
        integer i = llListFindList(gList, [llGetObjectName()]);
        if(-1<i && !(i&1))//is in list and is odd index
        {   if(gTog)
                llSay(0, "rotated.z 45"); 
            else
                llSay(0, "rotated.z 0");
            llSetText(llGetObjectName(), <1.0, 1.0, 1.0>, 1.0);        
            llSetLinkPrimitiveParams(
                llList2Integer(gList, i+1) 
                ,[PRIM_ROTATION, llEuler2Rot(<0.0, 0.0, 45.0>*gTog*DEG_TO_RAD)]
            );
        }
    }
}


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Zwagoth Klaar added a comment - 30/Jun/09 04:06 PM - edited
This appears to be intended behavior, even if it is not intuitive or what is expected. The root prim is rotated, that rotates all the child prims with it to the rotation, then it goes through each child prim and rotates them again from their newly rotated positions from the root prim rotation update.(No, I am sure I can not make this more confusing and complicated.)

I think the command your actually looking for is LINK_ROOT.

I'd expect this also happens with position, but have not tested that theory.


BETLOG Hax added a comment - 30/Jun/09 04:15 PM
LINK_ROOT does nothing in this case
You sure you understand what I'm getting at here? :]

Desired outcome is that if i set rotate.z=45 then the children should be at 45 to the root, which would then rotate to 45 to the world
leaving the children at 45+45=90 to the world... but still 45 relative to the root.
They dont do that, the child prims end up at 45+45+45=135 relative to the world and 45+45=90 relative to the root


BETLOG Hax added a comment - 30/Jun/09 07:12 PM
adding keyword: LINK_SET
Linking related/identical issue with hopefully clear script reproduction/visual example.

Lex Neva added a comment - 01/Jul/09 07:42 AM
Looking at this, the first thing I think of is SVC-93.