store kfm on inventory. this may still be a bit confusing on rez

This commit is contained in:
UbitUmarov
2017-07-16 05:19:27 +01:00
parent 04b97be71e
commit 9ae26fc5af
5 changed files with 42 additions and 11 deletions

View File

@@ -755,7 +755,8 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
bool lastSteps = remainingSteps < 4;
// bool lastSteps = remainingSteps < 4;
Vector3 currentPosition = m_group.AbsolutePosition;
Vector3 motionThisFrame = (Vector3)m_currentFrame.Position - currentPosition;
motionThisFrame /= (float)remainingSteps;
@@ -776,13 +777,13 @@ namespace OpenSim.Region.Framework.Scenes
}
m_group.AbsolutePosition = m_nextPosition;
if(lastSteps)
m_group.RootPart.Velocity = Vector3.Zero;
else
// if(lastSteps)
// m_group.RootPart.Velocity = Vector3.Zero;
// else
m_group.RootPart.Velocity = m_currentVel;
if(!update && (
lastSteps ||
// lastSteps ||
m_skippedUpdates * tickDuration > 0.5 ||
Math.Abs(m_nextPosition.X - currentPosition.X) > 5f ||
Math.Abs(m_nextPosition.Y - currentPosition.Y) > 5f ||

View File

@@ -1651,10 +1651,11 @@ namespace OpenSim.Region.Framework.Scenes
physicsMS2 = (float)(tmpMS2 - tmpMS);
tmpMS = tmpMS2;
/*
// Apply any pending avatar force input to the avatar's velocity
if (Frame % m_update_entitymovement == 0)
m_sceneGraph.UpdateScenePresenceMovement();
*/
if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations)
{
m_sendingCoarseLocations = true;

View File

@@ -657,6 +657,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
if(!m_scene.IsRunning)
return sog;
if (root.KeyframeMotion != null)
root.KeyframeMotion.StartCrossingCheck();

View File

@@ -112,9 +112,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
while (reader.ReadToNextSibling("Part"));
}
reader.ReadEndElement();
if (reader.Name == "KeyframeMotion" && reader.NodeType == XmlNodeType.Element)
{
string innerkeytxt = reader.ReadElementContentAsString();
sceneObject.RootPart.KeyframeMotion =
KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(innerkeytxt));
}
else
sceneObject.RootPart.KeyframeMotion = null;
// Script state may, or may not, exist. Not having any, is NOT
// ever a problem.
sceneObject.LoadScriptState(reader);
sceneObject.InvalidateDeepEffectivePerms();
return sceneObject;
}
@@ -211,9 +224,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteEndElement(); // OtherParts
if (sceneObject.RootPart.KeyframeMotion != null)
{
Byte[] data = sceneObject.RootPart.KeyframeMotion.Serialize();
writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty);
writer.WriteBase64(data, 0, data.Length);
writer.WriteEndElement();
}
if (doScriptStates)
sceneObject.SaveScriptedState(writer);
if (!noRootElement)
writer.WriteEndElement(); // SceneObjectGroup