Fix deserialization of Buoyancy, Force and Torque. Remove debug from the new

code.
avinationmerge
Melanie 2012-02-26 14:30:24 +01:00
parent 9a15bba99b
commit 8cdc115c91
5 changed files with 9 additions and 11 deletions

View File

@ -245,7 +245,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
m_log.DebugFormat("[KEYFRAME]: Angle {0} aabb {1}", angle, aa_bb);
k.AngularVelocity = (new Vector3(0, 0, 1) * (Quaternion)k.Rotation) * (angle / (k.TimeMS / 1000)); k.AngularVelocity = (new Vector3(0, 0, 1) * (Quaternion)k.Rotation) * (angle / (k.TimeMS / 1000));
k.TimeTotal = k.TimeMS; k.TimeTotal = k.TimeMS;

View File

@ -895,6 +895,10 @@ namespace OpenSim.Region.Framework.Scenes
ApplyPhysics(); ApplyPhysics();
if (RootPart.PhysActor != null)
RootPart.Force = RootPart.Force;
if (RootPart.PhysActor != null)
RootPart.Torque = RootPart.Torque;
if (RootPart.PhysActor != null) if (RootPart.PhysActor != null)
RootPart.Buoyancy = RootPart.Buoyancy; RootPart.Buoyancy = RootPart.Buoyancy;

View File

@ -1313,7 +1313,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
set set
{ {
if (ParentGroup.RootPart != this) if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
{ {
ParentGroup.RootPart.Buoyancy = value; ParentGroup.RootPart.Buoyancy = value;
return; return;
@ -1336,7 +1336,7 @@ namespace OpenSim.Region.Framework.Scenes
set set
{ {
if (ParentGroup.RootPart != this) if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
{ {
ParentGroup.RootPart.Force = value; ParentGroup.RootPart.Force = value;
return; return;
@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Framework.Scenes
set set
{ {
if (ParentGroup.RootPart != this) if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
{ {
ParentGroup.RootPart.Torque = value; ParentGroup.RootPart.Torque = value;
return; return;

View File

@ -246,14 +246,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion");
if (keymotion.Count > 0) if (keymotion.Count > 0)
{
m_log.DebugFormat("[SERIALIZER]: Deserialized KeyframeMotion");
sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText)); sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText));
}
else else
{
sceneObject.KeyframeMotion = null; sceneObject.KeyframeMotion = null;
}
// Script state may, or may not, exist. Not having any, is NOT // Script state may, or may not, exist. Not having any, is NOT
// ever a problem. // ever a problem.

View File

@ -2484,13 +2484,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llApplyRotationalImpulse(LSL_Vector force, int local) public void llApplyRotationalImpulse(LSL_Vector force, int local)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.ApplyAngularImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); m_host.ParentGroup.RootPart.ApplyAngularImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0);
} }
public void llSetTorque(LSL_Vector torque, int local) public void llSetTorque(LSL_Vector torque, int local)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.SetAngularImpulse(new Vector3((float)torque.x, (float)torque.y, (float)torque.z), local != 0); m_host.ParentGroup.RootPart.SetAngularImpulse(new Vector3((float)torque.x, (float)torque.y, (float)torque.z), local != 0);
} }
public LSL_Vector llGetTorque() public LSL_Vector llGetTorque()