aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs66
1 files changed, 58 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4c87639..53b4f7e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -733,7 +733,7 @@ namespace OpenSim.Region.Framework.Scenes
733 } 733 }
734 catch (Exception e) 734 catch (Exception e)
735 { 735 {
736 m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); 736 m_log.ErrorFormat("[SCENEOBJECTPART]: GROUP POSITION. {0}", e);
737 } 737 }
738 } 738 }
739 739
@@ -2368,17 +2368,16 @@ namespace OpenSim.Region.Framework.Scenes
2368 /// <param name="scale"></param> 2368 /// <param name="scale"></param>
2369 public void Resize(Vector3 scale) 2369 public void Resize(Vector3 scale)
2370 { 2370 {
2371 scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); 2371 scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
2372 scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); 2372 scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
2373 scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); 2373 scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
2374 2374
2375 PhysicsActor pa = PhysActor; 2375 PhysicsActor pa = PhysActor;
2376
2377 if (pa != null && pa.IsPhysical) 2376 if (pa != null && pa.IsPhysical)
2378 { 2377 {
2379 scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); 2378 scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
2380 scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); 2379 scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
2381 scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); 2380 scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
2382 } 2381 }
2383 2382
2384// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); 2383// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
@@ -4237,6 +4236,57 @@ namespace OpenSim.Region.Framework.Scenes
4237 ScheduleFullUpdate(); 4236 ScheduleFullUpdate();
4238 } 4237 }
4239 4238
4239 public void UpdateSlice(float begin, float end)
4240 {
4241 if (end < begin)
4242 {
4243 float temp = begin;
4244 begin = end;
4245 end = temp;
4246 }
4247 end = Math.Min(1f, Math.Max(0f, end));
4248 begin = Math.Min(Math.Min(1f, Math.Max(0f, begin)), end - 0.02f);
4249 if (begin < 0.02f && end < 0.02f)
4250 {
4251 begin = 0f;
4252 end = 0.02f;
4253 }
4254
4255 ushort uBegin = (ushort)(50000.0 * begin);
4256 ushort uEnd = (ushort)(50000.0 * (1f - end));
4257 bool updatePossiblyNeeded = false;
4258 PrimType primType = GetPrimType();
4259 if (primType == PrimType.SPHERE || primType == PrimType.TORUS || primType == PrimType.TUBE || primType == PrimType.RING)
4260 {
4261 if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd)
4262 {
4263 m_shape.ProfileBegin = uBegin;
4264 m_shape.ProfileEnd = uEnd;
4265 updatePossiblyNeeded = true;
4266 }
4267 }
4268 else if (m_shape.PathBegin != uBegin || m_shape.PathEnd != uEnd)
4269 {
4270 m_shape.PathBegin = uBegin;
4271 m_shape.PathEnd = uEnd;
4272 updatePossiblyNeeded = true;
4273 }
4274
4275 if (updatePossiblyNeeded && ParentGroup != null)
4276 {
4277 ParentGroup.HasGroupChanged = true;
4278 }
4279 if (updatePossiblyNeeded && PhysActor != null)
4280 {
4281 PhysActor.Shape = m_shape;
4282 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
4283 }
4284 if (updatePossiblyNeeded)
4285 {
4286 ScheduleFullUpdate();
4287 }
4288 }
4289
4240 /// <summary> 4290 /// <summary>
4241 /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics 4291 /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics
4242 /// engine can use it. 4292 /// engine can use it.