aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs36
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs17
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs27
3 files changed, 68 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index f638386..4ea283f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1620,8 +1620,24 @@ namespace OpenSim.Region.Framework.Scenes
1620 { 1620 {
1621 UUID assetID = UUID.Zero; 1621 UUID assetID = UUID.Zero;
1622 1622
1623 Vector3 inventoryStoredPosition = new Vector3
1624 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
1625 ? 250
1626 : objectGroup.AbsolutePosition.X)
1627 ,
1628 (objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
1629 ? 250
1630 : objectGroup.AbsolutePosition.X,
1631 objectGroup.AbsolutePosition.Z);
1632
1633 Vector3 originalPosition = objectGroup.AbsolutePosition;
1634
1635 objectGroup.AbsolutePosition = inventoryStoredPosition;
1636
1623 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); 1637 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
1624 1638
1639 objectGroup.AbsolutePosition = originalPosition;
1640
1625 // Get the user info of the item destination 1641 // Get the user info of the item destination
1626 // 1642 //
1627 UUID userID = UUID.Zero; 1643 UUID userID = UUID.Zero;
@@ -1683,6 +1699,8 @@ namespace OpenSim.Region.Framework.Scenes
1683 { 1699 {
1684 // Deleting someone else's item 1700 // Deleting someone else's item
1685 // 1701 //
1702
1703
1686 if (remoteClient == null || 1704 if (remoteClient == null ||
1687 objectGroup.OwnerID != remoteClient.AgentId) 1705 objectGroup.OwnerID != remoteClient.AgentId)
1688 { 1706 {
@@ -1857,8 +1875,24 @@ namespace OpenSim.Region.Framework.Scenes
1857 itemID = UUID.Zero; 1875 itemID = UUID.Zero;
1858 if (grp != null) 1876 if (grp != null)
1859 { 1877 {
1878 Vector3 inventoryStoredPosition = new Vector3
1879 (((grp.AbsolutePosition.X > (int)Constants.RegionSize)
1880 ? 250
1881 : grp.AbsolutePosition.X)
1882 ,
1883 (grp.AbsolutePosition.X > (int)Constants.RegionSize)
1884 ? 250
1885 : grp.AbsolutePosition.X,
1886 grp.AbsolutePosition.Z);
1887
1888 Vector3 originalPosition = grp.AbsolutePosition;
1889
1890 grp.AbsolutePosition = inventoryStoredPosition;
1891
1860 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); 1892 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
1861 1893
1894 grp.AbsolutePosition = originalPosition;
1895
1862 AssetBase asset = CreateAsset( 1896 AssetBase asset = CreateAsset(
1863 grp.GetPartName(grp.LocalId), 1897 grp.GetPartName(grp.LocalId),
1864 grp.GetPartDescription(grp.LocalId), 1898 grp.GetPartDescription(grp.LocalId),
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3b91dd0..d43a7e2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4256,7 +4256,24 @@ namespace OpenSim.Region.Framework.Scenes
4256 break; 4256 break;
4257 4257
4258 case 2: // Sell a copy 4258 case 2: // Sell a copy
4259
4260
4261 Vector3 inventoryStoredPosition = new Vector3
4262 (((group.AbsolutePosition.X > (int)Constants.RegionSize)
4263 ? 250
4264 : group.AbsolutePosition.X)
4265 ,
4266 (group.AbsolutePosition.X > (int)Constants.RegionSize)
4267 ? 250
4268 : group.AbsolutePosition.X,
4269 group.AbsolutePosition.Z);
4270
4271 Vector3 originalPosition = group.AbsolutePosition;
4272
4273 group.AbsolutePosition = inventoryStoredPosition;
4274
4259 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); 4275 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
4276 group.AbsolutePosition = originalPosition;
4260 4277
4261 uint perms=group.GetEffectivePermissions(); 4278 uint perms=group.GetEffectivePermissions();
4262 4279
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 16dd834..f261c16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -476,9 +476,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
476 // normalize an angle between -PI and PI (-180 to +180 degrees) 476 // normalize an angle between -PI and PI (-180 to +180 degrees)
477 protected double NormalizeAngle(double angle) 477 protected double NormalizeAngle(double angle)
478 { 478 {
479 angle = angle % (Math.PI * 2); 479 if (angle > -Math.PI && angle < Math.PI)
480 // if (angle < 0) angle = angle + Math.PI * 2; 480 return angle;
481 return angle; 481
482 int numPis = (int)(Math.PI / angle);
483 double remainder = angle - Math.PI * numPis;
484 if (numPis % 2 == 1)
485 return Math.PI - angle;
486 return remainder;
482 } 487 }
483 488
484 // Old implementation of llRot2Euler, now normalized 489 // Old implementation of llRot2Euler, now normalized
@@ -497,9 +502,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
497 NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), 502 NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))),
498 NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); 503 NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))));
499 else if (n > 0) 504 else if (n > 0)
500 return new LSL_Vector(0.0, Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); 505 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)));
501 else 506 else
502 return new LSL_Vector(0.0, -Math.PI / 2, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); 507 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)));
503 } 508 }
504 509
505 /* From wiki: 510 /* From wiki:
@@ -553,12 +558,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
553 558
554 double x,y,z,s; 559 double x,y,z,s;
555 560
556 double c1 = Math.Cos(v.x/2.0); 561 double c1 = Math.Cos(v.x * 0.5);
557 double c2 = Math.Cos(v.y/2.0); 562 double c2 = Math.Cos(v.y * 0.5);
558 double c3 = Math.Cos(v.z/2.0); 563 double c3 = Math.Cos(v.z * 0.5);
559 double s1 = Math.Sin(v.x/2.0); 564 double s1 = Math.Sin(v.x * 0.5);
560 double s2 = Math.Sin(v.y/2.0); 565 double s2 = Math.Sin(v.y * 0.5);
561 double s3 = Math.Sin(v.z/2.0); 566 double s3 = Math.Sin(v.z * 0.5);
562 567
563 x = s1*c2*c3+c1*s2*s3; 568 x = s1*c2*c3+c1*s2*s3;
564 y = c1*s2*c3-s1*c2*s3; 569 y = c1*s2*c3-s1*c2*s3;