diff options
author | Justin Clark-Casey (justincc) | 2009-11-03 19:11:09 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-11-03 19:11:09 +0000 |
commit | af0e5d097480de264e7501e7d5d35328be5640bb (patch) | |
tree | 4ca5cd796ed9618dc9134a6e5eee1f7e7912bee4 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | minor: remove some mono compiler warnings (diff) | |
parent | Fixed a couple of NREs in corner cases. (diff) | |
download | opensim-SC-af0e5d097480de264e7501e7d5d35328be5640bb.zip opensim-SC-af0e5d097480de264e7501e7d5d35328be5640bb.tar.gz opensim-SC-af0e5d097480de264e7501e7d5d35328be5640bb.tar.bz2 opensim-SC-af0e5d097480de264e7501e7d5d35328be5640bb.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 38a0cff..c65a665 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1015,9 +1015,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1015 | } | 1015 | } |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | public float GetTimeDilation() | 1018 | public ushort GetTimeDilation() |
1019 | { | 1019 | { |
1020 | return m_scene.TimeDilation; | 1020 | return Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | /// <summary> | 1023 | /// <summary> |
@@ -1857,28 +1857,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1857 | { | 1857 | { |
1858 | bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); | 1858 | bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); |
1859 | 1859 | ||
1860 | //if (IsAttachment) | 1860 | if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) |
1861 | //{ | ||
1862 | //foreach (SceneObjectPart part in m_parts.Values) | ||
1863 | //{ | ||
1864 | //part.SendScheduledUpdates(); | ||
1865 | //} | ||
1866 | //return; | ||
1867 | //} | ||
1868 | |||
1869 | if (UsePhysics && Util.DistanceLessThan(lastPhysGroupPos, AbsolutePosition, 0.02)) | ||
1870 | { | 1861 | { |
1871 | m_rootPart.UpdateFlag = 1; | 1862 | m_rootPart.UpdateFlag = 1; |
1872 | lastPhysGroupPos = AbsolutePosition; | 1863 | lastPhysGroupPos = AbsolutePosition; |
1873 | } | 1864 | } |
1874 | 1865 | ||
1875 | if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) | 1866 | if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) |
1876 | || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) | ||
1877 | || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) | ||
1878 | || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))) | ||
1879 | { | 1867 | { |
1880 | m_rootPart.UpdateFlag = 1; | 1868 | m_rootPart.UpdateFlag = 1; |
1881 | |||
1882 | lastPhysGroupRot = GroupRotation; | 1869 | lastPhysGroupRot = GroupRotation; |
1883 | } | 1870 | } |
1884 | 1871 | ||
@@ -2959,12 +2946,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2959 | /// <param name="rot"></param> | 2946 | /// <param name="rot"></param> |
2960 | public void UpdateGroupRotationR(Quaternion rot) | 2947 | public void UpdateGroupRotationR(Quaternion rot) |
2961 | { | 2948 | { |
2962 | |||
2963 | m_rootPart.UpdateRotation(rot); | 2949 | m_rootPart.UpdateRotation(rot); |
2964 | if (m_rootPart.PhysActor != null) | 2950 | |
2951 | PhysicsActor actor = m_rootPart.PhysActor; | ||
2952 | if (actor != null) | ||
2965 | { | 2953 | { |
2966 | m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; | 2954 | actor.Orientation = m_rootPart.RotationOffset; |
2967 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2955 | m_scene.PhysicsScene.AddPhysicsActorTaint(actor); |
2968 | } | 2956 | } |
2969 | 2957 | ||
2970 | HasGroupChanged = true; | 2958 | HasGroupChanged = true; |
@@ -2979,11 +2967,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2979 | public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) | 2967 | public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) |
2980 | { | 2968 | { |
2981 | m_rootPart.UpdateRotation(rot); | 2969 | m_rootPart.UpdateRotation(rot); |
2982 | if (m_rootPart.PhysActor != null) | 2970 | |
2971 | PhysicsActor actor = m_rootPart.PhysActor; | ||
2972 | if (actor != null) | ||
2983 | { | 2973 | { |
2984 | m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset; | 2974 | actor.Orientation = m_rootPart.RotationOffset; |
2985 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2975 | m_scene.PhysicsScene.AddPhysicsActorTaint(actor); |
2986 | } | 2976 | } |
2977 | |||
2987 | AbsolutePosition = pos; | 2978 | AbsolutePosition = pos; |
2988 | 2979 | ||
2989 | HasGroupChanged = true; | 2980 | HasGroupChanged = true; |