aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/KeyframeMotion.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs4
4 files changed, 42 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index edf2bef..5cfba39 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -345,9 +345,9 @@ namespace OpenSim.Region.Framework.Scenes
345 m_baseRotation = m_group.GroupRotation; 345 m_baseRotation = m_group.GroupRotation;
346 346
347 m_group.RootPart.Velocity = Vector3.Zero; 347 m_group.RootPart.Velocity = Vector3.Zero;
348 m_group.RootPart.UpdateAngularVelocity(Vector3.Zero); 348 m_group.RootPart.AngularVelocity = Vector3.Zero;
349 m_group.SendGroupRootTerseUpdate(); 349 m_group.SendGroupRootTerseUpdate();
350 350// m_group.RootPart.ScheduleTerseUpdate();
351 m_frames.Clear(); 351 m_frames.Clear();
352 } 352 }
353 353
@@ -357,8 +357,10 @@ namespace OpenSim.Region.Framework.Scenes
357 RemoveTimer(); 357 RemoveTimer();
358 358
359 m_group.RootPart.Velocity = Vector3.Zero; 359 m_group.RootPart.Velocity = Vector3.Zero;
360 m_group.RootPart.UpdateAngularVelocity(Vector3.Zero); 360 m_group.RootPart.AngularVelocity = Vector3.Zero;
361 m_group.SendGroupRootTerseUpdate(); 361 m_group.SendGroupRootTerseUpdate();
362// m_group.RootPart.ScheduleTerseUpdate();
363
362 } 364 }
363 365
364 private void GetNextList() 366 private void GetNextList()
@@ -490,6 +492,8 @@ namespace OpenSim.Region.Framework.Scenes
490 { 492 {
491 m_group.RootPart.Velocity = Vector3.Zero; 493 m_group.RootPart.Velocity = Vector3.Zero;
492 m_group.SendGroupRootTerseUpdate(); 494 m_group.SendGroupRootTerseUpdate();
495// m_group.RootPart.ScheduleTerseUpdate();
496
493 } 497 }
494 m_inOnTimer = false; 498 m_inOnTimer = false;
495 return; 499 return;
@@ -539,13 +543,15 @@ namespace OpenSim.Region.Framework.Scenes
539 if (steps <= 0.0) 543 if (steps <= 0.0)
540 { 544 {
541 m_group.RootPart.Velocity = Vector3.Zero; 545 m_group.RootPart.Velocity = Vector3.Zero;
542 m_group.RootPart.UpdateAngularVelocity(Vector3.Zero); 546 m_group.RootPart.AngularVelocity = Vector3.Zero;
543 547
544 m_nextPosition = (Vector3)m_currentFrame.Position; 548 m_nextPosition = (Vector3)m_currentFrame.Position;
545 m_group.AbsolutePosition = m_nextPosition; 549 m_group.AbsolutePosition = m_nextPosition;
546 550
547 m_group.UpdateGroupRotationR((Quaternion)m_currentFrame.Rotation); 551 // we are sending imediate updates, no doing force a extra terseUpdate
552// m_group.UpdateGroupRotationR((Quaternion)m_currentFrame.Rotation);
548 553
554 m_group.RootPart.RotationOffset = (Quaternion)m_currentFrame.Rotation;
549 m_frames.RemoveAt(0); 555 m_frames.RemoveAt(0);
550 if (m_frames.Count > 0) 556 if (m_frames.Count > 0)
551 m_currentFrame = m_frames[0]; 557 m_currentFrame = m_frames[0];
@@ -613,7 +619,9 @@ namespace OpenSim.Region.Framework.Scenes
613 // assuming w is a dependente var 619 // assuming w is a dependente var
614 620
615 { 621 {
616 m_group.UpdateGroupRotationR(step); 622// m_group.UpdateGroupRotationR(step);
623 m_group.RootPart.RotationOffset = step;
624
617 //m_group.RootPart.UpdateAngularVelocity(m_currentFrame.AngularVelocity / 2); 625 //m_group.RootPart.UpdateAngularVelocity(m_currentFrame.AngularVelocity / 2);
618 update = true; 626 update = true;
619 } 627 }
@@ -622,6 +630,8 @@ namespace OpenSim.Region.Framework.Scenes
622 630
623 if (update) 631 if (update)
624 m_group.SendGroupRootTerseUpdate(); 632 m_group.SendGroupRootTerseUpdate();
633// m_group.RootPart.ScheduleTerseUpdate();
634
625 635
626 } 636 }
627 catch ( Exception ex) 637 catch ( Exception ex)
@@ -672,6 +682,7 @@ namespace OpenSim.Region.Framework.Scenes
672 { 682 {
673 m_group.RootPart.Velocity = Vector3.Zero; 683 m_group.RootPart.Velocity = Vector3.Zero;
674 m_group.SendGroupRootTerseUpdate(); 684 m_group.SendGroupRootTerseUpdate();
685// m_group.RootPart.ScheduleTerseUpdate();
675 } 686 }
676 } 687 }
677 688
@@ -683,6 +694,7 @@ namespace OpenSim.Region.Framework.Scenes
683 { 694 {
684 m_group.RootPart.Velocity = Vector3.Zero; 695 m_group.RootPart.Velocity = Vector3.Zero;
685 m_group.SendGroupRootTerseUpdate(); 696 m_group.SendGroupRootTerseUpdate();
697// m_group.RootPart.ScheduleTerseUpdate();
686 698
687 if (m_running && m_timer != null) 699 if (m_running && m_timer != null)
688 { 700 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7490ac8..dd8541c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -316,9 +316,6 @@ namespace OpenSim.Region.Framework.Scenes
316 get { return RootPart.VolumeDetectActive; } 316 get { return RootPart.VolumeDetectActive; }
317 } 317 }
318 318
319 private Vector3 lastPhysGroupPos;
320 private Quaternion lastPhysGroupRot;
321
322 private bool m_isBackedUp; 319 private bool m_isBackedUp;
323 320
324 public bool IsBackedUp 321 public bool IsBackedUp
@@ -2554,6 +2551,7 @@ namespace OpenSim.Region.Framework.Scenes
2554 2551
2555 #endregion 2552 #endregion
2556 2553
2554
2557 public override void Update() 2555 public override void Update()
2558 { 2556 {
2559 // Check that the group was not deleted before the scheduled update 2557 // Check that the group was not deleted before the scheduled update
@@ -2572,19 +2570,8 @@ namespace OpenSim.Region.Framework.Scenes
2572 // check to see if the physical position or rotation warrant an update. 2570 // check to see if the physical position or rotation warrant an update.
2573 if (m_rootPart.UpdateFlag == UpdateRequired.NONE) 2571 if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
2574 { 2572 {
2575 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); 2573 // rootpart SendScheduledUpdates will check if a update is needed
2576 2574 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2577 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
2578 {
2579 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2580 lastPhysGroupPos = AbsolutePosition;
2581 }
2582
2583 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
2584 {
2585 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
2586 lastPhysGroupRot = GroupRotation;
2587 }
2588 } 2575 }
2589 2576
2590 SceneObjectPart[] parts = m_parts.GetArray(); 2577 SceneObjectPart[] parts = m_parts.GetArray();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2a0d2ea..f21058b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -319,7 +319,7 @@ namespace OpenSim.Region.Framework.Scenes
319 protected Vector3 m_lastVelocity; 319 protected Vector3 m_lastVelocity;
320 protected Vector3 m_lastAcceleration; 320 protected Vector3 m_lastAcceleration;
321 protected Vector3 m_lastAngularVelocity; 321 protected Vector3 m_lastAngularVelocity;
322 protected int m_lastTerseSent; 322 protected int m_lastUpdateSentTime;
323 protected float m_buoyancy = 0.0f; 323 protected float m_buoyancy = 0.0f;
324 protected Vector3 m_force; 324 protected Vector3 m_force;
325 protected Vector3 m_torque; 325 protected Vector3 m_torque;
@@ -3201,6 +3201,14 @@ namespace OpenSim.Region.Framework.Scenes
3201 if (ParentGroup == null) 3201 if (ParentGroup == null)
3202 return; 3202 return;
3203 3203
3204 // Update the "last" values
3205 m_lastPosition = OffsetPosition;
3206 m_lastRotation = RotationOffset;
3207 m_lastVelocity = Velocity;
3208 m_lastAcceleration = Acceleration;
3209 m_lastAngularVelocity = AngularVelocity;
3210 m_lastUpdateSentTime = Environment.TickCount;
3211
3204 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) 3212 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
3205 { 3213 {
3206 SendFullUpdate(avatar.ControllingClient); 3214 SendFullUpdate(avatar.ControllingClient);
@@ -3274,17 +3282,10 @@ namespace OpenSim.Region.Framework.Scenes
3274 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) || 3282 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) ||
3275 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) || 3283 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
3276 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || 3284 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
3277 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) 3285 Environment.TickCount - m_lastUpdateSentTime > TIME_MS_TOLERANCE)
3278 { 3286 {
3279 SendTerseUpdateToAllClients(); 3287 SendTerseUpdateToAllClients();
3280 3288
3281 // Update the "last" values
3282 m_lastPosition = OffsetPosition;
3283 m_lastRotation = RotationOffset;
3284 m_lastVelocity = Velocity;
3285 m_lastAcceleration = Acceleration;
3286 m_lastAngularVelocity = AngularVelocity;
3287 m_lastTerseSent = Environment.TickCount;
3288 } 3289 }
3289 break; 3290 break;
3290 } 3291 }
@@ -3305,6 +3306,14 @@ namespace OpenSim.Region.Framework.Scenes
3305 if (ParentGroup == null || ParentGroup.Scene == null) 3306 if (ParentGroup == null || ParentGroup.Scene == null)
3306 return; 3307 return;
3307 3308
3309 // Update the "last" values
3310 m_lastPosition = OffsetPosition;
3311 m_lastRotation = RotationOffset;
3312 m_lastVelocity = Velocity;
3313 m_lastAcceleration = Acceleration;
3314 m_lastAngularVelocity = AngularVelocity;
3315 m_lastUpdateSentTime = Environment.TickCount;
3316
3308 ParentGroup.Scene.ForEachClient(delegate(IClientAPI client) 3317 ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
3309 { 3318 {
3310 SendTerseUpdateToClient(client); 3319 SendTerseUpdateToClient(client);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 9ae9b59..4ce2afd 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -12689,7 +12689,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12689 if ((data & KeyframeMotion.DataFormat.Rotation) != 0) 12689 if ((data & KeyframeMotion.DataFormat.Rotation) != 0)
12690 { 12690 {
12691 LSL_Types.Quaternion tempq = frames.GetQuaternionItem(idx++); 12691 LSL_Types.Quaternion tempq = frames.GetQuaternionItem(idx++);
12692 frame.Rotation = new Quaternion((float)tempq.x, (float)tempq.y, (float)tempq.z, (float)tempq.s); 12692 Quaternion q = new Quaternion((float)tempq.x, (float)tempq.y, (float)tempq.z, (float)tempq.s);
12693 q.Normalize();
12694 frame.Rotation = q;
12693 } 12695 }
12694 12696
12695 float tempf = (float)frames.GetLSLFloatItem(idx++); 12697 float tempf = (float)frames.GetLSLFloatItem(idx++);