diff --git a/BUILDING.md b/BUILDING.md index 95c13b6f6a..6bd04bc441 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,11 +1,11 @@ # Building on Windows Steps: - * runprebuild.bat - * Load OpenSim.sln into Visual Studio .NET and build the solution. - * chdir bin - * copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include - * run OpenSim.exe +* runprebuild.bat +* Load OpenSim.sln into Visual Studio .NET and build the solution. +* chdir bin +* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include +* run OpenSim.exe # Building on Linux / Mac @@ -16,17 +16,17 @@ Prereqs: * See http://opensimulator.org/wiki/Dependencies for more information. From the distribution type: - * ./runprebuild.sh - * type msbuild or xbuild - * cd bin - * copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include - * review and change those ini files according to your needs - * windows: execute opensim.exe or opensim32.exe for small regions - * linux: run ./opensim.sh - * msbuild (xbuild) option switches - * clean: msbuild /target:clean - * debug: (default) msbuild /property:Configuration=Debug - * release: msbuild /property:Configuration=Release +* ./runprebuild.sh +* type msbuild or xbuild +* cd bin +* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include +* review and change those ini files according to your needs +* windows: execute opensim.exe or opensim32.exe for small regions +* linux: run ./opensim.sh +* msbuild (xbuild) option switches + * clean: msbuild /target:clean + * debug: (default) msbuild /property:Configuration=Debug + * release: msbuild /property:Configuration=Release # References diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index f0177db4dd..7b56b90401 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -5305,5 +5305,103 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ((string)src).Replace(oldvalue, newvalue); } + + public LSL_Integer osApproxEquals(LSL_Float a, LSL_Float b) + { + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + return 1; + } + + public LSL_Integer osApproxEquals(LSL_Float a, LSL_Float b, LSL_Float margin) + { + double e = Math.Abs(margin); + if (a > b + e || a < b - e) + return 0; + return 1; + } + + public LSL_Integer osApproxEquals(LSL_Vector va, LSL_Vector vb) + { + double a = va.x; + double b = vb.x; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + a = va.y; + b = vb.y; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + a = va.z; + b = vb.z; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + + return 1; + } + + public LSL_Integer osApproxEquals(LSL_Vector va, LSL_Vector vb, LSL_Float margin) + { + double e = Math.Abs(margin); + double a = va.x; + double b = vb.x; + if (a > b + e || a < b - e) + return 0; + a = va.y; + b = vb.y; + if (a > b + e || a < b - e) + return 0; + a = va.z; + b = vb.z; + if (a > b + e || a < b - e) + return 0; + + return 1; + } + + public LSL_Integer osApproxEquals(LSL_Rotation ra, LSL_Rotation rb) + { + double a = ra.x; + double b = rb.x; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + a = ra.y; + b = rb.y; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + a = ra.z; + b = rb.z; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + a = ra.s; + b = rb.s; + if (a > b + 1.0e-6 || a < b - 1.0e-6) + return 0; + + return 1; + } + + public LSL_Integer osApproxEquals(LSL_Rotation ra, LSL_Rotation rb, LSL_Float margin) + { + double e = Math.Abs(margin); + double a = ra.x; + double b = rb.x; + if (a > b + e || a < b - e) + return 0; + a = ra.y; + b = rb.y; + if (a > b + e || a < b - e) + return 0; + a = ra.z; + b = rb.z; + if (a > b + e || a < b - e) + return 0; + a = ra.s; + b = rb.s; + if (a > b + e || a < b - e) + return 0; + + return 1; + } + } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 2ab1fff8e4..5bb76709df 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -540,5 +540,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Integer osStringLastIndexOf(LSL_String src, LSL_String value, LSL_Integer start, LSL_Integer count, LSL_Integer ignorecase); LSL_String osStringRemove(LSL_String src, LSL_Integer start, LSL_Integer count); LSL_String osStringReplace(LSL_String src, LSL_String oldvalue, LSL_String newvalue); + + LSL_Integer osApproxEquals(LSL_Float a, LSL_Float b); + LSL_Integer osApproxEquals(LSL_Float a, LSL_Float b, LSL_Float margin); + LSL_Integer osApproxEquals(vector va, vector vb); + LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin); + LSL_Integer osApproxEquals(rotation ra, rotation rb); + LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 1c003a0899..29ada83935 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1337,5 +1337,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osStringReplace(src, oldvalue, newvalue); } + + public LSL_Integer osApproxEquals(LSL_Float a, LSL_Float b) + { + return m_OSSL_Functions.osApproxEquals(a, b); + } + + public LSL_Integer osApproxEquals(LSL_Float a, LSL_Float b, LSL_Float margin) + { + return m_OSSL_Functions.osApproxEquals(a, b, margin); + } + + public LSL_Integer osApproxEquals(vector va, vector vb) + { + return m_OSSL_Functions.osApproxEquals(va, vb); + } + + public LSL_Integer osApproxEquals(vector va, vector vb, LSL_Float margin) + { + return m_OSSL_Functions.osApproxEquals(va, vb, margin); + } + + public LSL_Integer osApproxEquals(rotation ra, rotation rb) + { + return m_OSSL_Functions.osApproxEquals(ra, rb); + } + + public LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin) + { + return m_OSSL_Functions.osApproxEquals(ra, rb, margin); + } } } diff --git a/README.md b/README.md index f4a2f1be16..5b16998bce 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Now see the "Configuring OpenSim" section # Running OpenSim on Linux -You will need Mono >= 2.10.8.1 upt to version 0.9.0.1 and mono > 5.0 on others. On some Linux distributions you +You will need Mono >= 2.10.8.1 up to version 0.9.0.1 and mono > 5.0 on others. On some Linux distributions you may need to install additional packages. See http://opensimulator.org/wiki/Dependencies for more information. diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 77c49c2339..b3e03c1cb4 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -1,4 +1,4 @@ -9e55237f-19be-984f-6bdc-a8fd07eb2447 +0acc12d6-3dc9-9574-7bd6-d298c045f046 llsd-lsl-syntax-version2 controls @@ -6058,6 +6058,57 @@ btypevector + osApproxEquals + + returninteger + arguments + vatypevector + vbtypevector + margintypefloat + + + osApproxEquals + + returninteger + arguments + vatypevector + vbtypevector + + + osApproxEquals + + returninteger + arguments + atypefloat + btypefloat + margintypefloat + + + osApproxEquals + + returninteger + arguments + atypefloat + btypefloat + + + osApproxEquals + + returninteger + arguments + ratyperotation + rbtyperotation + margintypefloat + + + osApproxEquals + + returninteger + arguments + ratyperotation + rbtyperotation + + osAvatarName2Key returnstring @@ -6795,13 +6846,13 @@ osRegionNotice arguments + agentIDtypekey msgtypestring osRegionNotice arguments - agentIDtypekey msgtypestring @@ -6810,6 +6861,7 @@ returninteger arguments secondstypefloat + msgtypestring osRegionRestart @@ -6817,7 +6869,6 @@ returninteger arguments secondstypefloat - msgtypestring osReplaceString @@ -7153,21 +7204,12 @@ arguments srctypestring valuetypestring + starttypeinteger + counttypeinteger ignorecasetypeinteger osStringIndexOf - - returninteger - arguments - srctypestring - valuetypestring - starttypeinteger - counttypeinteger - ignorecasetypeinteger - - - osStringLastIndexOf returninteger arguments @@ -7187,6 +7229,15 @@ ignorecasetypeinteger + osStringLastIndexOf + + returninteger + arguments + srctypestring + valuetypestring + ignorecasetypeinteger + + osStringRemove returnstring @@ -7249,7 +7300,6 @@ arguments agenttypestring - regionNametypestring positiontypevector lookattypevector @@ -7258,6 +7308,7 @@ arguments agenttypestring + regionNametypestring positiontypevector lookattypevector diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini index 4918d34768..fa33880e82 100644 --- a/bin/config-include/osslEnable.ini +++ b/bin/config-include/osslEnable.ini @@ -127,8 +127,8 @@ Allow_osDie = ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER ; ThreatLevel Moderate - Allow_osDropAttachment = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osDetectedCountry = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER + Allow_osDropAttachment = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osDropAttachmentAt = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osGetAgentCountry = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER Allow_osGetGridCustom = ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER @@ -228,6 +228,7 @@ ; available functions out of Threat level control (for reference only) ; Allow_osAdjustSoundVolume = true ; Allow_osAngleBetween = true +; Allow_osApproxEquals = true ; Allow_osCheckODE = true ; Allow_osClearInertia = true ; Allow_osCollisionSound = true