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.cs78
1 files changed, 72 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4798481..18e74c1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2742,6 +2742,24 @@ namespace OpenSim.Region.Framework.Scenes
2742 if (objectGroup == this) 2742 if (objectGroup == this)
2743 return; 2743 return;
2744 2744
2745 // If the configured linkset capacity is greater than zero,
2746 // and the new linkset would have a prim count higher than this
2747 // value, do not link it.
2748 if (m_scene.m_linksetCapacity > 0 &&
2749 (PrimCount + objectGroup.PrimCount) >
2750 m_scene.m_linksetCapacity)
2751 {
2752 m_log.DebugFormat(
2753 "[SCENE OBJECT GROUP]: Cannot link group with root" +
2754 " part {0}, {1} ({2} prims) to group with root part" +
2755 " {3}, {4} ({5} prims) because the new linkset" +
2756 " would exceed the configured maximum of {6}",
2757 objectGroup.RootPart.Name, objectGroup.RootPart.UUID,
2758 objectGroup.PrimCount, RootPart.Name, RootPart.UUID,
2759 PrimCount, m_scene.m_linksetCapacity);
2760 return;
2761 }
2762
2745 // 'linkPart' == the root of the group being linked into this group 2763 // 'linkPart' == the root of the group being linked into this group
2746 SceneObjectPart linkPart = objectGroup.m_rootPart; 2764 SceneObjectPart linkPart = objectGroup.m_rootPart;
2747 2765
@@ -3464,17 +3482,17 @@ namespace OpenSim.Region.Framework.Scenes
3464 /// <param name="scale"></param> 3482 /// <param name="scale"></param>
3465 public void GroupResize(Vector3 scale) 3483 public void GroupResize(Vector3 scale)
3466 { 3484 {
3467 scale.X = Math.Min(scale.X, Scene.m_maxNonphys); 3485 scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
3468 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); 3486 scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
3469 scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); 3487 scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
3470 3488
3471 PhysicsActor pa = m_rootPart.PhysActor; 3489 PhysicsActor pa = m_rootPart.PhysActor;
3472 3490
3473 if (pa != null && pa.IsPhysical) 3491 if (pa != null && pa.IsPhysical)
3474 { 3492 {
3475 scale.X = Math.Min(scale.X, Scene.m_maxPhys); 3493 scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
3476 scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); 3494 scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
3477 scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); 3495 scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
3478 } 3496 }
3479 3497
3480 float x = (scale.X / RootPart.Scale.X); 3498 float x = (scale.X / RootPart.Scale.X);
@@ -3505,6 +3523,14 @@ namespace OpenSim.Region.Framework.Scenes
3505 y *= a; 3523 y *= a;
3506 z *= a; 3524 z *= a;
3507 } 3525 }
3526 else if (oldSize.X * x < m_scene.m_minPhys)
3527 {
3528 f = m_scene.m_minPhys / oldSize.X;
3529 a = f / x;
3530 x *= a;
3531 y *= a;
3532 z *= a;
3533 }
3508 3534
3509 if (oldSize.Y * y > m_scene.m_maxPhys) 3535 if (oldSize.Y * y > m_scene.m_maxPhys)
3510 { 3536 {
@@ -3514,6 +3540,14 @@ namespace OpenSim.Region.Framework.Scenes
3514 y *= a; 3540 y *= a;
3515 z *= a; 3541 z *= a;
3516 } 3542 }
3543 else if (oldSize.Y * y < m_scene.m_minPhys)
3544 {
3545 f = m_scene.m_minPhys / oldSize.Y;
3546 a = f / y;
3547 x *= a;
3548 y *= a;
3549 z *= a;
3550 }
3517 3551
3518 if (oldSize.Z * z > m_scene.m_maxPhys) 3552 if (oldSize.Z * z > m_scene.m_maxPhys)
3519 { 3553 {
@@ -3523,6 +3557,14 @@ namespace OpenSim.Region.Framework.Scenes
3523 y *= a; 3557 y *= a;
3524 z *= a; 3558 z *= a;
3525 } 3559 }
3560 else if (oldSize.Z * z < m_scene.m_minPhys)
3561 {
3562 f = m_scene.m_minPhys / oldSize.Z;
3563 a = f / z;
3564 x *= a;
3565 y *= a;
3566 z *= a;
3567 }
3526 } 3568 }
3527 else 3569 else
3528 { 3570 {
@@ -3534,6 +3576,14 @@ namespace OpenSim.Region.Framework.Scenes
3534 y *= a; 3576 y *= a;
3535 z *= a; 3577 z *= a;
3536 } 3578 }
3579 else if (oldSize.X * x < m_scene.m_minNonphys)
3580 {
3581 f = m_scene.m_minNonphys / oldSize.X;
3582 a = f / x;
3583 x *= a;
3584 y *= a;
3585 z *= a;
3586 }
3537 3587
3538 if (oldSize.Y * y > m_scene.m_maxNonphys) 3588 if (oldSize.Y * y > m_scene.m_maxNonphys)
3539 { 3589 {
@@ -3543,6 +3593,14 @@ namespace OpenSim.Region.Framework.Scenes
3543 y *= a; 3593 y *= a;
3544 z *= a; 3594 z *= a;
3545 } 3595 }
3596 else if (oldSize.Y * y < m_scene.m_minNonphys)
3597 {
3598 f = m_scene.m_minNonphys / oldSize.Y;
3599 a = f / y;
3600 x *= a;
3601 y *= a;
3602 z *= a;
3603 }
3546 3604
3547 if (oldSize.Z * z > m_scene.m_maxNonphys) 3605 if (oldSize.Z * z > m_scene.m_maxNonphys)
3548 { 3606 {
@@ -3552,6 +3610,14 @@ namespace OpenSim.Region.Framework.Scenes
3552 y *= a; 3610 y *= a;
3553 z *= a; 3611 z *= a;
3554 } 3612 }
3613 else if (oldSize.Z * z < m_scene.m_minNonphys)
3614 {
3615 f = m_scene.m_minNonphys / oldSize.Z;
3616 a = f / z;
3617 x *= a;
3618 y *= a;
3619 z *= a;
3620 }
3555 } 3621 }
3556 } 3622 }
3557 } 3623 }