From 0155d42b80ee7b35d0a882052d8cf4976e7d15de Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 8 Jan 2014 00:54:39 +0000
Subject: If an agent is sitting, then do send the rotation in the agent update
instead of zeroing it to resolve mouselook camera problems
Addresses http://opensimulator.org/mantis/view.php?id=6892
Thanks to tglion for this spot.
This resolves a recent regression from 17b32b764acd815400d9eb903aaec6dcebd60ac7
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 25 +++++++++++++++-------
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 ++
2 files changed, 19 insertions(+), 8 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index a04ded5..c38c829 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5098,11 +5098,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// excessive up and down movements of the camera when looking up and down.
// See http://opensimulator.org/mantis/view.php?id=3274
// This does not affect head movement, since this is controlled entirely by camera movement rather than
- // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
- // effect, not the avatar rotation.
+ // body rotation. We still need to transmit X and Y for sitting avatars but mouselook does not change
+ // the rotation in this case.
rotation = presence.Rotation;
- rotation.X = 0;
- rotation.Y = 0;
+
+ if (!presence.IsSatOnObject)
+ {
+ rotation.X = 0;
+ rotation.Y = 0;
+ }
if (sendTexture)
textureEntry = presence.Appearance.Texture.GetBytes();
@@ -5225,11 +5229,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// excessive up and down movements of the camera when looking up and down.
// See http://opensimulator.org/mantis/view.php?id=3274
// This does not affect head movement, since this is controlled entirely by camera movement rather than
- // body rotation. It does not affect sitting avatar since it's the sitting part rotation that takes
- // effect, not the avatar rotation.
+ // body rotation. We still need to transmit X and Y for sitting avatars but mouselook does not change
+ // the rotation in this case.
Quaternion rot = data.Rotation;
- rot.X = 0;
- rot.Y = 0;
+
+ if (!data.IsSatOnObject)
+ {
+ rot.X = 0;
+ rot.Y = 0;
+ }
+
rot.ToBytes(objectData, 52);
//data.AngularVelocity.ToBytes(objectData, 64);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 7ed3a4b..49f70c4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1640,6 +1640,8 @@ namespace OpenSim.Region.Framework.Scenes
ControllingClient.SendAgentTerseUpdate(this);
PhysicsActor actor = PhysicsActor;
+
+ // This will be the case if the agent is sitting on the groudn or on an object.
if (actor == null)
{
SendControlsToScripts(flagsForScripts);
--
cgit v1.1
From 13f31fdf85c404896c166932730b7b8bc5416626 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 4 Nov 2013 19:28:24 +0200
Subject: Refactored setting permissions when rezzing items: use the same
function when rezzing from user inventory and prim inventory.
Also, fixed a bug: when rezzing a coalesced object from a prim's inventory, apply the coalesced object's name and description only to the first sub-object; not to all the objects in the coalescence. (This was already done correctly when rezzing from a user's inventory.)
---
OpenSim/Framework/PermissionsUtil.cs | 68 ++++++++++++++++++++
.../InventoryAccess/InventoryAccessModule.cs | 51 ++++-----------
.../Region/Framework/Scenes/SceneObjectGroup.cs | 3 +
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 58 +++++++++++++++++
.../Framework/Scenes/SceneObjectPartInventory.cs | 74 +++++-----------------
5 files changed, 160 insertions(+), 94 deletions(-)
create mode 100644 OpenSim/Framework/PermissionsUtil.cs
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
new file mode 100644
index 0000000..3dce04d
--- /dev/null
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using log4net;
+
+namespace OpenSim.Framework
+{
+ public static class PermissionsUtil
+ {
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
+ ///
+ /// Logs permissions flags. Useful when debugging permission problems.
+ ///
+ ///
+ public static void LogPermissions(String name, String message, uint basePerm, uint curPerm, uint nextPerm)
+ {
+ m_log.DebugFormat("Permissions of \"{0}\" at \"{1}\": Base {2} ({3:X4}), Current {4} ({5:X4}), NextOwner {6} ({7:X4})",
+ name, message,
+ PermissionsToString(basePerm), basePerm, PermissionsToString(curPerm), curPerm, PermissionsToString(nextPerm), nextPerm);
+ }
+
+ ///
+ /// Converts a permissions bit-mask to a string (e.g., "MCT").
+ ///
+ private static string PermissionsToString(uint perms)
+ {
+ string str = "";
+ if ((perms & (int)PermissionMask.Modify) != 0)
+ str += "M";
+ if ((perms & (int)PermissionMask.Copy) != 0)
+ str += "C";
+ if ((perms & (int)PermissionMask.Transfer) != 0)
+ str += "T";
+ if (str == "")
+ str = ".";
+ return str;
+ }
+ }
+}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 831922e..da36ed0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -512,10 +512,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask;
item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask;
- // Magic number badness. Maybe this deserves an enum.
- // bit 4 (16) is the "Slam" bit, it means treat as passed
- // and apply next owner perms on rez
- item.CurrentPermissions |= 16; // Slam!
+ // apply next owner perms on rez
+ item.CurrentPermissions |= SceneObjectGroup.SLAM;
}
else
{
@@ -809,11 +807,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint;
}
- foreach (SceneObjectPart part in group.Parts)
+ if (item == null)
{
- // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
- part.LastOwnerID = part.OwnerID;
- part.OwnerID = remoteClient.AgentId;
+ // Change ownership. Normally this is done in DoPreRezWhenFromItem(), but in this case we must do it here.
+ foreach (SceneObjectPart part in group.Parts)
+ {
+ // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset.
+ part.LastOwnerID = part.OwnerID;
+ part.OwnerID = remoteClient.AgentId;
+ }
}
if (!attachment)
@@ -969,44 +971,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// "[INVENTORY ACCESS MODULE]: rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
- if ((rootPart.OwnerID != item.Owner) ||
- (item.CurrentPermissions & 16) != 0)
+ if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & SceneObjectGroup.SLAM) != 0)
{
//Need to kill the for sale here
rootPart.ObjectSaleType = 0;
rootPart.SalePrice = 10;
-
- if (m_Scene.Permissions.PropagatePermissions())
- {
- foreach (SceneObjectPart part in so.Parts)
- {
- if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
- {
- part.EveryoneMask = item.EveryOnePermissions;
- part.NextOwnerMask = item.NextPermissions;
- }
- part.GroupMask = 0; // DO NOT propagate here
- }
-
- so.ApplyNextOwnerPermissions();
- }
}
-
+
foreach (SceneObjectPart part in so.Parts)
{
part.FromUserInventoryItemID = fromUserInventoryItemId;
-
- if ((part.OwnerID != item.Owner) ||
- (item.CurrentPermissions & 16) != 0)
- {
- part.Inventory.ChangeInventoryOwner(item.Owner);
- part.GroupMask = 0; // DO NOT propagate here
- }
-
- part.EveryoneMask = item.EveryOnePermissions;
- part.NextOwnerMask = item.NextPermissions;
+ part.ApplyPermissionsOnRez(item, true, m_Scene);
}
-
+
rootPart.TrimPermissions();
if (isAttachment)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4b4e4ba..23507f4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -109,6 +109,9 @@ namespace OpenSim.Region.Framework.Scenes
STATUS_ROTATE_Z = 0x008,
}
+ // This flag has the same purpose as InventoryItemFlags.ObjectSlamPerm
+ public static readonly uint SLAM = 16;
+
// private PrimCountTaintedDelegate handlerPrimCountTainted = null;
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index ea9d0d8..1cf7726 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4800,6 +4800,64 @@ namespace OpenSim.Region.Framework.Scenes
{
ParentGroup.AddScriptLPS(count);
}
+
+ ///
+ /// Sets a prim's owner and permissions when it's rezzed.
+ ///
+ /// The inventory item from which the item was rezzed
+ /// True: the item is being rezzed from the user's inventory. False: from a prim's inventory.
+ /// The scene the prim is being rezzed into
+ public void ApplyPermissionsOnRez(InventoryItemBase item, bool userInventory, Scene scene)
+ {
+ if ((OwnerID != item.Owner) || ((item.CurrentPermissions & SceneObjectGroup.SLAM) != 0) || ((item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0))
+ {
+ if (scene.Permissions.PropagatePermissions())
+ {
+ if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
+ {
+ // Apply the item's permissions to the object
+ //LogPermissions("Before applying item permissions");
+ if (userInventory)
+ {
+ EveryoneMask = item.EveryOnePermissions;
+ NextOwnerMask = item.NextPermissions;
+ }
+ else
+ {
+ if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
+ EveryoneMask = item.EveryOnePermissions;
+ if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
+ NextOwnerMask = item.NextPermissions;
+ if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
+ GroupMask = item.GroupPermissions;
+ }
+ //LogPermissions("After applying item permissions");
+ }
+ }
+
+ GroupMask = 0; // DO NOT propagate here
+ }
+
+ if (OwnerID != item.Owner)
+ {
+ //LogPermissions("Before ApplyNextOwnerPermissions");
+ ApplyNextOwnerPermissions();
+ //LogPermissions("After ApplyNextOwnerPermissions");
+
+ LastOwnerID = OwnerID;
+ OwnerID = item.Owner;
+ Inventory.ChangeInventoryOwner(item.Owner);
+ }
+ }
+
+ ///
+ /// Logs the prim's permissions. Useful when debugging permission problems.
+ ///
+ ///
+ private void LogPermissions(String message)
+ {
+ PermissionsUtil.LogPermissions(Name, message, BaseMask, OwnerMask, NextOwnerMask);
+ }
public void ApplyNextOwnerPermissions()
{
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 380e402..5fa01e3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -764,48 +764,27 @@ namespace OpenSim.Region.Framework.Scenes
// Since renaming the item in the inventory does not affect the name stored
// in the serialization, transfer the correct name from the inventory to the
// object itself before we rez.
- rootPart.Name = item.Name;
- rootPart.Description = item.Description;
-
- SceneObjectPart[] partList = group.Parts;
-
- group.SetGroup(m_part.GroupID, null);
-
- // TODO: Remove magic number badness
- if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
+ // Only do these for the first object if we are rezzing a coalescence.
+ if (i == 0)
{
- if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
- {
- foreach (SceneObjectPart part in partList)
- {
- if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
- part.EveryoneMask = item.EveryonePermissions;
- if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
- part.NextOwnerMask = item.NextPermissions;
- if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
- part.GroupMask = item.GroupPermissions;
- }
-
- group.ApplyNextOwnerPermissions();
- }
+ rootPart.Name = item.Name;
+ rootPart.Description = item.Description;
}
- foreach (SceneObjectPart part in partList)
- {
- // TODO: Remove magic number badness
- if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
- {
- part.LastOwnerID = part.OwnerID;
- part.OwnerID = item.OwnerID;
- part.Inventory.ChangeInventoryOwner(item.OwnerID);
- }
+ group.SetGroup(m_part.GroupID, null);
- if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
- part.EveryoneMask = item.EveryonePermissions;
- if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
- part.NextOwnerMask = item.NextPermissions;
- if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
- part.GroupMask = item.GroupPermissions;
+ foreach (SceneObjectPart part in group.Parts)
+ {
+ // Convert between InventoryItem classes. You can never have too many similar but slightly different classes :)
+ InventoryItemBase dest = new InventoryItemBase(item.ItemID, item.OwnerID);
+ dest.BasePermissions = item.BasePermissions;
+ dest.CurrentPermissions = item.CurrentPermissions;
+ dest.EveryOnePermissions = item.EveryonePermissions;
+ dest.GroupPermissions = item.GroupPermissions;
+ dest.NextPermissions = item.NextPermissions;
+ dest.Flags = item.Flags;
+
+ part.ApplyPermissionsOnRez(dest, false, m_part.ParentGroup.Scene);
}
rootPart.TrimPermissions();
@@ -1130,25 +1109,6 @@ namespace OpenSim.Region.Framework.Scenes
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
-
- if (item.InvType != (int)InventoryType.Object)
- {
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
- mask &= ~((uint)PermissionMask.Copy >> 13);
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
- mask &= ~((uint)PermissionMask.Transfer >> 13);
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
- mask &= ~((uint)PermissionMask.Modify >> 13);
- }
- else
- {
- if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
- mask &= ~((uint)PermissionMask.Copy >> 13);
- if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
- mask &= ~((uint)PermissionMask.Transfer >> 13);
- if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
- mask &= ~((uint)PermissionMask.Modify >> 13);
- }
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
--
cgit v1.1
From 91fd9c467083a57e2898594ce3ae764aa0525bb5 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Tue, 5 Nov 2013 15:42:23 +0200
Subject: Refactored: use a single function to apply an object's folded
permissions to its main permissions
---
.../RemoteController/RemoteAdminPlugin.cs | 12 +++++-------
OpenSim/Framework/PermissionsUtil.cs | 19 +++++++++++++++++++
.../InventoryAccess/InventoryAccessModule.cs | 20 +++++++++-----------
.../World/Objects/BuySell/BuySellModule.cs | 8 +-------
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 17 ++++++++++-------
.../Framework/Scenes/SceneObjectPartInventory.cs | 11 ++++-------
6 files changed, 48 insertions(+), 39 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 354f587..811781c 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -2763,15 +2763,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController
///
private void ApplyNextOwnerPermissions(InventoryItemBase item)
{
- if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
+ if (item.InvType == (int)InventoryType.Object)
{
- if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
+ uint perms = item.CurrentPermissions;
+ PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref perms);
+ item.CurrentPermissions = perms;
}
+
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryOnePermissions &= item.NextPermissions;
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index 3dce04d..d785a78 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -64,5 +64,24 @@ namespace OpenSim.Framework
str = ".";
return str;
}
+
+ ///
+ /// Applies an object's folded permissions to its regular permissions.
+ ///
+ /// The folded permissions. Only the lowest 7 bits are examined.
+ /// The permissions variable to modify.
+ public static void ApplyFoldedPermissions(uint foldedPerms, ref uint mainPerms)
+ {
+ if ((foldedPerms & 7) == 0)
+ return; // assume that if the folded permissions are 0 then this means that they weren't actually recorded
+
+ if ((foldedPerms & ((uint)PermissionMask.Copy >> 13)) == 0)
+ mainPerms &= ~(uint)PermissionMask.Copy;
+ if ((foldedPerms & ((uint)PermissionMask.Transfer >> 13)) == 0)
+ mainPerms &= ~(uint)PermissionMask.Transfer;
+ if ((foldedPerms & ((uint)PermissionMask.Modify >> 13)) == 0)
+ mainPerms &= ~(uint)PermissionMask.Modify;
+ }
+
}
}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index da36ed0..a7e6fdd 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -443,13 +443,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
else
{
- AddPermissions(item, objlist[0], objlist, remoteClient);
-
item.CreationDate = Util.UnixTimeSinceEpoch();
item.Description = asset.Description;
item.Name = asset.Name;
item.AssetType = asset.Type;
+ AddPermissions(item, objlist[0], objlist, remoteClient);
+
m_Scene.AddInventoryItem(item);
if (remoteClient != null && item.Owner == remoteClient.AgentId)
@@ -495,16 +495,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
effectivePerms &= grp.GetEffectivePermissions();
effectivePerms |= (uint)PermissionMask.Move;
+ //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
+
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
uint perms = effectivePerms;
- uint nextPerms = (perms & 7) << 13;
- if ((nextPerms & (uint)PermissionMask.Copy) == 0)
- perms &= ~(uint)PermissionMask.Copy;
- if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
- perms &= ~(uint)PermissionMask.Transfer;
- if ((nextPerms & (uint)PermissionMask.Modify) == 0)
- perms &= ~(uint)PermissionMask.Modify;
+ PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
item.BasePermissions = perms & so.RootPart.NextOwnerMask;
item.CurrentPermissions = item.BasePermissions;
@@ -530,8 +526,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
(uint)PermissionMask.Move |
(uint)PermissionMask.Export |
7); // Preserve folded permissions
- }
-
+ }
+
+ //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
+
return item;
}
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 22a53a8..0cb574a 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -198,13 +198,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
item.InvType = (int)InventoryType.Object;
item.Folder = categoryID;
- uint nextPerms=(perms & 7) << 13;
- if ((nextPerms & (uint)PermissionMask.Copy) == 0)
- perms &= ~(uint)PermissionMask.Copy;
- if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
- perms &= ~(uint)PermissionMask.Transfer;
- if ((nextPerms & (uint)PermissionMask.Modify) == 0)
- perms &= ~(uint)PermissionMask.Modify;
+ PermissionsUtil.ApplyFoldedPermissions(perms, ref perms);
item.BasePermissions = perms & part.NextOwnerMask;
item.CurrentPermissions = perms & part.NextOwnerMask;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 65536db..9cc5cde 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -669,17 +669,13 @@ namespace OpenSim.Region.Framework.Scenes
// a mask
if (item.InvType == (int)InventoryType.Object)
{
- // Create a safe mask for the current perms
- uint foldedPerms = (item.CurrentPermissions & 7) << 13;
- foldedPerms |= permsMask;
-
bool isRootMod = (item.CurrentPermissions &
(uint)PermissionMask.Modify) != 0 ?
true : false;
// Mask the owner perms to the folded perms
- ownerPerms &= foldedPerms;
- basePerms &= foldedPerms;
+ PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref ownerPerms);
+ PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref basePerms);
// If the root was mod, let the mask reflect that
// We also need to adjust the base here, because
@@ -1209,9 +1205,16 @@ namespace OpenSim.Region.Framework.Scenes
{
agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
if (taskItem.InvType == (int)InventoryType.Object)
- agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
+ {
+ uint perms = taskItem.CurrentPermissions;
+ PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms);
+ agentItem.BasePermissions = perms | (uint)PermissionMask.Move;
+ agentItem.CurrentPermissions = agentItem.BasePermissions;
+ }
else
+ {
agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
+ }
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
agentItem.NextPermissions = taskItem.NextPermissions;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 5fa01e3..fb8ecd5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1132,14 +1132,11 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
- if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
+ if (item.InvType == (int)InventoryType.Object)
{
- if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
+ uint perms = item.CurrentPermissions;
+ PermissionsUtil.ApplyFoldedPermissions(perms, ref perms);
+ item.CurrentPermissions = perms;
}
item.CurrentPermissions &= item.NextPermissions;
--
cgit v1.1
From a94e1e0e085a3c70e35e2c9cf0583d193c6ed32f Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Wed, 6 Nov 2013 12:57:44 +0200
Subject: When creating a coalesced object, set its Creator ID if all the
objects have the same creator
---
.../InventoryAccess/InventoryAccessModule.cs | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index a7e6fdd..af95577 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -412,17 +412,28 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (item == null)
return null;
+
+ item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
+ item.CreatorData = objlist[0].RootPart.CreatorData;
- // Can't know creator is the same, so null it in inventory
if (objlist.Count > 1)
{
- item.CreatorId = UUID.Zero.ToString();
item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
+
+ // If the objects have different creators then don't specify a creator at all
+ foreach (SceneObjectGroup objectGroup in objlist)
+ {
+ if ((objectGroup.RootPart.CreatorID.ToString() != item.CreatorId)
+ || (objectGroup.RootPart.CreatorData.ToString() != item.CreatorData))
+ {
+ item.CreatorId = UUID.Zero.ToString();
+ item.CreatorData = string.Empty;
+ break;
+ }
+ }
}
else
{
- item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
- item.CreatorData = objlist[0].RootPart.CreatorData;
item.SaleType = objlist[0].RootPart.ObjectSaleType;
item.SalePrice = objlist[0].RootPart.SalePrice;
}
--
cgit v1.1
From 88f01a41305364e0d505964c6743d95d1564530b Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Thu, 7 Nov 2013 17:25:39 +0200
Subject: When creating a coalesced object, set its permissions to the
lowest-common-denominator of all the sub-objects
---
.../InventoryAccess/InventoryAccessModule.cs | 23 +++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index af95577..781cc69 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -502,8 +502,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IClientAPI remoteClient)
{
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7;
+ uint allObjectsNextOwnerPerms = 0x7fffffff;
+ uint allObjectsEveryOnePerms = 0x7fffffff;
+ uint allObjectsGroupPerms = 0x7fffffff;
+
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
+ {
effectivePerms &= grp.GetEffectivePermissions();
+ allObjectsNextOwnerPerms &= grp.RootPart.NextOwnerMask;
+ allObjectsEveryOnePerms &= grp.RootPart.EveryoneMask;
+ allObjectsGroupPerms &= grp.RootPart.GroupMask;
+ }
effectivePerms |= (uint)PermissionMask.Move;
//PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions);
@@ -513,11 +522,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
uint perms = effectivePerms;
PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
- item.BasePermissions = perms & so.RootPart.NextOwnerMask;
+ item.BasePermissions = perms & allObjectsNextOwnerPerms;
item.CurrentPermissions = item.BasePermissions;
- item.NextPermissions = perms & so.RootPart.NextOwnerMask;
- item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask;
- item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask;
+ item.NextPermissions = perms & allObjectsNextOwnerPerms;
+ item.EveryOnePermissions = allObjectsEveryOnePerms & allObjectsNextOwnerPerms;
+ item.GroupPermissions = allObjectsGroupPerms & allObjectsNextOwnerPerms;
// apply next owner perms on rez
item.CurrentPermissions |= SceneObjectGroup.SLAM;
@@ -526,9 +535,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
item.BasePermissions = effectivePerms;
item.CurrentPermissions = effectivePerms;
- item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms;
- item.EveryOnePermissions = so.RootPart.EveryoneMask & effectivePerms;
- item.GroupPermissions = so.RootPart.GroupMask & effectivePerms;
+ item.NextPermissions = allObjectsNextOwnerPerms & effectivePerms;
+ item.EveryOnePermissions = allObjectsEveryOnePerms & effectivePerms;
+ item.GroupPermissions = allObjectsGroupPerms & effectivePerms;
item.CurrentPermissions &=
((uint)PermissionMask.Copy |
--
cgit v1.1
From da47bcae3ec625e7cb8dc1947d1aa39ba7b8ac0f Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 16 Sep 2013 09:42:14 +0300
Subject: When moving the root prim of an attachment: a) Change the attach
position; b) Move the other prims in the reverse direction to compensate
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 23507f4..e31270c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3043,13 +3043,10 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 oldPos;
- // FIXME: This improves the situation where editing just the root prim of an attached object would send
- // all the other parts to oblivion after detach/reattach. However, a problem remains since the root prim
- // still ends up in the wrong position on reattach.
if (IsAttachment)
- oldPos = RootPart.OffsetPosition;
+ oldPos = m_rootPart.AttachedPos + m_rootPart.OffsetPosition; // OffsetPosition should always be 0 in an attachments's root prim
else
- oldPos = AbsolutePosition + RootPart.OffsetPosition;
+ oldPos = AbsolutePosition + m_rootPart.OffsetPosition;
Vector3 diff = oldPos - newPos;
Quaternion partRotation = m_rootPart.RotationOffset;
@@ -3064,6 +3061,9 @@ namespace OpenSim.Region.Framework.Scenes
}
AbsolutePosition = newPos;
+
+ if (IsAttachment)
+ m_rootPart.AttachedPos = newPos;
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
--
cgit v1.1
From 9050c152b402d0c629b7050033c4d9361fda637b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 4 Jan 2014 21:18:37 +0000
Subject: Dynamically adjust to the number of visual params sent.
---
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index c38c829..0ebccbe 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3634,7 +3634,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance);
// TODO: don't create new blocks if recycling an old packet
- avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
+ avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[visualParams.Length];
avp.ObjectData.TextureEntry = textureEntry;
AvatarAppearancePacket.VisualParamBlock avblock = null;
--
cgit v1.1
From 08f2fc63cd2891bbc445371584b5b8da5822a25f Mon Sep 17 00:00:00 2001
From: David Rowe
Date: Thu, 9 Jan 2014 15:35:12 -0800
Subject: Fixed llTextBox error message text
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5663048..e54b697 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4397,7 +4397,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID av = new UUID();
if (!UUID.TryParse(agent,out av))
{
- LSLError("First parameter to llDialog needs to be a key");
+ LSLError("First parameter to llTextBox needs to be a key");
return;
}
--
cgit v1.1
From bc0ff5e7d43b873f8895f782c73170a84b5c35d6 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Thu, 2 May 2013 15:23:37 +0300
Subject: Allow Boolean nodes in XML to be specified as "0/1". AuroraSim does
that.
---
OpenSim/Framework/Util.cs | 4 +++-
OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index e8dfec1..52635b2 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -2029,8 +2029,10 @@ namespace OpenSim.Framework
#region Xml Serialization Utilities
public static bool ReadBoolean(XmlTextReader reader)
{
+ // AuroraSim uses "int" for some fields that are boolean in OpenSim, e.g. "PassCollisions". Don't fail because of this.
reader.ReadStartElement();
- bool result = Boolean.Parse(reader.ReadContentAsString().ToLower());
+ string val = reader.ReadContentAsString().ToLower();
+ bool result = val.Equals("true") || val.Equals("1");
reader.ReadEndElement();
return result;
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index d8a3184..2511c08 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -557,7 +557,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
}
catch
{
- m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetServerURLs", m_ServerURL);
+ m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetServerURLs for user {1}", m_ServerURL, userID);
// reason = "Exception: " + e.Message;
return serverURLs;
}
--
cgit v1.1
From 239b85d7cee3d8e0ae7349cbe62582d46940c732 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Fri, 10 Jan 2014 22:52:31 -0800
Subject: Fix crash in BulletSim which sometimes happens making a linkset
physical (like sitting on and activating a vehicle) and crossing borders.
This keeps better bookkeeping on compound shapes so BulletSim can identify
them when being freed.
---
OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | 39 +++++++++++++++++++-----
1 file changed, 32 insertions(+), 7 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
index 006a9c1..fbe320b 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
@@ -71,7 +71,7 @@ public abstract class BSShape
lastReferenced = DateTime.Now;
}
- // Called when this shape is being used again.
+ // Called when this shape is done being used.
protected virtual void DecrementReference()
{
referenceCount--;
@@ -866,6 +866,8 @@ public class BSShapeHull : BSShape
public class BSShapeCompound : BSShape
{
private static string LogHeader = "[BULLETSIM SHAPE COMPOUND]";
+ public static Dictionary CompoundShapes = new Dictionary();
+
public BSShapeCompound(BulletShape pShape) : base(pShape)
{
}
@@ -873,7 +875,9 @@ public class BSShapeCompound : BSShape
{
// Base compound shapes are not shared so this returns a raw shape.
// A built compound shape can be reused in linksets.
- return new BSShapeCompound(CreatePhysicalCompoundShape(physicsScene));
+ BSShapeCompound ret = new BSShapeCompound(CreatePhysicalCompoundShape(physicsScene));
+ CompoundShapes.Add(ret.AddrString, ret);
+ return ret;
}
public override BSShape GetReference(BSScene physicsScene, BSPhysObject prim)
{
@@ -911,10 +915,21 @@ public class BSShapeCompound : BSShape
BulletShape childShape = physicsScene.PE.RemoveChildShapeFromCompoundShapeIndex(physShapeInfo, ii);
DereferenceAnonCollisionShape(physicsScene, childShape);
}
+
+ lock (CompoundShapes)
+ CompoundShapes.Remove(physShapeInfo.AddrString);
physicsScene.PE.DeleteCollisionShape(physicsScene.World, physShapeInfo);
}
}
}
+ public static bool TryGetCompoundByPtr(BulletShape pShape, out BSShapeCompound outCompound)
+ {
+ lock (CompoundShapes)
+ {
+ string addr = pShape.AddrString;
+ return CompoundShapes.TryGetValue(addr, out outCompound);
+ }
+ }
private static BulletShape CreatePhysicalCompoundShape(BSScene physicsScene)
{
BulletShape cShape = physicsScene.PE.CreateCompoundShape(physicsScene.World, false);
@@ -926,10 +941,13 @@ public class BSShapeCompound : BSShape
private void DereferenceAnonCollisionShape(BSScene physicsScene, BulletShape pShape)
{
// TODO: figure a better way to go through all the shape types and find a possible instance.
+ physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,shape={1}",
+ BSScene.DetailLogZero, pShape);
BSShapeMesh meshDesc;
if (BSShapeMesh.TryGetMeshByPtr(pShape, out meshDesc))
{
meshDesc.Dereference(physicsScene);
+ // physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,foundMesh,shape={1}", BSScene.DetailLogZero, pShape);
}
else
{
@@ -937,13 +955,15 @@ public class BSShapeCompound : BSShape
if (BSShapeHull.TryGetHullByPtr(pShape, out hullDesc))
{
hullDesc.Dereference(physicsScene);
+ // physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,foundHull,shape={1}", BSScene.DetailLogZero, pShape);
}
else
{
BSShapeConvexHull chullDesc;
- if (BSShapeConvexHull.TryGetHullByPtr(pShape, out chullDesc))
+ if (BSShapeConvexHull.TryGetConvexHullByPtr(pShape, out chullDesc))
{
chullDesc.Dereference(physicsScene);
+ // physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,foundConvexHull,shape={1}", BSScene.DetailLogZero, pShape);
}
else
{
@@ -951,20 +971,23 @@ public class BSShapeCompound : BSShape
if (BSShapeGImpact.TryGetGImpactByPtr(pShape, out gImpactDesc))
{
gImpactDesc.Dereference(physicsScene);
+ // physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,foundgImpact,shape={1}", BSScene.DetailLogZero, pShape);
}
else
{
// Didn't find it in the lists of specific types. It could be compound.
- if (physicsScene.PE.IsCompound(pShape))
+ BSShapeCompound compoundDesc;
+ if (BSShapeCompound.TryGetCompoundByPtr(pShape, out compoundDesc))
{
- BSShapeCompound recursiveCompound = new BSShapeCompound(pShape);
- recursiveCompound.Dereference(physicsScene);
+ compoundDesc.Dereference(physicsScene);
+ // physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,recursiveCompoundShape,shape={1}", BSScene.DetailLogZero, pShape);
}
else
{
// If none of the above, maybe it is a simple native shape.
if (physicsScene.PE.IsNativeShape(pShape))
{
+ // physicsScene.DetailLog("{0},BSShapeCompound.DereferenceAnonCollisionShape,assumingNative,shape={1}", BSScene.DetailLogZero, pShape);
BSShapeNative nativeShape = new BSShapeNative(pShape);
nativeShape.Dereference(physicsScene);
}
@@ -1021,6 +1044,8 @@ public class BSShapeConvexHull : BSShape
convexShape = physicsScene.PE.BuildConvexHullShapeFromMesh(physicsScene.World, baseMesh.physShapeInfo);
convexShape.shapeKey = newMeshKey;
ConvexHulls.Add(convexShape.shapeKey, retConvexHull);
+ physicsScene.DetailLog("{0},BSShapeConvexHull.GetReference,addingNewlyCreatedShape,shape={1}",
+ BSScene.DetailLogZero, convexShape);
}
// Done with the base mesh
@@ -1049,7 +1074,7 @@ public class BSShapeConvexHull : BSShape
}
}
// Loop through all the known hulls and return the description based on the physical address.
- public static bool TryGetHullByPtr(BulletShape pShape, out BSShapeConvexHull outHull)
+ public static bool TryGetConvexHullByPtr(BulletShape pShape, out BSShapeConvexHull outHull)
{
bool ret = false;
BSShapeConvexHull foundDesc = null;
--
cgit v1.1