diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 213 |
1 files changed, 91 insertions, 122 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 2d71372..92f2d54 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2499,6 +2499,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2499 | if (linkPart.PhysActor != null) | 2499 | if (linkPart.PhysActor != null) |
2500 | linkPart.PhysActor.Building = true; | 2500 | linkPart.PhysActor.Building = true; |
2501 | 2501 | ||
2502 | // physics flags from group to be applied to linked parts | ||
2503 | bool grpusephys = UsesPhysics; | ||
2504 | bool grptemporary = IsTemporary; | ||
2505 | bool gprphantom = IsPhantom; | ||
2506 | |||
2502 | Vector3 oldGroupPosition = linkPart.GroupPosition; | 2507 | Vector3 oldGroupPosition = linkPart.GroupPosition; |
2503 | Quaternion oldRootRotation = linkPart.RotationOffset; | 2508 | Quaternion oldRootRotation = linkPart.RotationOffset; |
2504 | 2509 | ||
@@ -2542,7 +2547,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2542 | linkPart.SetParent(this); | 2547 | linkPart.SetParent(this); |
2543 | linkPart.CreateSelected = true; | 2548 | linkPart.CreateSelected = true; |
2544 | 2549 | ||
2545 | // let physics know | 2550 | // let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now |
2551 | linkPart.UpdatePrimFlags(grpusephys, grptemporary, gprphantom, linkPart.VolumeDetectActive, true); | ||
2546 | if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical) | 2552 | if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical) |
2547 | { | 2553 | { |
2548 | linkPart.PhysActor.link(m_rootPart.PhysActor); | 2554 | linkPart.PhysActor.link(m_rootPart.PhysActor); |
@@ -2564,6 +2570,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2564 | { | 2570 | { |
2565 | LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++); | 2571 | LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++); |
2566 | // let physics know | 2572 | // let physics know |
2573 | part.UpdatePrimFlags(grpusephys, grptemporary, gprphantom, part.VolumeDetectActive, true); | ||
2567 | if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical) | 2574 | if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical) |
2568 | { | 2575 | { |
2569 | part.PhysActor.link(m_rootPart.PhysActor); | 2576 | part.PhysActor.link(m_rootPart.PhysActor); |
@@ -3117,10 +3124,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3117 | /// <param name="scale"></param> | 3124 | /// <param name="scale"></param> |
3118 | public void GroupResize(Vector3 scale) | 3125 | public void GroupResize(Vector3 scale) |
3119 | { | 3126 | { |
3120 | // m_log.DebugFormat( | ||
3121 | // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); | ||
3122 | // RootPart.StoreUndoState(true); | ||
3123 | |||
3124 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); | 3127 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); |
3125 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); | 3128 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); |
3126 | scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); | 3129 | scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); |
@@ -3145,7 +3148,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3145 | SceneObjectPart obPart = parts[i]; | 3148 | SceneObjectPart obPart = parts[i]; |
3146 | if (obPart.UUID != m_rootPart.UUID) | 3149 | if (obPart.UUID != m_rootPart.UUID) |
3147 | { | 3150 | { |
3148 | // obPart.IgnoreUndoUpdate = true; | ||
3149 | Vector3 oldSize = new Vector3(obPart.Scale); | 3151 | Vector3 oldSize = new Vector3(obPart.Scale); |
3150 | 3152 | ||
3151 | float f = 1.0f; | 3153 | float f = 1.0f; |
@@ -3209,8 +3211,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3209 | z *= a; | 3211 | z *= a; |
3210 | } | 3212 | } |
3211 | } | 3213 | } |
3212 | |||
3213 | // obPart.IgnoreUndoUpdate = false; | ||
3214 | } | 3214 | } |
3215 | } | 3215 | } |
3216 | } | 3216 | } |
@@ -3219,9 +3219,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3219 | prevScale.X *= x; | 3219 | prevScale.X *= x; |
3220 | prevScale.Y *= y; | 3220 | prevScale.Y *= y; |
3221 | prevScale.Z *= z; | 3221 | prevScale.Z *= z; |
3222 | // RootPart.IgnoreUndoUpdate = true; | 3222 | |
3223 | RootPart.Resize(prevScale); | 3223 | RootPart.Resize(prevScale); |
3224 | // RootPart.IgnoreUndoUpdate = false; | ||
3225 | 3224 | ||
3226 | parts = m_parts.GetArray(); | 3225 | parts = m_parts.GetArray(); |
3227 | for (int i = 0; i < parts.Length; i++) | 3226 | for (int i = 0; i < parts.Length; i++) |
@@ -3230,8 +3229,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3230 | 3229 | ||
3231 | if (obPart.UUID != m_rootPart.UUID) | 3230 | if (obPart.UUID != m_rootPart.UUID) |
3232 | { | 3231 | { |
3233 | // obPart.IgnoreUndoUpdate = true; | ||
3234 | |||
3235 | Vector3 currentpos = new Vector3(obPart.OffsetPosition); | 3232 | Vector3 currentpos = new Vector3(obPart.OffsetPosition); |
3236 | currentpos.X *= x; | 3233 | currentpos.X *= x; |
3237 | currentpos.Y *= y; | 3234 | currentpos.Y *= y; |
@@ -3244,18 +3241,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3244 | 3241 | ||
3245 | obPart.Resize(newSize); | 3242 | obPart.Resize(newSize); |
3246 | obPart.UpdateOffSet(currentpos); | 3243 | obPart.UpdateOffSet(currentpos); |
3247 | |||
3248 | // obPart.IgnoreUndoUpdate = false; | ||
3249 | } | 3244 | } |
3250 | 3245 | ||
3251 | // obPart.IgnoreUndoUpdate = false; | ||
3252 | HasGroupChanged = true; | 3246 | HasGroupChanged = true; |
3253 | m_rootPart.TriggerScriptChangedEvent(Changed.SCALE); | 3247 | m_rootPart.TriggerScriptChangedEvent(Changed.SCALE); |
3254 | ScheduleGroupForTerseUpdate(); | 3248 | ScheduleGroupForTerseUpdate(); |
3255 | } | 3249 | } |
3256 | |||
3257 | // m_log.DebugFormat( | ||
3258 | // "[SCENE OBJECT GROUP]: Finished group resizing {0} {1} to {2}", Name, LocalId, RootPart.Scale); | ||
3259 | } | 3250 | } |
3260 | 3251 | ||
3261 | #endregion | 3252 | #endregion |
@@ -3268,14 +3259,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3268 | /// <param name="pos"></param> | 3259 | /// <param name="pos"></param> |
3269 | public void UpdateGroupPosition(Vector3 pos) | 3260 | public void UpdateGroupPosition(Vector3 pos) |
3270 | { | 3261 | { |
3271 | // m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos); | ||
3272 | |||
3273 | // RootPart.StoreUndoState(true); | ||
3274 | |||
3275 | // SceneObjectPart[] parts = m_parts.GetArray(); | ||
3276 | // for (int i = 0; i < parts.Length; i++) | ||
3277 | // parts[i].StoreUndoState(); | ||
3278 | |||
3279 | if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) | 3262 | if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) |
3280 | { | 3263 | { |
3281 | if (IsAttachment) | 3264 | if (IsAttachment) |
@@ -3307,22 +3290,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3307 | /// </summary> | 3290 | /// </summary> |
3308 | /// <param name="pos"></param> | 3291 | /// <param name="pos"></param> |
3309 | /// <param name="localID"></param> | 3292 | /// <param name="localID"></param> |
3293 | /// | ||
3294 | |||
3310 | public void UpdateSinglePosition(Vector3 pos, uint localID) | 3295 | public void UpdateSinglePosition(Vector3 pos, uint localID) |
3311 | { | 3296 | { |
3312 | SceneObjectPart part = GetChildPart(localID); | 3297 | SceneObjectPart part = GetChildPart(localID); |
3313 | 3298 | ||
3314 | // SceneObjectPart[] parts = m_parts.GetArray(); | ||
3315 | // for (int i = 0; i < parts.Length; i++) | ||
3316 | // parts[i].StoreUndoState(); | ||
3317 | |||
3318 | if (part != null) | 3299 | if (part != null) |
3319 | { | 3300 | { |
3320 | // m_log.DebugFormat( | ||
3321 | // "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos); | ||
3322 | |||
3323 | // part.StoreUndoState(false); | ||
3324 | // part.IgnoreUndoUpdate = true; | ||
3325 | |||
3326 | // unlock parts position change | 3301 | // unlock parts position change |
3327 | if (m_rootPart.PhysActor != null) | 3302 | if (m_rootPart.PhysActor != null) |
3328 | m_rootPart.PhysActor.Building = true; | 3303 | m_rootPart.PhysActor.Building = true; |
@@ -3340,7 +3315,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3340 | m_rootPart.PhysActor.Building = false; | 3315 | m_rootPart.PhysActor.Building = false; |
3341 | 3316 | ||
3342 | HasGroupChanged = true; | 3317 | HasGroupChanged = true; |
3343 | // part.IgnoreUndoUpdate = false; | ||
3344 | } | 3318 | } |
3345 | } | 3319 | } |
3346 | 3320 | ||
@@ -3350,13 +3324,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3350 | /// <param name="pos"></param> | 3324 | /// <param name="pos"></param> |
3351 | public void UpdateRootPosition(Vector3 pos) | 3325 | public void UpdateRootPosition(Vector3 pos) |
3352 | { | 3326 | { |
3353 | // m_log.DebugFormat( | 3327 | // needs to be called with phys building true |
3354 | // "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos); | ||
3355 | |||
3356 | // SceneObjectPart[] parts = m_parts.GetArray(); | ||
3357 | // for (int i = 0; i < parts.Length; i++) | ||
3358 | // parts[i].StoreUndoState(); | ||
3359 | |||
3360 | Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); | 3328 | Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); |
3361 | Vector3 oldPos = | 3329 | Vector3 oldPos = |
3362 | new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, | 3330 | new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, |
@@ -3376,17 +3344,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3376 | obPart.OffsetPosition = obPart.OffsetPosition + diff; | 3344 | obPart.OffsetPosition = obPart.OffsetPosition + diff; |
3377 | } | 3345 | } |
3378 | 3346 | ||
3379 | //We have to set undoing here because otherwise an undo state will be saved | 3347 | AbsolutePosition = newPos; |
3380 | // if (!m_rootPart.Undoing) | ||
3381 | // { | ||
3382 | // m_rootPart.Undoing = true; | ||
3383 | AbsolutePosition = newPos; | ||
3384 | // m_rootPart.Undoing = false; | ||
3385 | // } | ||
3386 | // else | ||
3387 | // { | ||
3388 | // AbsolutePosition = newPos; | ||
3389 | // } | ||
3390 | 3348 | ||
3391 | HasGroupChanged = true; | 3349 | HasGroupChanged = true; |
3392 | if (m_rootPart.Undoing) | 3350 | if (m_rootPart.Undoing) |
@@ -3409,17 +3367,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3409 | /// <param name="rot"></param> | 3367 | /// <param name="rot"></param> |
3410 | public void UpdateGroupRotationR(Quaternion rot) | 3368 | public void UpdateGroupRotationR(Quaternion rot) |
3411 | { | 3369 | { |
3412 | // m_log.DebugFormat( | ||
3413 | // "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot); | ||
3414 | |||
3415 | // SceneObjectPart[] parts = m_parts.GetArray(); | ||
3416 | // for (int i = 0; i < parts.Length; i++) | ||
3417 | // parts[i].StoreUndoState(); | ||
3418 | |||
3419 | // m_rootPart.StoreUndoState(true); | ||
3420 | |||
3421 | // m_rootPart.UpdateRotation(rot); | ||
3422 | |||
3423 | PhysicsActor actor = m_rootPart.PhysActor; | 3370 | PhysicsActor actor = m_rootPart.PhysActor; |
3424 | if (actor != null) | 3371 | if (actor != null) |
3425 | { | 3372 | { |
@@ -3438,16 +3385,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3438 | /// <param name="rot"></param> | 3385 | /// <param name="rot"></param> |
3439 | public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) | 3386 | public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) |
3440 | { | 3387 | { |
3441 | // m_log.DebugFormat( | ||
3442 | // "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot); | ||
3443 | |||
3444 | // SceneObjectPart[] parts = m_parts.GetArray(); | ||
3445 | // for (int i = 0; i < parts.Length; i++) | ||
3446 | // parts[i].StoreUndoState(); | ||
3447 | |||
3448 | // RootPart.StoreUndoState(true); | ||
3449 | // RootPart.IgnoreUndoUpdate = true; | ||
3450 | |||
3451 | m_rootPart.UpdateRotation(rot); | 3388 | m_rootPart.UpdateRotation(rot); |
3452 | 3389 | ||
3453 | PhysicsActor actor = m_rootPart.PhysActor; | 3390 | PhysicsActor actor = m_rootPart.PhysActor; |
@@ -3461,8 +3398,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3461 | 3398 | ||
3462 | HasGroupChanged = true; | 3399 | HasGroupChanged = true; |
3463 | ScheduleGroupForTerseUpdate(); | 3400 | ScheduleGroupForTerseUpdate(); |
3464 | |||
3465 | // RootPart.IgnoreUndoUpdate = false; | ||
3466 | } | 3401 | } |
3467 | 3402 | ||
3468 | /// <summary> | 3403 | /// <summary> |
@@ -3477,9 +3412,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3477 | 3412 | ||
3478 | if (part != null) | 3413 | if (part != null) |
3479 | { | 3414 | { |
3480 | // m_log.DebugFormat( | ||
3481 | // "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot); | ||
3482 | |||
3483 | if (m_rootPart.PhysActor != null) | 3415 | if (m_rootPart.PhysActor != null) |
3484 | m_rootPart.PhysActor.Building = true; | 3416 | m_rootPart.PhysActor.Building = true; |
3485 | 3417 | ||
@@ -3507,30 +3439,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3507 | SceneObjectPart part = GetChildPart(localID); | 3439 | SceneObjectPart part = GetChildPart(localID); |
3508 | if (part != null) | 3440 | if (part != null) |
3509 | { | 3441 | { |
3510 | // m_log.DebugFormat( | ||
3511 | // "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}", | ||
3512 | // part.Name, part.LocalId, rot); | ||
3513 | |||
3514 | // part.StoreUndoState(); | ||
3515 | // part.IgnoreUndoUpdate = true; | ||
3516 | |||
3517 | if (m_rootPart.PhysActor != null) | 3442 | if (m_rootPart.PhysActor != null) |
3518 | m_rootPart.PhysActor.Building = true; | 3443 | m_rootPart.PhysActor.Building = true; |
3519 | 3444 | ||
3520 | if (part.UUID == m_rootPart.UUID) | 3445 | if (part.UUID == m_rootPart.UUID) |
3521 | { | 3446 | { |
3522 | UpdateRootRotation(rot); | 3447 | UpdateRootRotation(rot); |
3523 | /* if (!m_rootPart.Undoing) | 3448 | AbsolutePosition = pos; |
3524 | { | ||
3525 | m_rootPart.Undoing = true; | ||
3526 | AbsolutePosition = pos; | ||
3527 | m_rootPart.Undoing = false; | ||
3528 | } | ||
3529 | else | ||
3530 | { | ||
3531 | */ | ||
3532 | AbsolutePosition = pos; | ||
3533 | // } | ||
3534 | } | 3449 | } |
3535 | else | 3450 | else |
3536 | { | 3451 | { |
@@ -3540,8 +3455,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3540 | 3455 | ||
3541 | if (m_rootPart.PhysActor != null) | 3456 | if (m_rootPart.PhysActor != null) |
3542 | m_rootPart.PhysActor.Building = false; | 3457 | m_rootPart.PhysActor.Building = false; |
3543 | |||
3544 | // part.IgnoreUndoUpdate = false; | ||
3545 | } | 3458 | } |
3546 | } | 3459 | } |
3547 | 3460 | ||
@@ -3551,13 +3464,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3551 | /// <param name="rot"></param> | 3464 | /// <param name="rot"></param> |
3552 | public void UpdateRootRotation(Quaternion rot) | 3465 | public void UpdateRootRotation(Quaternion rot) |
3553 | { | 3466 | { |
3554 | // m_log.DebugFormat( | 3467 | // needs to be called with phys building true |
3555 | // "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}", | ||
3556 | // Name, LocalId, rot); | ||
3557 | |||
3558 | Quaternion axRot = rot; | 3468 | Quaternion axRot = rot; |
3559 | Quaternion oldParentRot = m_rootPart.RotationOffset; | 3469 | Quaternion oldParentRot = m_rootPart.RotationOffset; |
3560 | // m_rootPart.StoreUndoState(); | ||
3561 | 3470 | ||
3562 | //Don't use UpdateRotation because it schedules an update prematurely | 3471 | //Don't use UpdateRotation because it schedules an update prematurely |
3563 | m_rootPart.RotationOffset = rot; | 3472 | m_rootPart.RotationOffset = rot; |
@@ -3573,8 +3482,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3573 | SceneObjectPart prim = parts[i]; | 3482 | SceneObjectPart prim = parts[i]; |
3574 | if (prim.UUID != m_rootPart.UUID) | 3483 | if (prim.UUID != m_rootPart.UUID) |
3575 | { | 3484 | { |
3576 | // prim.IgnoreUndoUpdate = true; | ||
3577 | |||
3578 | Quaternion NewRot = oldParentRot * prim.RotationOffset; | 3485 | Quaternion NewRot = oldParentRot * prim.RotationOffset; |
3579 | NewRot = Quaternion.Inverse(axRot) * NewRot; | 3486 | NewRot = Quaternion.Inverse(axRot) * NewRot; |
3580 | prim.RotationOffset = NewRot; | 3487 | prim.RotationOffset = NewRot; |
@@ -3584,26 +3491,88 @@ namespace OpenSim.Region.Framework.Scenes | |||
3584 | axPos *= oldParentRot; | 3491 | axPos *= oldParentRot; |
3585 | axPos *= Quaternion.Inverse(axRot); | 3492 | axPos *= Quaternion.Inverse(axRot); |
3586 | prim.OffsetPosition = axPos; | 3493 | prim.OffsetPosition = axPos; |
3587 | |||
3588 | // prim.IgnoreUndoUpdate = false; | ||
3589 | } | 3494 | } |
3590 | } | 3495 | } |
3591 | 3496 | ||
3592 | // for (int i = 0; i < parts.Length; i++) | ||
3593 | // { | ||
3594 | // SceneObjectPart childpart = parts[i]; | ||
3595 | // if (childpart != m_rootPart) | ||
3596 | // { | ||
3597 | //// childpart.IgnoreUndoUpdate = false; | ||
3598 | //// childpart.StoreUndoState(); | ||
3599 | // } | ||
3600 | // } | ||
3601 | HasGroupChanged = true; | 3497 | HasGroupChanged = true; |
3602 | ScheduleGroupForFullUpdate(); | 3498 | ScheduleGroupForFullUpdate(); |
3499 | } | ||
3603 | 3500 | ||
3604 | // m_log.DebugFormat( | 3501 | public void doChangeObject(SceneObjectPart part, ObjectChangeData data) |
3605 | // "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}", | 3502 | { |
3606 | // Name, LocalId, rot); | 3503 | // TODO this still as excessive ScheduleGroupForTerseUpdate()s |
3504 | |||
3505 | if (part != null && part.ParentGroup != null) | ||
3506 | { | ||
3507 | ObjectChangeWhat what = data.what; | ||
3508 | bool togroup = ((what & ObjectChangeWhat.Group) != 0); | ||
3509 | // bool uniform = ((what & ObjectChangeWhat.UniformScale) != 0); not in use | ||
3510 | |||
3511 | SceneObjectGroup group = part.ParentGroup; | ||
3512 | PhysicsActor pha = group.RootPart.PhysActor; | ||
3513 | |||
3514 | bool needgrpUpdate = false; | ||
3515 | |||
3516 | if (togroup) | ||
3517 | { | ||
3518 | // related to group | ||
3519 | if ((what & ObjectChangeWhat.Position) != 0) | ||
3520 | { | ||
3521 | group.AbsolutePosition = data.position; | ||
3522 | needgrpUpdate = true; | ||
3523 | } | ||
3524 | if ((what & ObjectChangeWhat.Rotation) != 0) | ||
3525 | group.RootPart.UpdateRotation(data.rotation); | ||
3526 | if ((what & ObjectChangeWhat.Scale) != 0) | ||
3527 | { | ||
3528 | if (pha != null) | ||
3529 | pha.Building = true; | ||
3530 | group.GroupResize(data.scale); | ||
3531 | if (pha != null) | ||
3532 | pha.Building = false; | ||
3533 | } | ||
3534 | } | ||
3535 | else | ||
3536 | { | ||
3537 | // related to single prim in a link-set ( ie group) | ||
3538 | if (pha != null) | ||
3539 | pha.Building = true; | ||
3540 | |||
3541 | // must deal with root part specially for position and rotation | ||
3542 | // so parts offset positions or rotations are fixed | ||
3543 | |||
3544 | if (part == group.RootPart) | ||
3545 | { | ||
3546 | if ((what & ObjectChangeWhat.Position) != 0) | ||
3547 | group.UpdateRootPosition(data.position); | ||
3548 | if ((what & ObjectChangeWhat.Rotation) != 0) | ||
3549 | group.UpdateRootRotation(data.rotation); | ||
3550 | } | ||
3551 | else | ||
3552 | { | ||
3553 | |||
3554 | if ((what & ObjectChangeWhat.Position) != 0) | ||
3555 | { | ||
3556 | part.OffsetPosition = data.position; | ||
3557 | needgrpUpdate = true; | ||
3558 | } | ||
3559 | if ((what & ObjectChangeWhat.Rotation) != 0) | ||
3560 | part.UpdateRotation(data.rotation); | ||
3561 | } | ||
3562 | |||
3563 | if ((what & ObjectChangeWhat.Scale) != 0) | ||
3564 | part.Resize(data.scale); | ||
3565 | |||
3566 | if (pha != null) | ||
3567 | pha.Building = false; | ||
3568 | } | ||
3569 | |||
3570 | if (needgrpUpdate) | ||
3571 | { | ||
3572 | HasGroupChanged = true; | ||
3573 | ScheduleGroupForTerseUpdate(); | ||
3574 | } | ||
3575 | } | ||
3607 | } | 3576 | } |
3608 | 3577 | ||
3609 | #endregion | 3578 | #endregion |