Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007851opensim[REGION] Physics Enginespublic2016-03-19 19:142017-05-16 20:46
ReporterKayaker Magic 
Assigned Tokcozens 
PriorityhighSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformlinux/monoOSOpenSim Dev OSgridOS Version0.9.0.0
Product Versionmaster (dev code) 
Target VersionFixed in Versionmaster (dev code) 
Summary0007851: The ubODE version of llCastRay is measurably slower when pointing down
DescriptionThe ubODE version of llCastRay works very well (thank you!) and runs reasonably fast at some angles. When pointing up it typically takes less than 50ms and often quite a bit less. But even in a mostly empty SIM llCastRay takes twice as long when you are pointing down! Combine that with Mantis 0007850 and you sometimes see llCastRay taking 1300ms to return!
Steps To ReproducePut the following script in a prim. Click on it to start a test.
Notice that the first half of the results (while rising) are measurably faster than the second half of the results (falling). I did this test in several almost empty SIMs, starting above the ground so there was nothing for llCastRay to detect.
Additional Information        //llCastRay rise/fall
        //the first half of the results from this are rising,
        //while falling in the second half, llCastRay is slower
vector start; //place to go back to
vector vel; //velocity

default
{
    state_entry()
    {
        llSay(0, "Script running");
    }
    touch_start(integer num)
    {
        start=llGetPos(); //where to go back to
        vel=<0,0,30>; //jump up at 30m/s
        llSetTimerEvent(0.5); //re-calc as often as possible
    } //touch_start

    timer()
    {
        vector pos=llGetPos()+vel;
        if (pos.z<=start.z) //if it is about to fall below the start
        { //return to the start
            llSetKeyframedMotion([start-llGetPos(),ZERO_ROTATION,0.5],[KFM_COMMAND,KFM_CMD_PLAY]);
// llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION,start]);
            llSetTimerEvent(0.0); //stop the clock
            llOwnerSay("done "+(string)start);
            return;
        }
        float tim=llGetTime(); //measure the time in llCastRay
        list hits=llCastRay(llGetPos(),llGetPos()+vel,[RC_DETECT_PHANTOM,FALSE,RC_DATA_FLAGS,RC_GET_ROOT_KEY]);
        tim=llGetTime()-tim;
        llOwnerSay((string)tim);
        llSetKeyframedMotion([vel,ZERO_ROTATION,0.5],[KFM_COMMAND,KFM_CMD_PLAY]);
// llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION,pos]);
        vel = vel-<0,0,5>; //this is about 1/2g
    }
}
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineOther
EnvironmentMono / Linux64
Mono Version3.0
ViewerFireStorm
Attached Files

- Relationships

-  Notes
(0031249)
Kayaker Magic (reporter)
2016-11-05 16:02

At the last dev meeting, Ubit said he was unable to repeat this problem, so I ran my tests again in OSGrid. But first I went to OSGrid.org and started with the latest version: http://danbanner.onikenkon.com/osgrid/osgrid-opensim-10252016.v0.9.1.7c4f2b0.zip [^]
I installed this in two new directories and built a single 256x256 region in one, a 3x3 var in the other. In both OpenSim.ini files I made only 4 changes from the default:
I un-commented the line:
      meshing = ubODEMeshmerizer
I un-commented the line:
     physics = ubODE
I added the following line because Ubit was wondering if he forced this off or not:
     UseLlCastRayV3=false
I changed the port line to be different on the two regions (they are still up on OSGrid)
    http_listener_port = 9002 [9005 for the 3x3]
And of course I made two different Region.ini files for the two regions.

Both regions were completely empty but for my avatar, the prim with the test script, and the default pinhead island terrain. The two regions were each running their own instance of OpenSim.exe. This is all running on a single quad core server tower running OpenSuse Linux with Mono 3.0.4. (Nebanon suggested that Mono may be the reason that I am getting such bad numbers on this.)

The results were:

In a 256x256 region, llCastRay takes an average of 48ms when pointing up, 121ms when pointing down.
In a 3x3 var region, llCastRay takes an average of 93ms when pointing up, 727ms when pointing down.

727ms is not as bad as the 1300ms I reported before, but this is still pretty bad. When you point a gun at something and pull the trigger and wait and wait for the cast ray to finish...
(0031856)
Kayaker Magic (reporter)
2017-05-16 19:33

I just installed the latest version of OpenSim on my OSGrid regions.
commit c28430d52771ed6950e8482095a72ee8ef0c168d
I tested llCastRay on an 8x8 var, a 4x4 a 3x3 and a 1x1
I tested pointing up and pointing down, it was fast and I saw no difference between pointing up or down.
As far as I am concerned, this Mantis can be declared closed!
(0031857)
kcozens (administrator)
2017-05-16 20:46

Changing status of this report to closed based on the previous comment.

- Issue History
Date Modified Username Field Change
2016-03-19 19:14 Kayaker Magic New Issue
2016-11-05 16:02 Kayaker Magic Note Added: 0031249
2017-05-16 19:33 Kayaker Magic Note Added: 0031856
2017-05-16 20:46 kcozens Note Added: 0031857
2017-05-16 20:46 kcozens Status new => closed
2017-05-16 20:46 kcozens Assigned To => kcozens
2017-05-16 20:46 kcozens Resolution open => fixed
2017-05-16 20:46 kcozens Fixed in Version => master (dev code)


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker