aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs106
1 files changed, 17 insertions, 89 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 74d2629..ee61de6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2747,25 +2747,6 @@ namespace OpenSim.Region.Framework.Scenes
2747 if (objectGroup == this) 2747 if (objectGroup == this)
2748 return; 2748 return;
2749 2749
2750 // If the configured linkset capacity is greater than zero,
2751 // and the new linkset would have a prim count higher than this
2752 // value, do not link it.
2753 if (m_scene.m_linksetCapacity > 0 &&
2754 (PrimCount + objectGroup.PrimCount) >
2755 m_scene.m_linksetCapacity)
2756 {
2757 m_log.DebugFormat(
2758 "[SCENE OBJECT GROUP]: Cannot link group with root" +
2759 " part {0}, {1} ({2} prims) to group with root part" +
2760 " {3}, {4} ({5} prims) because the new linkset" +
2761 " would exceed the configured maximum of {6}",
2762 objectGroup.RootPart.Name, objectGroup.RootPart.UUID,
2763 objectGroup.PrimCount, RootPart.Name, RootPart.UUID,
2764 PrimCount, m_scene.m_linksetCapacity);
2765
2766 return;
2767 }
2768
2769 // 'linkPart' == the root of the group being linked into this group 2750 // 'linkPart' == the root of the group being linked into this group
2770 SceneObjectPart linkPart = objectGroup.m_rootPart; 2751 SceneObjectPart linkPart = objectGroup.m_rootPart;
2771 2752
@@ -3511,33 +3492,27 @@ namespace OpenSim.Region.Framework.Scenes
3511 /// <param name="scale"></param> 3492 /// <param name="scale"></param>
3512 public void GroupResize(Vector3 scale) 3493 public void GroupResize(Vector3 scale)
3513 { 3494 {
3514// m_log.DebugFormat( 3495 scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
3515// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); 3496 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
3497 scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys);
3516 3498
3517 PhysicsActor pa = m_rootPart.PhysActor; 3499 PhysicsActor pa = m_rootPart.PhysActor;
3518 3500
3519 if (Scene != null) 3501 if (pa != null && pa.IsPhysical)
3520 { 3502 {
3521 scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); 3503 scale.X = Math.Min(scale.X, Scene.m_maxPhys);
3522 scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); 3504 scale.Y = Math.Min(scale.Y, Scene.m_maxPhys);
3523 scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); 3505 scale.Z = Math.Min(scale.Z, Scene.m_maxPhys);
3524
3525 if (pa != null && pa.IsPhysical)
3526 {
3527 scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
3528 scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
3529 scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
3530 }
3531 } 3506 }
3532 3507
3533 float x = (scale.X / RootPart.Scale.X); 3508 float x = (scale.X / RootPart.Scale.X);
3534 float y = (scale.Y / RootPart.Scale.Y); 3509 float y = (scale.Y / RootPart.Scale.Y);
3535 float z = (scale.Z / RootPart.Scale.Z); 3510 float z = (scale.Z / RootPart.Scale.Z);
3536 3511
3537 SceneObjectPart[] parts = m_parts.GetArray(); 3512 SceneObjectPart[] parts;
3538 3513 if (x > 1.0f || y > 1.0f || z > 1.0f)
3539 if (Scene != null & (x > 1.0f || y > 1.0f || z > 1.0f))
3540 { 3514 {
3515 parts = m_parts.GetArray();
3541 for (int i = 0; i < parts.Length; i++) 3516 for (int i = 0; i < parts.Length; i++)
3542 { 3517 {
3543 SceneObjectPart obPart = parts[i]; 3518 SceneObjectPart obPart = parts[i];
@@ -3550,7 +3525,7 @@ namespace OpenSim.Region.Framework.Scenes
3550 3525
3551 if (pa != null && pa.IsPhysical) 3526 if (pa != null && pa.IsPhysical)
3552 { 3527 {
3553 if (oldSize.X * x > Scene.m_maxPhys) 3528 if (oldSize.X * x > m_scene.m_maxPhys)
3554 { 3529 {
3555 f = m_scene.m_maxPhys / oldSize.X; 3530 f = m_scene.m_maxPhys / oldSize.X;
3556 a = f / x; 3531 a = f / x;
@@ -3558,16 +3533,8 @@ namespace OpenSim.Region.Framework.Scenes
3558 y *= a; 3533 y *= a;
3559 z *= a; 3534 z *= a;
3560 } 3535 }
3561 else if (oldSize.X * x < Scene.m_minPhys)
3562 {
3563 f = m_scene.m_minPhys / oldSize.X;
3564 a = f / x;
3565 x *= a;
3566 y *= a;
3567 z *= a;
3568 }
3569 3536
3570 if (oldSize.Y * y > Scene.m_maxPhys) 3537 if (oldSize.Y * y > m_scene.m_maxPhys)
3571 { 3538 {
3572 f = m_scene.m_maxPhys / oldSize.Y; 3539 f = m_scene.m_maxPhys / oldSize.Y;
3573 a = f / y; 3540 a = f / y;
@@ -3575,16 +3542,8 @@ namespace OpenSim.Region.Framework.Scenes
3575 y *= a; 3542 y *= a;
3576 z *= a; 3543 z *= a;
3577 } 3544 }
3578 else if (oldSize.Y * y < Scene.m_minPhys)
3579 {
3580 f = m_scene.m_minPhys / oldSize.Y;
3581 a = f / y;
3582 x *= a;
3583 y *= a;
3584 z *= a;
3585 }
3586 3545
3587 if (oldSize.Z * z > Scene.m_maxPhys) 3546 if (oldSize.Z * z > m_scene.m_maxPhys)
3588 { 3547 {
3589 f = m_scene.m_maxPhys / oldSize.Z; 3548 f = m_scene.m_maxPhys / oldSize.Z;
3590 a = f / z; 3549 a = f / z;
@@ -3592,18 +3551,10 @@ namespace OpenSim.Region.Framework.Scenes
3592 y *= a; 3551 y *= a;
3593 z *= a; 3552 z *= a;
3594 } 3553 }
3595 else if (oldSize.Z * z < Scene.m_minPhys)
3596 {
3597 f = m_scene.m_minPhys / oldSize.Z;
3598 a = f / z;
3599 x *= a;
3600 y *= a;
3601 z *= a;
3602 }
3603 } 3554 }
3604 else 3555 else
3605 { 3556 {
3606 if (oldSize.X * x > Scene.m_maxNonphys) 3557 if (oldSize.X * x > m_scene.m_maxNonphys)
3607 { 3558 {
3608 f = m_scene.m_maxNonphys / oldSize.X; 3559 f = m_scene.m_maxNonphys / oldSize.X;
3609 a = f / x; 3560 a = f / x;
@@ -3611,16 +3562,8 @@ namespace OpenSim.Region.Framework.Scenes
3611 y *= a; 3562 y *= a;
3612 z *= a; 3563 z *= a;
3613 } 3564 }
3614 else if (oldSize.X * x < Scene.m_minNonphys)
3615 {
3616 f = m_scene.m_minNonphys / oldSize.X;
3617 a = f / x;
3618 x *= a;
3619 y *= a;
3620 z *= a;
3621 }
3622 3565
3623 if (oldSize.Y * y > Scene.m_maxNonphys) 3566 if (oldSize.Y * y > m_scene.m_maxNonphys)
3624 { 3567 {
3625 f = m_scene.m_maxNonphys / oldSize.Y; 3568 f = m_scene.m_maxNonphys / oldSize.Y;
3626 a = f / y; 3569 a = f / y;
@@ -3628,16 +3571,8 @@ namespace OpenSim.Region.Framework.Scenes
3628 y *= a; 3571 y *= a;
3629 z *= a; 3572 z *= a;
3630 } 3573 }
3631 else if (oldSize.Y * y < Scene.m_minNonphys)
3632 {
3633 f = m_scene.m_minNonphys / oldSize.Y;
3634 a = f / y;
3635 x *= a;
3636 y *= a;
3637 z *= a;
3638 }
3639 3574
3640 if (oldSize.Z * z > Scene.m_maxNonphys) 3575 if (oldSize.Z * z > m_scene.m_maxNonphys)
3641 { 3576 {
3642 f = m_scene.m_maxNonphys / oldSize.Z; 3577 f = m_scene.m_maxNonphys / oldSize.Z;
3643 a = f / z; 3578 a = f / z;
@@ -3645,14 +3580,6 @@ namespace OpenSim.Region.Framework.Scenes
3645 y *= a; 3580 y *= a;
3646 z *= a; 3581 z *= a;
3647 } 3582 }
3648 else if (oldSize.Z * z < Scene.m_minNonphys)
3649 {
3650 f = m_scene.m_minNonphys / oldSize.Z;
3651 a = f / z;
3652 x *= a;
3653 y *= a;
3654 z *= a;
3655 }
3656 } 3583 }
3657 } 3584 }
3658 } 3585 }
@@ -3665,6 +3592,7 @@ namespace OpenSim.Region.Framework.Scenes
3665 3592
3666 RootPart.Resize(prevScale); 3593 RootPart.Resize(prevScale);
3667 3594
3595 parts = m_parts.GetArray();
3668 for (int i = 0; i < parts.Length; i++) 3596 for (int i = 0; i < parts.Length; i++)
3669 { 3597 {
3670 SceneObjectPart obPart = parts[i]; 3598 SceneObjectPart obPart = parts[i];