aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs39
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs30
2 files changed, 57 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bcc9b37..ea4f2c7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1734,6 +1734,45 @@ namespace OpenSim.Region.Framework.Scenes
1734 } 1734 }
1735 } 1735 }
1736 1736
1737 public void rotLookAt(Quaternion target, float strength, float damping)
1738 {
1739 SceneObjectPart rootpart = m_rootPart;
1740 if (rootpart != null)
1741 {
1742 if (IsAttachment)
1743 {
1744 /*
1745 ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
1746 if (avatar != null)
1747 {
1748 Rotate the Av?
1749 } */
1750 }
1751 else
1752 {
1753 if (rootpart.PhysActor != null)
1754 {
1755 rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
1756 rootpart.PhysActor.APIDStrength = strength;
1757 rootpart.PhysActor.APIDDamping = damping;
1758 rootpart.PhysActor.APIDActive = true;
1759 }
1760 }
1761 }
1762 }
1763 public void stopLookAt()
1764 {
1765 SceneObjectPart rootpart = m_rootPart;
1766 if (rootpart != null)
1767 {
1768 if (rootpart.PhysActor != null)
1769 {
1770 rootpart.PhysActor.APIDActive = false;
1771 }
1772 }
1773
1774 }
1775
1737 /// <summary> 1776 /// <summary>
1738 /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. 1777 /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds.
1739 /// </summary> 1778 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 6f1b458..10b7d94 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1064,14 +1064,6 @@ namespace OpenSim.Region.Framework.Scenes
1064 } 1064 }
1065 } 1065 }
1066 1066
1067 /// <summary>
1068 /// Clear all pending updates of parts to clients
1069 /// </summary>
1070 private void ClearUpdateSchedule()
1071 {
1072 m_updateFlag = 0;
1073 }
1074
1075 private void SendObjectPropertiesToClient(UUID AgentID) 1067 private void SendObjectPropertiesToClient(UUID AgentID)
1076 { 1068 {
1077 ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); 1069 ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences();
@@ -2185,6 +2177,11 @@ namespace OpenSim.Region.Framework.Scenes
2185 ParentGroup.HasGroupChanged = true; 2177 ParentGroup.HasGroupChanged = true;
2186 ScheduleFullUpdate(); 2178 ScheduleFullUpdate();
2187 } 2179 }
2180
2181 public void RotLookAt(Quaternion target, float strength, float damping)
2182 {
2183 m_parentGroup.rotLookAt(target, strength, damping);
2184 }
2188 2185
2189 /// <summary> 2186 /// <summary>
2190 /// Schedules this prim for a full update 2187 /// Schedules this prim for a full update
@@ -2389,8 +2386,8 @@ namespace OpenSim.Region.Framework.Scenes
2389 { 2386 {
2390 const float ROTATION_TOLERANCE = 0.01f; 2387 const float ROTATION_TOLERANCE = 0.01f;
2391 const float VELOCITY_TOLERANCE = 0.001f; 2388 const float VELOCITY_TOLERANCE = 0.001f;
2392 const float POSITION_TOLERANCE = 0.05f; 2389 const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary
2393 const int TIME_MS_TOLERANCE = 3000; 2390 const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds.
2394 2391
2395 if (m_updateFlag == 1) 2392 if (m_updateFlag == 1)
2396 { 2393 {
@@ -2404,7 +2401,7 @@ namespace OpenSim.Region.Framework.Scenes
2404 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) 2401 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
2405 { 2402 {
2406 AddTerseUpdateToAllAvatars(); 2403 AddTerseUpdateToAllAvatars();
2407 ClearUpdateSchedule(); 2404
2408 2405
2409 // This causes the Scene to 'poll' physical objects every couple of frames 2406 // This causes the Scene to 'poll' physical objects every couple of frames
2410 // bad, so it's been replaced by an event driven method. 2407 // bad, so it's been replaced by an event driven method.
@@ -2422,13 +2419,15 @@ namespace OpenSim.Region.Framework.Scenes
2422 m_lastAngularVelocity = AngularVelocity; 2419 m_lastAngularVelocity = AngularVelocity;
2423 m_lastTerseSent = Environment.TickCount; 2420 m_lastTerseSent = Environment.TickCount;
2424 } 2421 }
2422 //Moved this outside of the if clause so updates don't get blocked.. *sigh*
2423 m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams*
2425 } 2424 }
2426 else 2425 else
2427 { 2426 {
2428 if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes 2427 if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
2429 { 2428 {
2430 AddFullUpdateToAllAvatars(); 2429 AddFullUpdateToAllAvatars();
2431 ClearUpdateSchedule(); 2430 m_updateFlag = 0; //Same here
2432 } 2431 }
2433 } 2432 }
2434 ClearUpdateSchedule(); 2433 ClearUpdateSchedule();
@@ -2684,6 +2683,13 @@ namespace OpenSim.Region.Framework.Scenes
2684 SetText(text); 2683 SetText(text);
2685 } 2684 }
2686 2685
2686 public void StopLookAt()
2687 {
2688 m_parentGroup.stopLookAt();
2689
2690 m_parentGroup.ScheduleGroupForTerseUpdate();
2691 }
2692
2687 public void StopMoveToTarget() 2693 public void StopMoveToTarget()
2688 { 2694 {
2689 m_parentGroup.stopMoveToTarget(); 2695 m_parentGroup.stopMoveToTarget();