MantisBT - opensim
View Issue Details
0007510opensim[REGION] Script Functionspublic2015-03-22 00:262015-04-07 23:23
Magnuz 
 
normalminoralways
patch includedopen 
Intel Core i7Ubuntu12.04
master (dev code) 
 
0.8.2
Grid (1 Region per Sim)
BulletSim
Mono / Linux32
2.10
Firestorm 4.4.2 for OS X
0007510: Constants scattered in LSL_Api
There are quite a few constants scattered throughout the LSL_Api. According to Robert Adams it would be better if at least some of them were parameterized. This is a first crack at that, starting with the 63 sleep constants, since they were the easiest to inventory. If there is any interest in continued work on this, I need pointers on documentation, directives or preferrably examples on naming, placing and use of parameters for e.g. limits and clipping.

Added: 69 constants used for limits and clamping have also been parameterized and added to config.
No tags attached.
patch 0001-Parameterize-sleeps-in-LSL-functions.patch (26,956) 2015-03-22 05:48
http://opensimulator.org/mantis/file_download.php?file_id=4148&type=bug
patch 0001-Add-LSL-function-sleep-parameters-to-config.patch (10,963) 2015-03-22 12:02
http://opensimulator.org/mantis/file_download.php?file_id=4149&type=bug
patch 0001-Parameterize-constants-in-LSL_Api-and-make-conf.patch (57,190) 2015-03-23 14:18
http://opensimulator.org/mantis/file_download.php?file_id=4150&type=bug
patch 0001-Use-Util.Clamp-in-LSL_Api.patch (22,714) 2015-03-24 10:40
http://opensimulator.org/mantis/file_download.php?file_id=4151&type=bug
patch 0001-Parameterize-more-constants-in-LSL_Api-and-make-conf.patch (14,885) 2015-04-06 15:08
http://opensimulator.org/mantis/file_download.php?file_id=4156&type=bug
Issue History
2015-03-22 00:26MagnuzNew Issue
2015-03-22 00:26MagnuzFile Added: 0001-Parameterize-sleeps-in-LSL-functions.patch
2015-03-22 00:27MagnuzNote Added: 0027930
2015-03-22 00:27MagnuzStatusnew => patch included
2015-03-22 05:14MagnuzFile Added: 0002-Parameterize-sleeps-in-LSL-functions.patch
2015-03-22 05:15MagnuzFile Deleted: 0001-Parameterize-sleeps-in-LSL-functions.patch
2015-03-22 05:48MagnuzFile Added: 0001-Parameterize-sleeps-in-LSL-functions.patch
2015-03-22 05:49MagnuzFile Deleted: 0002-Parameterize-sleeps-in-LSL-functions.patch
2015-03-22 10:30Robert AdamsNote Added: 0027937
2015-03-22 12:02MagnuzFile Added: 0001-Add-LSL-function-sleep-parameters-to-config.patch
2015-03-22 12:08MagnuzNote Added: 0027938
2015-03-23 14:18MagnuzFile Added: 0001-Parameterize-constants-in-LSL_Api-and-make-conf.patch
2015-03-23 14:20MagnuzNote Added: 0027939
2015-03-23 14:24MagnuzSummarySleep constants scattered in LSL_Api => Constants scattered in LSL_Api
2015-03-23 14:24MagnuzDescription Updatedbug_revision_view_page.php?rev_id=3967#r3967
2015-03-24 10:40MagnuzFile Added: 0001-Use-Util.Clamp-in-LSL_Api.patch
2015-03-24 10:47MagnuzNote Added: 0027941
2015-03-25 11:11MagnuzFile Added: 0001-Parameterize-more-constants-in-LSL_Api-and-make-conf.patch
2015-03-25 11:17MagnuzNote Added: 0027942
2015-04-06 15:08MagnuzFile Deleted: 0001-Parameterize-more-constants-in-LSL_Api-and-make-conf.patch
2015-04-06 15:08MagnuzFile Added: 0001-Parameterize-more-constants-in-LSL_Api-and-make-conf.patch
2015-04-07 23:23MagnuzNote Added: 0027987

Notes
(0027930)
Magnuz   
2015-03-22 00:27   
Patch parameterizes all sleep constants in LSL_Api.
(0027937)
Robert Adams   
2015-03-22 10:30   
Patch applied to master on 20150322.
(0027938)
Magnuz   
2015-03-22 12:08   
Second patch (0001-Add-LSL-function-sleep-parameters-to-config.patch) adds the sleep parameters to configuration and reads them from there. Please check so I understood Robert Adams' instructions in Mantis 7509 right since I'm still noob at this.
(0027939)
Magnuz   
2015-03-23 14:20   
Third patch (0001-Parameterize-constants-in-LSL_Api-and-make-conf.patch) parameterizes and adds relevant constants in LSL_Api to configuration, reading them from there.
(0027941)
Magnuz   
2015-03-24 10:47   
Fourth patch (0001-Use-Util.Clamp-in-LSL_Api.patch) replaces a bit awkward clamping with a more elegant clamping function, and fixes the type of several limit parameters.

Parameters stored in vectors are doubles, while those stored in scalars are floats, something the previous clamping handled gracefully, but not the clamping function, hence the changing of many types.

This patch hasn't really got with the constants to do, but depends on the previous patches and tidies up the code some (8 lines of comparisons are replaced by a 1 line function call).
(0027942)
Magnuz   
2015-03-25 11:17   
Fifth patch (0001-Parameterize-more-constants-in-LSL_Api-and-make-conf.patch) parametrizes and adds more constants in LSL_Api to configuration, reading them from there. This is hopefully the last major part in parameterizing the constants in LSL_Api, even if some tidying up after it might be needed.
(0027987)
Magnuz   
2015-04-07 23:23   
I discovered a malformed parameter value in OpenSimDefaults.ini (a trailing " ***" flag left by mistake) passed the test suite despite it prevented XEngine from running live. I updated the patch for it, but it might be an idea to add a regression test for it.