diff options
author | Melanie | 2012-02-26 14:30:24 +0100 |
---|---|---|
committer | Melanie | 2012-02-26 14:30:24 +0100 |
commit | 8cdc115c91bd074539c5fbae719313d4dc616355 (patch) | |
tree | b071a6011f0644044f02be9ecdd0e84ac957d468 /OpenSim | |
parent | Fix an infinite recursion caused by checking the wrong values for (diff) | |
download | opensim-SC-8cdc115c91bd074539c5fbae719313d4dc616355.zip opensim-SC-8cdc115c91bd074539c5fbae719313d4dc616355.tar.gz opensim-SC-8cdc115c91bd074539c5fbae719313d4dc616355.tar.bz2 opensim-SC-8cdc115c91bd074539c5fbae719313d4dc616355.tar.xz |
Fix deserialization of Buoyancy, Force and Torque. Remove debug from the new
code.
Diffstat (limited to '')
5 files changed, 9 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 73db25b..7f651aa 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -245,7 +245,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
245 | } | 245 | } |
246 | } | 246 | } |
247 | 247 | ||
248 | m_log.DebugFormat("[KEYFRAME]: Angle {0} aabb {1}", angle, aa_bb); | ||
249 | k.AngularVelocity = (new Vector3(0, 0, 1) * (Quaternion)k.Rotation) * (angle / (k.TimeMS / 1000)); | 248 | k.AngularVelocity = (new Vector3(0, 0, 1) * (Quaternion)k.Rotation) * (angle / (k.TimeMS / 1000)); |
250 | k.TimeTotal = k.TimeMS; | 249 | k.TimeTotal = k.TimeMS; |
251 | 250 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index d488189..ac2fe82 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -896,6 +896,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
896 | ApplyPhysics(); | 896 | ApplyPhysics(); |
897 | 897 | ||
898 | if (RootPart.PhysActor != null) | 898 | if (RootPart.PhysActor != null) |
899 | RootPart.Force = RootPart.Force; | ||
900 | if (RootPart.PhysActor != null) | ||
901 | RootPart.Torque = RootPart.Torque; | ||
902 | if (RootPart.PhysActor != null) | ||
899 | RootPart.Buoyancy = RootPart.Buoyancy; | 903 | RootPart.Buoyancy = RootPart.Buoyancy; |
900 | 904 | ||
901 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled | 905 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3ab7e5a..0728042 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1313,7 +1313,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1313 | } | 1313 | } |
1314 | set | 1314 | set |
1315 | { | 1315 | { |
1316 | if (ParentGroup.RootPart != this) | 1316 | if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this) |
1317 | { | 1317 | { |
1318 | ParentGroup.RootPart.Buoyancy = value; | 1318 | ParentGroup.RootPart.Buoyancy = value; |
1319 | return; | 1319 | return; |
@@ -1336,7 +1336,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1336 | 1336 | ||
1337 | set | 1337 | set |
1338 | { | 1338 | { |
1339 | if (ParentGroup.RootPart != this) | 1339 | if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this) |
1340 | { | 1340 | { |
1341 | ParentGroup.RootPart.Force = value; | 1341 | ParentGroup.RootPart.Force = value; |
1342 | return; | 1342 | return; |
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1359 | 1359 | ||
1360 | set | 1360 | set |
1361 | { | 1361 | { |
1362 | if (ParentGroup.RootPart != this) | 1362 | if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart != this) |
1363 | { | 1363 | { |
1364 | ParentGroup.RootPart.Torque = value; | 1364 | ParentGroup.RootPart.Torque = value; |
1365 | return; | 1365 | return; |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index a9f3e84..118a63a 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -246,14 +246,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
246 | 246 | ||
247 | XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); | 247 | XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); |
248 | if (keymotion.Count > 0) | 248 | if (keymotion.Count > 0) |
249 | { | ||
250 | m_log.DebugFormat("[SERIALIZER]: Deserialized KeyframeMotion"); | ||
251 | sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText)); | 249 | sceneObject.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText)); |
252 | } | ||
253 | else | 250 | else |
254 | { | ||
255 | sceneObject.KeyframeMotion = null; | 251 | sceneObject.KeyframeMotion = null; |
256 | } | ||
257 | 252 | ||
258 | // Script state may, or may not, exist. Not having any, is NOT | 253 | // Script state may, or may not, exist. Not having any, is NOT |
259 | // ever a problem. | 254 | // ever a problem. |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9090311..e4ab14f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2484,13 +2484,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2484 | public void llApplyRotationalImpulse(LSL_Vector force, int local) | 2484 | public void llApplyRotationalImpulse(LSL_Vector force, int local) |
2485 | { | 2485 | { |
2486 | m_host.AddScriptLPS(1); | 2486 | m_host.AddScriptLPS(1); |
2487 | m_host.ApplyAngularImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); | 2487 | m_host.ParentGroup.RootPart.ApplyAngularImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); |
2488 | } | 2488 | } |
2489 | 2489 | ||
2490 | public void llSetTorque(LSL_Vector torque, int local) | 2490 | public void llSetTorque(LSL_Vector torque, int local) |
2491 | { | 2491 | { |
2492 | m_host.AddScriptLPS(1); | 2492 | m_host.AddScriptLPS(1); |
2493 | m_host.SetAngularImpulse(new Vector3((float)torque.x, (float)torque.y, (float)torque.z), local != 0); | 2493 | m_host.ParentGroup.RootPart.SetAngularImpulse(new Vector3((float)torque.x, (float)torque.y, (float)torque.z), local != 0); |
2494 | } | 2494 | } |
2495 | 2495 | ||
2496 | public LSL_Vector llGetTorque() | 2496 | public LSL_Vector llGetTorque() |