diff options
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 55 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 2 |
4 files changed, 45 insertions, 23 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 24755b3..f6a6461 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -553,6 +553,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
553 | new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), | 553 | new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), |
554 | new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, | 554 | new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, |
555 | rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); | 555 | rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); |
556 | rootPart.doPhysicsPropertyUpdate(UsePhysics); | ||
556 | } | 557 | } |
557 | MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); | 558 | MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); |
558 | } | 559 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 0a81679..61cc973 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -130,8 +130,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
130 | 130 | ||
131 | public uint ObjectFlags | 131 | public uint ObjectFlags |
132 | { | 132 | { |
133 | get { return (uint) m_flags; } | 133 | get { return (uint) m_flags;} |
134 | set { m_flags = (LLObject.ObjectFlags) value; } | 134 | set {m_flags = (LLObject.ObjectFlags) value;} |
135 | } | 135 | } |
136 | 136 | ||
137 | protected LLObject.MaterialType m_material = 0; | 137 | protected LLObject.MaterialType m_material = 0; |
@@ -416,7 +416,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
416 | m_name = "Primitive"; | 416 | m_name = "Primitive"; |
417 | m_regionHandle = regionHandle; | 417 | m_regionHandle = regionHandle; |
418 | m_parentGroup = parent; | 418 | m_parentGroup = parent; |
419 | 419 | ||
420 | CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 420 | CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
421 | OwnerID = ownerID; | 421 | OwnerID = ownerID; |
422 | CreatorID = OwnerID; | 422 | CreatorID = OwnerID; |
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
472 | { | 472 | { |
473 | m_regionHandle = regionHandle; | 473 | m_regionHandle = regionHandle; |
474 | m_parentGroup = parent; | 474 | m_parentGroup = parent; |
475 | 475 | TimeStampTerse = (uint)Util.UnixTimeSinceEpoch(); | |
476 | CreationDate = creationDate; | 476 | CreationDate = creationDate; |
477 | OwnerID = ownerID; | 477 | OwnerID = ownerID; |
478 | CreatorID = creatorID; | 478 | CreatorID = creatorID; |
@@ -490,6 +490,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
490 | OffsetPosition = position; | 490 | OffsetPosition = position; |
491 | RotationOffset = rotation; | 491 | RotationOffset = rotation; |
492 | ObjectFlags = flags; | 492 | ObjectFlags = flags; |
493 | bool UsePhysics = ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); | ||
494 | doPhysicsPropertyUpdate(UsePhysics); | ||
495 | ScheduleFullUpdate(); | ||
493 | } | 496 | } |
494 | 497 | ||
495 | #endregion | 498 | #endregion |
@@ -502,7 +505,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
502 | public static SceneObjectPart FromXml(XmlReader xmlReader) | 505 | public static SceneObjectPart FromXml(XmlReader xmlReader) |
503 | { | 506 | { |
504 | XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); | 507 | XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); |
505 | return (SceneObjectPart) serializer.Deserialize(xmlReader); | 508 | SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader); |
509 | bool UsePhysics = ((newobject.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); | ||
510 | newobject.doPhysicsPropertyUpdate(UsePhysics); | ||
511 | |||
512 | return newobject; | ||
506 | } | 513 | } |
507 | 514 | ||
508 | /// <summary> | 515 | /// <summary> |
@@ -567,6 +574,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
567 | byte[] extraP = new byte[Shape.ExtraParams.Length]; | 574 | byte[] extraP = new byte[Shape.ExtraParams.Length]; |
568 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); | 575 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); |
569 | dupe.Shape.ExtraParams = extraP; | 576 | dupe.Shape.ExtraParams = extraP; |
577 | bool UsePhysics = ((dupe.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); | ||
578 | dupe.doPhysicsPropertyUpdate(UsePhysics); | ||
570 | 579 | ||
571 | return dupe; | 580 | return dupe; |
572 | } | 581 | } |
@@ -890,8 +899,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
890 | // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); | 899 | // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); |
891 | ScheduleFullUpdate(); | 900 | ScheduleFullUpdate(); |
892 | } | 901 | } |
893 | private void doPhysicsPropertyUpdate(bool UsePhysics) | 902 | public void doPhysicsPropertyUpdate(bool UsePhysics) |
894 | { | 903 | { |
904 | |||
895 | if (PhysActor != null) | 905 | if (PhysActor != null) |
896 | { | 906 | { |
897 | if (PhysActor.IsPhysical) | 907 | if (PhysActor.IsPhysical) |
@@ -903,21 +913,31 @@ namespace OpenSim.Region.Environment.Scenes | |||
903 | /// that's not wholesome. Had to make m_scene public | 913 | /// that's not wholesome. Had to make m_scene public |
904 | PhysActor = null; | 914 | PhysActor = null; |
905 | 915 | ||
906 | PhysActor = m_parentGroup.m_scene.PhysScene.AddPrimShape( | 916 | if (!((ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) != 0)) |
907 | Name, | ||
908 | Shape, | ||
909 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, | ||
910 | AbsolutePosition.Z), | ||
911 | new PhysicsVector(Scale.X, Scale.Y, Scale.Z), | ||
912 | new Quaternion(RotationOffset.W, RotationOffset.X, | ||
913 | RotationOffset.Y, RotationOffset.Z), UsePhysics); | ||
914 | if (UsePhysics) | ||
915 | { | 917 | { |
916 | PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; | 918 | PhysActor = m_parentGroup.m_scene.PhysScene.AddPrimShape( |
917 | PhysActor.OnOutOfBounds += PhysicsOutOfBounds; | 919 | Name, |
920 | Shape, | ||
921 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, | ||
922 | AbsolutePosition.Z), | ||
923 | new PhysicsVector(Scale.X, Scale.Y, Scale.Z), | ||
924 | new Quaternion(RotationOffset.W, RotationOffset.X, | ||
925 | RotationOffset.Y, RotationOffset.Z), UsePhysics); | ||
926 | if (UsePhysics) | ||
927 | { | ||
928 | PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; | ||
929 | PhysActor.OnOutOfBounds += PhysicsOutOfBounds; | ||
930 | } | ||
918 | } | 931 | } |
932 | |||
933 | |||
934 | |||
919 | } | 935 | } |
920 | 936 | ||
937 | |||
938 | |||
939 | |||
940 | |||
921 | } | 941 | } |
922 | 942 | ||
923 | public void UpdateExtraParam(ushort type, bool inUse, byte[] data) | 943 | public void UpdateExtraParam(ushort type, bool inUse, byte[] data) |
@@ -1162,6 +1182,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1162 | public void PhysicsRequestingTerseUpdate() | 1182 | public void PhysicsRequestingTerseUpdate() |
1163 | { | 1183 | { |
1164 | ScheduleTerseUpdate(); | 1184 | ScheduleTerseUpdate(); |
1185 | |||
1165 | //SendTerseUpdateToAllClients(); | 1186 | //SendTerseUpdateToAllClients(); |
1166 | } | 1187 | } |
1167 | #endregion | 1188 | #endregion |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 87fa5cf..67b375a 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -337,12 +337,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
337 | // could have been sent in the last update - we still need to send the | 337 | // could have been sent in the last update - we still need to send the |
338 | // second here. | 338 | // second here. |
339 | 339 | ||
340 | // after object un-linking was introduced, this broke and needs fixing | 340 | |
341 | // *all* object movements create a fullobjectupdate (which is bad) | ||
342 | // Physical objects do not need this bit of code, so lets make sure that they don't | ||
343 | // get updated and make matters worse until this gets fixed. | ||
344 | 341 | ||
345 | if (update.LastFullUpdateTime < part.TimeStampFull && !((part.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) !=0 )) | 342 | if (update.LastFullUpdateTime < part.TimeStampFull) |
346 | { | 343 | { |
347 | //need to do a full update | 344 | //need to do a full update |
348 | part.SendFullUpdate(ControllingClient); | 345 | part.SendFullUpdate(ControllingClient); |
@@ -357,7 +354,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
357 | } | 354 | } |
358 | else if (update.LastTerseUpdateTime <= part.TimeStampTerse) | 355 | else if (update.LastTerseUpdateTime <= part.TimeStampTerse) |
359 | { | 356 | { |
357 | |||
358 | |||
360 | part.SendTerseUpdate(ControllingClient); | 359 | part.SendTerseUpdate(ControllingClient); |
360 | |||
361 | update.LastTerseUpdateTime = part.TimeStampTerse; | 361 | update.LastTerseUpdateTime = part.TimeStampTerse; |
362 | updateCount++; | 362 | updateCount++; |
363 | } | 363 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 5388852..5422c11 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -524,7 +524,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
524 | newPrim = new OdePrim(name, this, targetspace, pos, siz, rot, mesh, pbs, isphysical); | 524 | newPrim = new OdePrim(name, this, targetspace, pos, siz, rot, mesh, pbs, isphysical); |
525 | } | 525 | } |
526 | _prims.Add(newPrim); | 526 | _prims.Add(newPrim); |
527 | OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Added Object"); | 527 | |
528 | return newPrim; | 528 | return newPrim; |
529 | } | 529 | } |
530 | 530 | ||