From 18652eb87ef0613b66664059581f991448d76af4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 16 Jul 2011 01:36:27 +0100
Subject: Fix physics proxy regeneration when a mesh with more than one submesh
is resized
Addresses http://opensimulator.org/mantis/view.php?id=5584
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 ++++++++++++
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 ++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0fbd746..fd5f1b0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2662,13 +2662,18 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, localID, part.Scale, scale);
+
part.IgnoreUndoUpdate = true;
+
if (scale.X > m_scene.m_maxNonphys)
scale.X = m_scene.m_maxNonphys;
if (scale.Y > m_scene.m_maxNonphys)
scale.Y = m_scene.m_maxNonphys;
if (scale.Z > m_scene.m_maxNonphys)
scale.Z = m_scene.m_maxNonphys;
+
if (part.PhysActor != null && part.PhysActor.IsPhysical)
{
if (scale.X > m_scene.m_maxPhys)
@@ -2780,7 +2785,14 @@ namespace OpenSim.Region.Framework.Scenes
newSize.Z *= z;
obPart.Resize(newSize);
obPart.UpdateOffSet(currentpos);
+
+ if (obPart.PhysActor != null)
+ {
+ obPart.PhysActor.Size = newSize;
+ m_scene.PhysicsScene.AddPhysicsActorTaint(obPart.PhysActor);
+ }
}
+
obPart.IgnoreUndoUpdate = false;
obPart.StoreUndoState();
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 7604510..96dc82b8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2839,6 +2839,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void Resize(Vector3 scale)
{
+// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
+
StoreUndoState();
m_shape.Scale = scale;
@@ -2976,6 +2978,11 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// Sets sculpt and mesh data, and tells the physics engine to process the change.
+ ///
+ /// Texture id of the mesh. XXX: Redundant since this is also in AssetBase
+ /// The mesh itself.
public void SculptTextureCallback(UUID textureID, AssetBase texture)
{
if (m_shape.SculptEntry)
@@ -4613,7 +4620,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void CheckSculptAndLoad()
{
-// m_log.Debug("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
+// m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
if (ParentGroup.IsDeleted)
return;
--
cgit v1.1