diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 58 |
1 files changed, 48 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 92f2d54..92fd1fa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3498,6 +3498,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3498 | ScheduleGroupForFullUpdate(); | 3498 | ScheduleGroupForFullUpdate(); |
3499 | } | 3499 | } |
3500 | 3500 | ||
3501 | private enum updatetype :int | ||
3502 | { | ||
3503 | none = 0, | ||
3504 | partterse = 1, | ||
3505 | partfull = 2, | ||
3506 | groupterse = 3, | ||
3507 | groupfull = 4 | ||
3508 | } | ||
3509 | |||
3501 | public void doChangeObject(SceneObjectPart part, ObjectChangeData data) | 3510 | public void doChangeObject(SceneObjectPart part, ObjectChangeData data) |
3502 | { | 3511 | { |
3503 | // TODO this still as excessive ScheduleGroupForTerseUpdate()s | 3512 | // TODO this still as excessive ScheduleGroupForTerseUpdate()s |
@@ -3511,7 +3520,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3511 | SceneObjectGroup group = part.ParentGroup; | 3520 | SceneObjectGroup group = part.ParentGroup; |
3512 | PhysicsActor pha = group.RootPart.PhysActor; | 3521 | PhysicsActor pha = group.RootPart.PhysActor; |
3513 | 3522 | ||
3514 | bool needgrpUpdate = false; | 3523 | updatetype updateType = updatetype.none; |
3515 | 3524 | ||
3516 | if (togroup) | 3525 | if (togroup) |
3517 | { | 3526 | { |
@@ -3519,15 +3528,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
3519 | if ((what & ObjectChangeWhat.Position) != 0) | 3528 | if ((what & ObjectChangeWhat.Position) != 0) |
3520 | { | 3529 | { |
3521 | group.AbsolutePosition = data.position; | 3530 | group.AbsolutePosition = data.position; |
3522 | needgrpUpdate = true; | 3531 | updateType = updatetype.groupterse; |
3523 | } | 3532 | } |
3524 | if ((what & ObjectChangeWhat.Rotation) != 0) | 3533 | if ((what & ObjectChangeWhat.Rotation) != 0) |
3534 | { | ||
3525 | group.RootPart.UpdateRotation(data.rotation); | 3535 | group.RootPart.UpdateRotation(data.rotation); |
3536 | updateType = updatetype.none; | ||
3537 | } | ||
3526 | if ((what & ObjectChangeWhat.Scale) != 0) | 3538 | if ((what & ObjectChangeWhat.Scale) != 0) |
3527 | { | 3539 | { |
3528 | if (pha != null) | 3540 | if (pha != null) |
3529 | pha.Building = true; | 3541 | pha.Building = true; |
3542 | |||
3530 | group.GroupResize(data.scale); | 3543 | group.GroupResize(data.scale); |
3544 | updateType = updatetype.none; | ||
3545 | |||
3531 | if (pha != null) | 3546 | if (pha != null) |
3532 | pha.Building = false; | 3547 | pha.Building = false; |
3533 | } | 3548 | } |
@@ -3547,30 +3562,53 @@ namespace OpenSim.Region.Framework.Scenes | |||
3547 | group.UpdateRootPosition(data.position); | 3562 | group.UpdateRootPosition(data.position); |
3548 | if ((what & ObjectChangeWhat.Rotation) != 0) | 3563 | if ((what & ObjectChangeWhat.Rotation) != 0) |
3549 | group.UpdateRootRotation(data.rotation); | 3564 | group.UpdateRootRotation(data.rotation); |
3565 | if ((what & ObjectChangeWhat.Scale) != 0) | ||
3566 | part.Resize(data.scale); | ||
3550 | } | 3567 | } |
3551 | else | 3568 | else |
3552 | { | 3569 | { |
3553 | |||
3554 | if ((what & ObjectChangeWhat.Position) != 0) | 3570 | if ((what & ObjectChangeWhat.Position) != 0) |
3555 | { | 3571 | { |
3556 | part.OffsetPosition = data.position; | 3572 | part.OffsetPosition = data.position; |
3557 | needgrpUpdate = true; | 3573 | updateType = updatetype.partterse; |
3558 | } | 3574 | } |
3559 | if ((what & ObjectChangeWhat.Rotation) != 0) | 3575 | if ((what & ObjectChangeWhat.Rotation) != 0) |
3576 | { | ||
3560 | part.UpdateRotation(data.rotation); | 3577 | part.UpdateRotation(data.rotation); |
3578 | updateType = updatetype.none; | ||
3579 | } | ||
3580 | if ((what & ObjectChangeWhat.Scale) != 0) | ||
3581 | { | ||
3582 | part.Resize(data.scale); | ||
3583 | updateType = updatetype.none; | ||
3584 | } | ||
3561 | } | 3585 | } |
3562 | 3586 | ||
3563 | if ((what & ObjectChangeWhat.Scale) != 0) | ||
3564 | part.Resize(data.scale); | ||
3565 | |||
3566 | if (pha != null) | 3587 | if (pha != null) |
3567 | pha.Building = false; | 3588 | pha.Building = false; |
3568 | } | 3589 | } |
3569 | 3590 | ||
3570 | if (needgrpUpdate) | 3591 | if (updateType != updatetype.none) |
3571 | { | 3592 | { |
3572 | HasGroupChanged = true; | 3593 | group.HasGroupChanged = true; |
3573 | ScheduleGroupForTerseUpdate(); | 3594 | |
3595 | switch (updateType) | ||
3596 | { | ||
3597 | case updatetype.partterse: | ||
3598 | part.ScheduleTerseUpdate(); | ||
3599 | break; | ||
3600 | case updatetype.partfull: | ||
3601 | part.ScheduleFullUpdate(); | ||
3602 | break; | ||
3603 | case updatetype.groupterse: | ||
3604 | group.ScheduleGroupForTerseUpdate(); | ||
3605 | break; | ||
3606 | case updatetype.groupfull: | ||
3607 | group.ScheduleGroupForFullUpdate(); | ||
3608 | break; | ||
3609 | default: | ||
3610 | break; | ||
3611 | } | ||
3574 | } | 3612 | } |
3575 | } | 3613 | } |
3576 | } | 3614 | } |