aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-11 03:13:59 +0100
committerJustin Clark-Casey (justincc)2011-07-11 03:13:59 +0100
commit2f3d0e209ff5c3028e3e29179b67504be9b2f887 (patch)
tree4b7cdf49546018fc078bf3889022e0859c24418b /OpenSim/Region
parentcomment out accidential ProcessTaints physics debug line left in code (diff)
downloadopensim-SC_OLD-2f3d0e209ff5c3028e3e29179b67504be9b2f887.zip
opensim-SC_OLD-2f3d0e209ff5c3028e3e29179b67504be9b2f887.tar.gz
opensim-SC_OLD-2f3d0e209ff5c3028e3e29179b67504be9b2f887.tar.bz2
opensim-SC_OLD-2f3d0e209ff5c3028e3e29179b67504be9b2f887.tar.xz
When a sculpt/mesh texture is received by a part on a callback request, don't do the unnecessary work of copying the base shape.
Just setting the new base shape is enough to reinsert the sculpt data and set the taint. Also cleans up a few more left-in debugging messages.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs28
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs3
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs2
5 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ec6044b..8195a0d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1726,6 +1726,7 @@ namespace OpenSim.Region.Framework.Scenes
1726 /// <summary> 1726 /// <summary>
1727 /// Loads the World's objects 1727 /// Loads the World's objects
1728 /// </summary> 1728 /// </summary>
1729 /// <param name="regionID"></param>
1729 public virtual void LoadPrimsFromStorage(UUID regionID) 1730 public virtual void LoadPrimsFromStorage(UUID regionID)
1730 { 1731 {
1731 LoadingPrims = true; 1732 LoadingPrims = true;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4b8e370..a184445 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3297,7 +3297,10 @@ namespace OpenSim.Region.Framework.Scenes
3297 if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0) 3297 if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0)
3298 return; 3298 return;
3299 3299
3300// m_log.Debug("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
3301
3300 SceneObjectPart[] parts = m_parts.GetArray(); 3302 SceneObjectPart[] parts = m_parts.GetArray();
3303
3301 for (int i = 0; i < parts.Length; i++) 3304 for (int i = 0; i < parts.Length; i++)
3302 { 3305 {
3303 SceneObjectPart part = parts[i]; 3306 SceneObjectPart part = parts[i];
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4fa3a68..5b203e9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1810,7 +1810,6 @@ namespace OpenSim.Region.Framework.Scenes
1810 { 1810 {
1811 ParentGroup.Scene.jointErrorMessage(joint, "warning: tracked body name not found! joint location will not be updated properly. joint: " + Name); 1811 ParentGroup.Scene.jointErrorMessage(joint, "warning: tracked body name not found! joint location will not be updated properly. joint: " + Name);
1812 } 1812 }
1813
1814 } 1813 }
1815 else 1814 else
1816 { 1815 {
@@ -1872,7 +1871,6 @@ namespace OpenSim.Region.Framework.Scenes
1872 1871
1873 PhysActor.IsPhysical = UsePhysics; 1872 PhysActor.IsPhysical = UsePhysics;
1874 1873
1875
1876 // If we're not what we're supposed to be in the physics scene, recreate ourselves. 1874 // If we're not what we're supposed to be in the physics scene, recreate ourselves.
1877 //m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); 1875 //m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor);
1878 /// that's not wholesome. Had to make Scene public 1876 /// that's not wholesome. Had to make Scene public
@@ -1896,6 +1894,7 @@ namespace OpenSim.Region.Framework.Scenes
1896 } 1894 }
1897 } 1895 }
1898 } 1896 }
1897
1899 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 1898 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
1900 } 1899 }
1901 } 1900 }
@@ -2967,14 +2966,17 @@ namespace OpenSim.Region.Framework.Scenes
2967 //if (texture != null) 2966 //if (texture != null)
2968 { 2967 {
2969 if (texture != null) 2968 if (texture != null)
2969 {
2970// m_log.DebugFormat(
2971// "[SCENE OBJECT PART]: Setting sculpt data for {0} on SculptTextureCallback()", Name);
2972
2970 m_shape.SculptData = texture.Data; 2973 m_shape.SculptData = texture.Data;
2974 }
2971 2975
2972 if (PhysActor != null) 2976 if (PhysActor != null)
2973 { 2977 {
2974 // Tricks physics engine into thinking we've changed the part shape. 2978 // Update the physics actor with the new loaded sculpt data and set the taint signal.
2975 PrimitiveBaseShape m_newshape = m_shape.Copy(); 2979 PhysActor.Shape = m_shape;
2976 PhysActor.Shape = m_newshape;
2977 m_shape = m_newshape;
2978 2980
2979 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 2981 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
2980 } 2982 }
@@ -3270,11 +3272,14 @@ namespace OpenSim.Region.Framework.Scenes
3270 { 3272 {
3271 m_parentGroup.SetAxisRotation(axis, rotate); 3273 m_parentGroup.SetAxisRotation(axis, rotate);
3272 } 3274 }
3275
3273 //Cannot use ScriptBaseClass constants as no referance to it currently. 3276 //Cannot use ScriptBaseClass constants as no referance to it currently.
3274 if (axis == 2)//STATUS_ROTATE_X 3277 if (axis == 2)//STATUS_ROTATE_X
3275 STATUS_ROTATE_X = rotate; 3278 STATUS_ROTATE_X = rotate;
3279
3276 if (axis == 4)//STATUS_ROTATE_Y 3280 if (axis == 4)//STATUS_ROTATE_Y
3277 STATUS_ROTATE_Y = rotate; 3281 STATUS_ROTATE_Y = rotate;
3282
3278 if (axis == 8)//STATUS_ROTATE_Z 3283 if (axis == 8)//STATUS_ROTATE_Z
3279 STATUS_ROTATE_Z = rotate; 3284 STATUS_ROTATE_Z = rotate;
3280 } 3285 }
@@ -4418,6 +4423,7 @@ namespace OpenSim.Region.Framework.Scenes
4418 RemFlag(PrimFlags.Phantom); 4423 RemFlag(PrimFlags.Phantom);
4419 4424
4420 PhysicsActor pa = PhysActor; 4425 PhysicsActor pa = PhysActor;
4426
4421 if (pa == null) 4427 if (pa == null)
4422 { 4428 {
4423 // It's not phantom anymore. So make sure the physics engine get's knowledge of it 4429 // It's not phantom anymore. So make sure the physics engine get's knowledge of it
@@ -4434,6 +4440,7 @@ namespace OpenSim.Region.Framework.Scenes
4434 if (pa != null) 4440 if (pa != null)
4435 { 4441 {
4436 DoPhysicsPropertyUpdate(UsePhysics, true); 4442 DoPhysicsPropertyUpdate(UsePhysics, true);
4443
4437 if (m_parentGroup != null) 4444 if (m_parentGroup != null)
4438 { 4445 {
4439 if (!m_parentGroup.IsDeleted) 4446 if (!m_parentGroup.IsDeleted)
@@ -4444,6 +4451,7 @@ namespace OpenSim.Region.Framework.Scenes
4444 } 4451 }
4445 } 4452 }
4446 } 4453 }
4454
4447 if ( 4455 if (
4448 ((AggregateScriptEvents & scriptEvents.collision) != 0) || 4456 ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
4449 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || 4457 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
@@ -4454,8 +4462,8 @@ namespace OpenSim.Region.Framework.Scenes
4454 (CollisionSound != UUID.Zero) 4462 (CollisionSound != UUID.Zero)
4455 ) 4463 )
4456 { 4464 {
4457 PhysActor.OnCollisionUpdate += PhysicsCollision; 4465 PhysActor.OnCollisionUpdate += PhysicsCollision;
4458 PhysActor.SubscribeEvents(1000); 4466 PhysActor.SubscribeEvents(1000);
4459 } 4467 }
4460 } 4468 }
4461 } 4469 }
@@ -4492,13 +4500,15 @@ namespace OpenSim.Region.Framework.Scenes
4492 } 4500 }
4493 } 4501 }
4494 else 4502 else
4495 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like 4503 {
4504 // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
4496 // (mumbles, well, at least if you have infinte CPU powers :-)) 4505 // (mumbles, well, at least if you have infinte CPU powers :-))
4497 PhysicsActor pa = this.PhysActor; 4506 PhysicsActor pa = this.PhysActor;
4498 if (pa != null) 4507 if (pa != null)
4499 { 4508 {
4500 PhysActor.SetVolumeDetect(0); 4509 PhysActor.SetVolumeDetect(0);
4501 } 4510 }
4511
4502 this.VolumeDetectActive = false; 4512 this.VolumeDetectActive = false;
4503 } 4513 }
4504 4514
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 0cf2f5d..123c8ff 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -2104,6 +2104,7 @@ Console.WriteLine("changeshape not need meshing");
2104 parent.ChildSetGeom(this); 2104 parent.ChildSetGeom(this);
2105 } 2105 }
2106 } 2106 }
2107
2107 resetCollisionAccounting(); 2108 resetCollisionAccounting();
2108 m_taintshape = false; 2109 m_taintshape = false;
2109 } 2110 }
@@ -2343,7 +2344,7 @@ Console.WriteLine("changeshape not need meshing");
2343 { 2344 {
2344 lock (_parent_scene.OdeLock) 2345 lock (_parent_scene.OdeLock)
2345 { 2346 {
2346 m_isVolumeDetect = (param!=0); 2347 m_isVolumeDetect = (param != 0);
2347 } 2348 }
2348 } 2349 }
2349 2350
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index f5172aa..99392cc 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28//#define USE_DRAWSTUFF 28//#define USE_DRAWSTUFF
29#define SPAM 29//#define SPAM
30 30
31using System; 31using System;
32using System.Collections.Generic; 32using System.Collections.Generic;