diff options
author | Melanie Thielker | 2014-07-19 22:32:07 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-07-19 22:32:07 +0200 |
commit | e1b2ecdfdc5d465ee86d2a726eff2e504c846e79 (patch) | |
tree | fa54372d3e4434ed14ff773c0889364895f87529 /OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |
parent | fix attachments (diff) | |
parent | revert to capsule representation of avatar collider (diff) | |
download | opensim-SC_OLD-e1b2ecdfdc5d465ee86d2a726eff2e504c846e79.zip opensim-SC_OLD-e1b2ecdfdc5d465ee86d2a726eff2e504c846e79.tar.gz opensim-SC_OLD-e1b2ecdfdc5d465ee86d2a726eff2e504c846e79.tar.bz2 opensim-SC_OLD-e1b2ecdfdc5d465ee86d2a726eff2e504c846e79.tar.xz |
Merge branch 'avination-current'
Conflicts:
OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/KeyframeMotion.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 79 |
1 files changed, 64 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 4d153da..49b71e5 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -265,14 +265,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
265 | 265 | ||
266 | private void StartTimer() | 266 | private void StartTimer() |
267 | { | 267 | { |
268 | KeyframeTimer.Add(this); | 268 | lock (m_frames) |
269 | m_timerStopped = false; | 269 | { |
270 | KeyframeTimer.Add(this); | ||
271 | m_timerStopped = false; | ||
272 | } | ||
270 | } | 273 | } |
271 | 274 | ||
272 | private void StopTimer() | 275 | private void StopTimer() |
273 | { | 276 | { |
274 | m_timerStopped = true; | 277 | lock (m_frames) |
275 | KeyframeTimer.Remove(this); | 278 | m_timerStopped = true; |
276 | } | 279 | } |
277 | 280 | ||
278 | public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data) | 281 | public static KeyframeMotion FromData(SceneObjectGroup grp, Byte[] data) |
@@ -427,19 +430,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
427 | } | 430 | } |
428 | else | 431 | else |
429 | { | 432 | { |
430 | m_running = false; | ||
431 | StopTimer(); | 433 | StopTimer(); |
434 | m_running = false; | ||
432 | } | 435 | } |
433 | } | 436 | } |
434 | 437 | ||
435 | public void Stop() | 438 | public void Stop() |
436 | { | 439 | { |
440 | StopTimer(); | ||
437 | m_running = false; | 441 | m_running = false; |
438 | m_isCrossing = false; | 442 | m_isCrossing = false; |
439 | m_waitingCrossing = false; | 443 | m_waitingCrossing = false; |
440 | 444 | ||
441 | StopTimer(); | ||
442 | |||
443 | m_basePosition = m_group.AbsolutePosition; | 445 | m_basePosition = m_group.AbsolutePosition; |
444 | m_baseRotation = m_group.GroupRotation; | 446 | m_baseRotation = m_group.GroupRotation; |
445 | 447 | ||
@@ -452,14 +454,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
452 | 454 | ||
453 | public void Pause() | 455 | public void Pause() |
454 | { | 456 | { |
455 | m_running = false; | ||
456 | StopTimer(); | 457 | StopTimer(); |
458 | m_running = false; | ||
457 | 459 | ||
458 | m_group.RootPart.Velocity = Vector3.Zero; | 460 | m_group.RootPart.Velocity = Vector3.Zero; |
459 | m_group.RootPart.AngularVelocity = Vector3.Zero; | 461 | m_group.RootPart.AngularVelocity = Vector3.Zero; |
460 | m_group.SendGroupRootTerseUpdate(); | 462 | m_group.SendGroupRootTerseUpdate(); |
461 | // m_group.RootPart.ScheduleTerseUpdate(); | 463 | // m_group.RootPart.ScheduleTerseUpdate(); |
464 | } | ||
462 | 465 | ||
466 | public void Suspend() | ||
467 | { | ||
468 | lock (m_frames) | ||
469 | { | ||
470 | if (m_timerStopped) | ||
471 | return; | ||
472 | m_timerStopped = true; | ||
473 | } | ||
474 | } | ||
475 | |||
476 | public void Resume() | ||
477 | { | ||
478 | lock (m_frames) | ||
479 | { | ||
480 | if (!m_timerStopped) | ||
481 | return; | ||
482 | if (m_running && !m_waitingCrossing) | ||
483 | StartTimer(); | ||
484 | } | ||
463 | } | 485 | } |
464 | 486 | ||
465 | private void GetNextList() | 487 | private void GetNextList() |
@@ -550,6 +572,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
550 | 572 | ||
551 | pos = (Vector3)k.Position; | 573 | pos = (Vector3)k.Position; |
552 | rot = (Quaternion)k.Rotation; | 574 | rot = (Quaternion)k.Rotation; |
575 | |||
553 | } | 576 | } |
554 | 577 | ||
555 | m_basePosition = pos; | 578 | m_basePosition = pos; |
@@ -561,14 +584,41 @@ namespace OpenSim.Region.Framework.Scenes | |||
561 | 584 | ||
562 | public void OnTimer(double tickDuration) | 585 | public void OnTimer(double tickDuration) |
563 | { | 586 | { |
587 | if (!Monitor.TryEnter(m_frames)) | ||
588 | return; | ||
589 | if (m_timerStopped) | ||
590 | KeyframeTimer.Remove(this); | ||
591 | else | ||
592 | DoOnTimer(tickDuration); | ||
593 | Monitor.Exit(m_frames); | ||
594 | } | ||
595 | |||
596 | private void Done() | ||
597 | { | ||
598 | KeyframeTimer.Remove(this); | ||
599 | m_timerStopped = true; | ||
600 | m_running = false; | ||
601 | m_isCrossing = false; | ||
602 | m_waitingCrossing = false; | ||
603 | |||
604 | m_basePosition = m_group.AbsolutePosition; | ||
605 | m_baseRotation = m_group.GroupRotation; | ||
606 | |||
607 | m_group.RootPart.Velocity = Vector3.Zero; | ||
608 | m_group.RootPart.AngularVelocity = Vector3.Zero; | ||
609 | m_group.SendGroupRootTerseUpdate(); | ||
610 | // m_group.RootPart.ScheduleTerseUpdate(); | ||
611 | m_frames.Clear(); | ||
612 | } | ||
613 | |||
614 | private void DoOnTimer(double tickDuration) | ||
615 | { | ||
564 | if (m_skipLoops > 0) | 616 | if (m_skipLoops > 0) |
565 | { | 617 | { |
566 | m_skipLoops--; | 618 | m_skipLoops--; |
567 | return; | 619 | return; |
568 | } | 620 | } |
569 | 621 | ||
570 | if (m_timerStopped) // trap events still in air even after a timer.stop | ||
571 | return; | ||
572 | 622 | ||
573 | if (m_group == null) | 623 | if (m_group == null) |
574 | return; | 624 | return; |
@@ -608,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
608 | 658 | ||
609 | if (m_frames.Count == 0) | 659 | if (m_frames.Count == 0) |
610 | { | 660 | { |
611 | Stop(); | 661 | Done(); |
612 | Scene scene = m_group.Scene; | 662 | Scene scene = m_group.Scene; |
613 | 663 | ||
614 | IScriptModule[] scriptModules = scene.RequestModuleInterfaces<IScriptModule>(); | 664 | IScriptModule[] scriptModules = scene.RequestModuleInterfaces<IScriptModule>(); |
@@ -707,11 +757,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
707 | 757 | ||
708 | if (angle > 0.01f) | 758 | if (angle > 0.01f) |
709 | */ | 759 | */ |
710 | if(Math.Abs(step.X - current.X) > 0.001f | 760 | if (Math.Abs(step.X - current.X) > 0.001f |
711 | || Math.Abs(step.Y - current.Y) > 0.001f | 761 | || Math.Abs(step.Y - current.Y) > 0.001f |
712 | || Math.Abs(step.Z - current.Z) > 0.001f) | 762 | || Math.Abs(step.Z - current.Z) > 0.001f) |
713 | // assuming w is a dependente var | 763 | // assuming w is a dependente var |
714 | |||
715 | { | 764 | { |
716 | // m_group.UpdateGroupRotationR(step); | 765 | // m_group.UpdateGroupRotationR(step); |
717 | m_group.RootPart.RotationOffset = step; | 766 | m_group.RootPart.RotationOffset = step; |