diff options
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 48 | ||||
-rw-r--r-- | bin/Robust.HG.ini.example | 2 |
2 files changed, 28 insertions, 22 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index dbea6ef..417cef4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -465,22 +465,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
465 | 465 | ||
466 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke | 466 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke |
467 | 467 | ||
468 | // Utility function for llRot2Euler | 468 | // Old implementation of llRot2Euler. Normalization not required as Atan2 function will |
469 | 469 | // only return values >= -PI (-180 degrees) and <= PI (180 degrees). | |
470 | // normalize an angle between -PI and PI (-180 to +180 degrees) | ||
471 | protected double NormalizeAngle(double angle) | ||
472 | { | ||
473 | if (angle > -Math.PI && angle < Math.PI) | ||
474 | return angle; | ||
475 | |||
476 | int numPis = (int)(Math.PI / angle); | ||
477 | double remainder = angle - Math.PI * numPis; | ||
478 | if (numPis % 2 == 1) | ||
479 | return Math.PI - angle; | ||
480 | return remainder; | ||
481 | } | ||
482 | |||
483 | // Old implementation of llRot2Euler, now normalized | ||
484 | 470 | ||
485 | public LSL_Vector llRot2Euler(LSL_Rotation r) | 471 | public LSL_Vector llRot2Euler(LSL_Rotation r) |
486 | { | 472 | { |
@@ -492,13 +478,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
492 | double n = 2 * (r.y * r.s + r.x * r.z); | 478 | double n = 2 * (r.y * r.s + r.x * r.z); |
493 | double p = m * m - n * n; | 479 | double p = m * m - n * n; |
494 | if (p > 0) | 480 | if (p > 0) |
495 | return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))), | 481 | return new LSL_Vector(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)), |
496 | NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), | 482 | Math.Atan2(n, Math.Sqrt(p)), |
497 | NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); | 483 | Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))); |
498 | else if (n > 0) | 484 | else if (n > 0) |
499 | return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); | 485 | return new LSL_Vector(0.0, Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); |
500 | else | 486 | else |
501 | return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); | 487 | return new LSL_Vector(0.0, -Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); |
502 | } | 488 | } |
503 | 489 | ||
504 | /* From wiki: | 490 | /* From wiki: |
@@ -5873,6 +5859,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5873 | PSYS_PART_MAX_AGE = 7, | 5859 | PSYS_PART_MAX_AGE = 7, |
5874 | PSYS_SRC_ACCEL = 8, | 5860 | PSYS_SRC_ACCEL = 8, |
5875 | PSYS_SRC_PATTERN = 9, | 5861 | PSYS_SRC_PATTERN = 9, |
5862 | PSYS_SRC_INNERANGLE = 10, | ||
5863 | PSYS_SRC_OUTERANGLE = 11, | ||
5876 | PSYS_SRC_TEXTURE = 12, | 5864 | PSYS_SRC_TEXTURE = 12, |
5877 | PSYS_SRC_BURST_RATE = 13, | 5865 | PSYS_SRC_BURST_RATE = 13, |
5878 | PSYS_SRC_BURST_PART_COUNT = 15, | 5866 | PSYS_SRC_BURST_PART_COUNT = 15, |
@@ -6005,6 +5993,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6005 | prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; | 5993 | prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; |
6006 | break; | 5994 | break; |
6007 | 5995 | ||
5996 | // PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The | ||
5997 | // PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The | ||
5998 | // client tells the difference between the two by looking at the 0x02 bit in | ||
5999 | // the PartFlags variable. | ||
6000 | case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE: | ||
6001 | tempf = (float)rules.GetLSLFloatItem(i + 1); | ||
6002 | prules.InnerAngle = (float)tempf; | ||
6003 | prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off. | ||
6004 | break; | ||
6005 | |||
6006 | case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE: | ||
6007 | tempf = (float)rules.GetLSLFloatItem(i + 1); | ||
6008 | prules.OuterAngle = (float)tempf; | ||
6009 | prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off. | ||
6010 | break; | ||
6011 | |||
6008 | case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: | 6012 | case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: |
6009 | prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); | 6013 | prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); |
6010 | break; | 6014 | break; |
@@ -6061,11 +6065,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6061 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN: | 6065 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN: |
6062 | tempf = (float)rules.GetLSLFloatItem(i + 1); | 6066 | tempf = (float)rules.GetLSLFloatItem(i + 1); |
6063 | prules.InnerAngle = (float)tempf; | 6067 | prules.InnerAngle = (float)tempf; |
6068 | prules.PartFlags |= 0x02; // Set new angle format. | ||
6064 | break; | 6069 | break; |
6065 | 6070 | ||
6066 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END: | 6071 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END: |
6067 | tempf = (float)rules.GetLSLFloatItem(i + 1); | 6072 | tempf = (float)rules.GetLSLFloatItem(i + 1); |
6068 | prules.OuterAngle = (float)tempf; | 6073 | prules.OuterAngle = (float)tempf; |
6074 | prules.PartFlags |= 0x02; // Set new angle format. | ||
6069 | break; | 6075 | break; |
6070 | } | 6076 | } |
6071 | 6077 | ||
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 6b0029f..0cf9ab1 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example | |||
@@ -11,7 +11,7 @@ | |||
11 | ;; | 11 | ;; |
12 | 12 | ||
13 | [Startup] | 13 | [Startup] |
14 | ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" | 14 | ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" |
15 | 15 | ||
16 | ; * This is common for all services, it's the network setup for the entire | 16 | ; * This is common for all services, it's the network setup for the entire |
17 | ; * server instance, if none if specified above | 17 | ; * server instance, if none if specified above |