Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008353opensim[REGION] Script Functionspublic2018-08-09 20:582018-08-10 18:17
Reporterrealtime 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOpenSim serverOSFreeBSDOS Version11.2
Product Version0.9.0.1 
Target VersionFixed in Version 
Summary0008353: Incorrect handling of radiusoffset in setprimitiveshapeparams
DescriptionOpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs around line 8537, this block of code is incorrect:

            // limits on radiusoffset depend on revolutions and hole size (how?) seems like the maximum range is 0 to 1
            if (radiusoffset < 0f)
            {
                radiusoffset = 0f;
            }
            if (radiusoffset > 1f)
            {
                radiusoffset = 1f;
            }
            tempFloat = 100.0f * radiusoffset;
            shapeBlock.PathRadiusOffset = (sbyte)tempFloat;

Actual behaviour should be to limit the radiusoffset to the range 0 to taper.y. The radiusoffset must be zero or negative if taper.y is negative, and zero or positive if taper.y is positive.
Steps To Reproduce1. create a prim
2. add the following script:

default
{
    state_entry()
    {
        list p = [9, 4, 0, <0,1,0>, 0.0, <0,0,0>, <.5,.5,0>, <0,0,0>, <0,1,0>, <-1,-1,0>, 1.0, -0.7, 0.0];
        llSetLinkPrimitiveParamsFast(0, p);
    }
}

3. allow the script to run
4. edit the prim and look at the object parameters - Radius is zero
5. manually adjusting the radius will show it can only be set to negative values
6. manually changing taper y to be closer to zero than radius will show that radius is automatically updated to be equal to taper y to keep it in range
Additional Informationsuggested replacement code:

if (taper_a.y < 0f)
{
  if (radiusoffset < taper_a.y)
  {
    radiusoffset = taper_a.y;
  }
  if (radiusoffset > 0f)
  {
    radiusoffset = 0f;
  }
}
else
{
  if (radiusoffset > taper_a.y)
  {
    radiusoffset = taper_a.y;
  }
  if (radiusoffset < 0f)
  {
    radiusoffset = 0f;
  }
}
TagsllSetPrimitiveParams, scripting
Git Revision or version number0.9.0.1 binary release
Run Mode Grid (Multiple Regions per Sim)
Physics EngineubODE
EnvironmentMono / Linux64
Mono Version5.x
ViewerFirestorm 5.1.7
Attached Files

- Relationships

-  Notes
(0032852)
realtime (reporter)
2018-08-10 18:17

On further experimentation, I have encountered a prim where the taper.y is positive, but the radius offset is negative, so my suggested code fix is not correct. Might be easiest to just let the parameter range from -1.0 to 1.0 and it seems it will get clamped to the correct range somewhere else in the simulator code.

- Issue History
Date Modified Username Field Change
2018-08-09 20:58 realtime New Issue
2018-08-09 21:01 realtime Tag Attached: llSetPrimitiveParams
2018-08-09 21:01 realtime Tag Attached: scripting
2018-08-10 18:17 realtime Note Added: 0032852


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker