diff options
author | UbitUmarov | 2017-07-16 05:19:27 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-16 05:19:27 +0100 |
commit | 9ae26fc5afc96c793186b79e80ac8f1a8a040d5b (patch) | |
tree | 450546e149c8620d422728056f5f0faf820c9c6a /OpenSim/Region/Framework/Scenes | |
parent | ode does not like null refs (diff) | |
download | opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.zip opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.tar.gz opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.tar.bz2 opensim-SC_OLD-9ae26fc5afc96c793186b79e80ac8f1a8a040d5b.tar.xz |
store kfm on inventory. this may still be a bit confusing on rez
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
4 files changed, 34 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 712ae01..c64a0f8 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -755,7 +755,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
755 | } | 755 | } |
756 | else | 756 | else |
757 | { | 757 | { |
758 | bool lastSteps = remainingSteps < 4; | 758 | // bool lastSteps = remainingSteps < 4; |
759 | |||
759 | Vector3 currentPosition = m_group.AbsolutePosition; | 760 | Vector3 currentPosition = m_group.AbsolutePosition; |
760 | Vector3 motionThisFrame = (Vector3)m_currentFrame.Position - currentPosition; | 761 | Vector3 motionThisFrame = (Vector3)m_currentFrame.Position - currentPosition; |
761 | motionThisFrame /= (float)remainingSteps; | 762 | motionThisFrame /= (float)remainingSteps; |
@@ -776,13 +777,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
776 | } | 777 | } |
777 | 778 | ||
778 | m_group.AbsolutePosition = m_nextPosition; | 779 | m_group.AbsolutePosition = m_nextPosition; |
779 | if(lastSteps) | 780 | // if(lastSteps) |
780 | m_group.RootPart.Velocity = Vector3.Zero; | 781 | // m_group.RootPart.Velocity = Vector3.Zero; |
781 | else | 782 | // else |
782 | m_group.RootPart.Velocity = m_currentVel; | 783 | m_group.RootPart.Velocity = m_currentVel; |
783 | 784 | ||
784 | if(!update && ( | 785 | if(!update && ( |
785 | lastSteps || | 786 | // lastSteps || |
786 | m_skippedUpdates * tickDuration > 0.5 || | 787 | m_skippedUpdates * tickDuration > 0.5 || |
787 | Math.Abs(m_nextPosition.X - currentPosition.X) > 5f || | 788 | Math.Abs(m_nextPosition.X - currentPosition.X) > 5f || |
788 | Math.Abs(m_nextPosition.Y - currentPosition.Y) > 5f || | 789 | Math.Abs(m_nextPosition.Y - currentPosition.Y) > 5f || |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5e8487d..c06b3dd 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1651,10 +1651,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1651 | physicsMS2 = (float)(tmpMS2 - tmpMS); | 1651 | physicsMS2 = (float)(tmpMS2 - tmpMS); |
1652 | tmpMS = tmpMS2; | 1652 | tmpMS = tmpMS2; |
1653 | 1653 | ||
1654 | /* | ||
1654 | // Apply any pending avatar force input to the avatar's velocity | 1655 | // Apply any pending avatar force input to the avatar's velocity |
1655 | if (Frame % m_update_entitymovement == 0) | 1656 | if (Frame % m_update_entitymovement == 0) |
1656 | m_sceneGraph.UpdateScenePresenceMovement(); | 1657 | m_sceneGraph.UpdateScenePresenceMovement(); |
1657 | 1658 | */ | |
1658 | if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations) | 1659 | if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations) |
1659 | { | 1660 | { |
1660 | m_sendingCoarseLocations = true; | 1661 | m_sendingCoarseLocations = true; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6f46a92..19449b1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -657,6 +657,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
657 | } | 657 | } |
658 | } | 658 | } |
659 | 659 | ||
660 | if(!m_scene.IsRunning) | ||
661 | return sog; | ||
662 | |||
660 | if (root.KeyframeMotion != null) | 663 | if (root.KeyframeMotion != null) |
661 | root.KeyframeMotion.StartCrossingCheck(); | 664 | root.KeyframeMotion.StartCrossingCheck(); |
662 | 665 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 3d867a4..cdf275b 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -112,9 +112,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
112 | while (reader.ReadToNextSibling("Part")); | 112 | while (reader.ReadToNextSibling("Part")); |
113 | } | 113 | } |
114 | 114 | ||
115 | reader.ReadEndElement(); | ||
116 | |||
117 | if (reader.Name == "KeyframeMotion" && reader.NodeType == XmlNodeType.Element) | ||
118 | { | ||
119 | |||
120 | string innerkeytxt = reader.ReadElementContentAsString(); | ||
121 | sceneObject.RootPart.KeyframeMotion = | ||
122 | KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(innerkeytxt)); | ||
123 | } | ||
124 | else | ||
125 | sceneObject.RootPart.KeyframeMotion = null; | ||
126 | |||
115 | // Script state may, or may not, exist. Not having any, is NOT | 127 | // Script state may, or may not, exist. Not having any, is NOT |
116 | // ever a problem. | 128 | // ever a problem. |
117 | sceneObject.LoadScriptState(reader); | 129 | sceneObject.LoadScriptState(reader); |
130 | |||
118 | sceneObject.InvalidateDeepEffectivePerms(); | 131 | sceneObject.InvalidateDeepEffectivePerms(); |
119 | return sceneObject; | 132 | return sceneObject; |
120 | } | 133 | } |
@@ -211,9 +224,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
211 | 224 | ||
212 | writer.WriteEndElement(); // OtherParts | 225 | writer.WriteEndElement(); // OtherParts |
213 | 226 | ||
227 | if (sceneObject.RootPart.KeyframeMotion != null) | ||
228 | { | ||
229 | Byte[] data = sceneObject.RootPart.KeyframeMotion.Serialize(); | ||
230 | |||
231 | writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty); | ||
232 | writer.WriteBase64(data, 0, data.Length); | ||
233 | writer.WriteEndElement(); | ||
234 | } | ||
235 | |||
214 | if (doScriptStates) | 236 | if (doScriptStates) |
215 | sceneObject.SaveScriptedState(writer); | 237 | sceneObject.SaveScriptedState(writer); |
216 | 238 | ||
239 | |||
217 | if (!noRootElement) | 240 | if (!noRootElement) |
218 | writer.WriteEndElement(); // SceneObjectGroup | 241 | writer.WriteEndElement(); // SceneObjectGroup |
219 | 242 | ||