secondlife / jira-archive

2 stars 0 forks source link

[BUG-1059] llCastRay() sees non-physical objects as physical after physics flag is unchecked. #902

Open sl-service-account opened 11 years ago

sl-service-account commented 11 years ago

Steps to Reproduce

Create a castray test object, titled "RNP", with RC_REJECT_TYPES,RC_REJECT_NONPHYSICAL.

Create another castray test object, titled "RP", with RC_REJECT_TYPES,RC_REJECT_PHYSICAL.

From the build menu, rez a wood box.

Have both RNP and RP hit it with castray. (Observe RNP does not return a hit and RP does.)

Turn physics ON then OFF for the wood box.

Have both RNP and RP hit it with castray. (Observe RNP returns a hit and RP does not.)

Expected Behavior

Objects that become non-physical should read as non-physical with llCastRay().

Other information

Check to see if this isn't causing problems elsewhere like the physics engine.

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-1059 | | Summary | llCastRay() sees non-physical objects as physical after physics flag is unchecked. | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Released | | Reporter | Lucia Nightfire (lucia.nightfire) | | Created at | 2012-12-11T19:01:21Z | | Updated at | 2018-11-27T20:13:29Z | ``` { 'Business Unit': ['Platform'], 'Date of First Response': '2012-12-11T14:00:14.104-0600', "Is there anything you'd like to add?": "Check to see if this isn't causing problems elsewhere.", 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'Create a castray test object, titled "RNP", with RC_REJECT_TYPES,RC_REJECT_NONPHYSICAL.\r\n\r\nCreate another castray test object, titled "RP", with RC_REJECT_TYPES,RC_REJECT_PHYSICAL.\r\n\r\nFrom the build menu, rez a wood box.\r\n\r\nHave both RNP and RP hit it with castray. (Observe RNP does not return a hit and RP does.)\r\n\r\nTurn physics ON then OFF for the wood box.\r\n\r\nHave both RNP and RP hit it with castray. (Observe RNP returns a hit and RP does not.)\r\n', 'What were you doing when it happened?': 'Objects that change become non-physical should read as non-physical with llCastRay().', 'What were you expecting to happen instead?': 'Objects that change become non-physical should read as non-physical with llCastRay().', } ```
sl-service-account commented 11 years ago

Maestro Linden commented at 2012-12-11T20:00:14Z

Thanks for the report, Lucia. I can reproduce this in Second Life Server 12.11.09.266804. Here are my scripts:

default
{
    state_entry()
    {
        llSetObjectName("RNP");
        llSay(0, "Touch me for castray");
    }

    touch_start(integer n)
    {
        vector pos = llGetPos();
        // fire downward
        list result = llCastRay(pos, <pos.x, pos.y, 0>, 
            [RC_REJECT_TYPES, RC_REJECT_NONPHYSICAL]);
        llSay(0,"llCastRay results: " + llList2CSV(result));    
     }

}
default
{

    state_entry()
    {
        llSetObjectName("RP");
        llSay(0, "Touch me for castray");
    }
    touch_start(integer n)
    {
        vector pos = llGetPos();
        // fire downward
        list result = llCastRay(pos, <pos.x, pos.y, 0>, 
            [RC_REJECT_TYPES, RC_REJECT_PHYSICAL]);
        llSay(0,"llCastRay results: " + llList2CSV(result));    
     }

}

I positioned the llCastRay() scripted objects above the test object, which was resting on the terrain. When either script 'misses' the object, it hits the ground below, which causes the function to report a hit id of NULL_KEY:

[11:50] RNP: Touch me for castray [11:50] RP: Touch me for castray [11:51] Mæstro: object is nonphysical now [11:51] RNP: llCastRay results: 00000000-0000-0000-0000-000000000000, <149.000000, 104.500000, 24.999996>, 1 [11:51] RP: llCastRay results: 699fc4a1-79aa-9046-3d12-20f6b693be35, <147.667358, 104.500000, 26.275579>, 1 [11:51] Mæstro: enabling physics in object... [11:51] RP: llCastRay results: 00000000-0000-0000-0000-000000000000, <147.667358, 104.500000, 24.999996>, 1 [11:51] RNP: llCastRay results: 699fc4a1-79aa-9046-3d12-20f6b693be35, <149.000000, 104.500000, 25.623802>, 1 [11:52] Mæstro: Okay, the results were reversed, as expected [11:53] Mæstro: disabling physics in object.. [11:53] RNP: llCastRay results: 699fc4a1-79aa-9046-3d12-20f6b693be35, <149.000000, 104.500000, 25.637524>, 1 [11:53] RP: llCastRay results: 00000000-0000-0000-0000-000000000000, <147.667358, 104.500000, 24.999996>, 1 [11:53] Mæstro: disabling physics in the object did not return the castray scripts to hit it as it originally did.. something's wrong The object is clearly non-physical in the last step (I can't push it at all), so the issue seems to be in the update of some 'is physical' flag that only (?) llCastRay() uses.