mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Fix deserialization of Buoyancy, Force and Torque. Remove debug from the new
code.
This commit is contained in:
@@ -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.TimeTotal = k.TimeMS;
|
||||
|
||||
|
||||
@@ -895,6 +895,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
ApplyPhysics();
|
||||
|
||||
if (RootPart.PhysActor != null)
|
||||
RootPart.Force = RootPart.Force;
|
||||
if (RootPart.PhysActor != null)
|
||||
RootPart.Torque = RootPart.Torque;
|
||||
if (RootPart.PhysActor != null)
|
||||
RootPart.Buoyancy = RootPart.Buoyancy;
|
||||
|
||||
|
||||
@@ -1313,7 +1313,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
set
|
||||
{
|
||||
if (ParentGroup.RootPart != this)
|
||||
if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
|
||||
{
|
||||
ParentGroup.RootPart.Buoyancy = value;
|
||||
return;
|
||||
@@ -1336,7 +1336,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
set
|
||||
{
|
||||
if (ParentGroup.RootPart != this)
|
||||
if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
|
||||
{
|
||||
ParentGroup.RootPart.Force = value;
|
||||
return;
|
||||
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
set
|
||||
{
|
||||
if (ParentGroup.RootPart != this)
|
||||
if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this)
|
||||
{
|
||||
ParentGroup.RootPart.Torque = value;
|
||||
return;
|
||||
|
||||
@@ -246,14 +246,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
|
||||
XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion");
|
||||
if (keymotion.Count > 0)
|
||||
{
|
||||
m_log.DebugFormat("[SERIALIZER]: Deserialized KeyframeMotion");
|
||||
sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText));
|
||||
}
|
||||
else
|
||||
{
|
||||
sceneObject.KeyframeMotion = null;
|
||||
}
|
||||
|
||||
// Script state may, or may not, exist. Not having any, is NOT
|
||||
// ever a problem.
|
||||
|
||||
@@ -2484,13 +2484,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void llApplyRotationalImpulse(LSL_Vector force, int local)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user