diff options
Merge branch 'careminster' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 60 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 62 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 |
3 files changed, 57 insertions, 67 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 8c5a9a6..6c4b39d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -383,8 +383,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
383 | } | 383 | } |
384 | 384 | ||
385 | foreach (SceneObjectPart part in m_parts.Values) | 385 | foreach (SceneObjectPart part in m_parts.Values) |
386 | { | ||
386 | part.GroupPosition = val; | 387 | part.GroupPosition = val; |
387 | 388 | } | |
389 | |||
388 | lockPartsForRead(false); | 390 | lockPartsForRead(false); |
389 | 391 | ||
390 | //if (m_rootPart.PhysActor != null) | 392 | //if (m_rootPart.PhysActor != null) |
@@ -1914,13 +1916,40 @@ namespace OpenSim.Region.Framework.Scenes | |||
1914 | } | 1916 | } |
1915 | } | 1917 | } |
1916 | 1918 | ||
1919 | public void rotLookAt(Quaternion target, float strength, float damping) | ||
1920 | { | ||
1921 | SceneObjectPart rootpart = m_rootPart; | ||
1922 | if (rootpart != null) | ||
1923 | { | ||
1924 | if (IsAttachment) | ||
1925 | { | ||
1926 | /* | ||
1927 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | ||
1928 | if (avatar != null) | ||
1929 | { | ||
1930 | Rotate the Av? | ||
1931 | } */ | ||
1932 | } | ||
1933 | else | ||
1934 | { | ||
1935 | if (rootpart.PhysActor != null) | ||
1936 | { // APID must be implemented in your physics system for this to function. | ||
1937 | rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W); | ||
1938 | rootpart.PhysActor.APIDStrength = strength; | ||
1939 | rootpart.PhysActor.APIDDamping = damping; | ||
1940 | rootpart.PhysActor.APIDActive = true; | ||
1941 | } | ||
1942 | } | ||
1943 | } | ||
1944 | } | ||
1945 | |||
1917 | public void stopLookAt() | 1946 | public void stopLookAt() |
1918 | { | 1947 | { |
1919 | SceneObjectPart rootpart = m_rootPart; | 1948 | SceneObjectPart rootpart = m_rootPart; |
1920 | if (rootpart != null) | 1949 | if (rootpart != null) |
1921 | { | 1950 | { |
1922 | if (rootpart.PhysActor != null) | 1951 | if (rootpart.PhysActor != null) |
1923 | { | 1952 | { // APID must be implemented in your physics system for this to function. |
1924 | rootpart.PhysActor.APIDActive = false; | 1953 | rootpart.PhysActor.APIDActive = false; |
1925 | } | 1954 | } |
1926 | } | 1955 | } |
@@ -3345,22 +3374,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
3345 | } | 3374 | } |
3346 | 3375 | ||
3347 | lockPartsForRead(true); | 3376 | lockPartsForRead(true); |
3377 | |||
3378 | foreach (SceneObjectPart prim in m_parts.Values) | ||
3348 | { | 3379 | { |
3349 | foreach (SceneObjectPart prim in m_parts.Values) | 3380 | if (prim.UUID != m_rootPart.UUID) |
3350 | { | 3381 | { |
3351 | if (prim.UUID != m_rootPart.UUID) | 3382 | prim.IgnoreUndoUpdate = true; |
3352 | { | 3383 | Vector3 axPos = prim.OffsetPosition; |
3353 | prim.IgnoreUndoUpdate = true; | 3384 | axPos *= oldParentRot; |
3354 | Vector3 axPos = prim.OffsetPosition; | 3385 | axPos *= Quaternion.Inverse(axRot); |
3355 | axPos *= oldParentRot; | 3386 | prim.OffsetPosition = axPos; |
3356 | axPos *= Quaternion.Inverse(axRot); | 3387 | Quaternion primsRot = prim.RotationOffset; |
3357 | prim.OffsetPosition = axPos; | 3388 | Quaternion newRot = primsRot * oldParentRot; |
3358 | Quaternion primsRot = prim.RotationOffset; | 3389 | newRot *= Quaternion.Inverse(axRot); |
3359 | Quaternion newRot = primsRot * oldParentRot; | 3390 | prim.RotationOffset = newRot; |
3360 | newRot *= Quaternion.Inverse(axRot); | 3391 | prim.ScheduleTerseUpdate(); |
3361 | prim.RotationOffset = newRot; | ||
3362 | prim.ScheduleTerseUpdate(); | ||
3363 | } | ||
3364 | } | 3392 | } |
3365 | } | 3393 | } |
3366 | 3394 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e0d0fe1..c8ac014 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -818,7 +818,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
818 | /// <summary></summary> | 818 | /// <summary></summary> |
819 | public Vector3 Acceleration | 819 | public Vector3 Acceleration |
820 | { | 820 | { |
821 | get { return m_acceleration; } | 821 | get |
822 | { | ||
823 | PhysicsActor actor = PhysActor; | ||
824 | if (actor != null) | ||
825 | { | ||
826 | m_acceleration = actor.Acceleration; | ||
827 | } | ||
828 | return m_acceleration; | ||
829 | } | ||
830 | |||
822 | set { m_acceleration = value; } | 831 | set { m_acceleration = value; } |
823 | } | 832 | } |
824 | 833 | ||
@@ -2696,38 +2705,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2696 | 2705 | ||
2697 | public void RotLookAt(Quaternion target, float strength, float damping) | 2706 | public void RotLookAt(Quaternion target, float strength, float damping) |
2698 | { | 2707 | { |
2699 | rotLookAt(target, strength, damping); | 2708 | m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup. |
2700 | } | ||
2701 | |||
2702 | public void rotLookAt(Quaternion target, float strength, float damping) | ||
2703 | { | ||
2704 | if (IsAttachment) | ||
2705 | { | ||
2706 | /* | ||
2707 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | ||
2708 | if (avatar != null) | ||
2709 | { | ||
2710 | Rotate the Av? | ||
2711 | } */ | ||
2712 | } | ||
2713 | else | ||
2714 | { | ||
2715 | APIDDamp = damping; | ||
2716 | APIDStrength = strength; | ||
2717 | APIDTarget = target; | ||
2718 | } | ||
2719 | } | ||
2720 | |||
2721 | public void startLookAt(Quaternion rot, float damp, float strength) | ||
2722 | { | ||
2723 | APIDDamp = damp; | ||
2724 | APIDStrength = strength; | ||
2725 | APIDTarget = rot; | ||
2726 | } | ||
2727 | |||
2728 | public void stopLookAt() | ||
2729 | { | ||
2730 | APIDTarget = Quaternion.Identity; | ||
2731 | } | 2709 | } |
2732 | 2710 | ||
2733 | /// <summary> | 2711 | /// <summary> |
@@ -3225,22 +3203,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3225 | PhysActor.VehicleRotationParam(param, rotation); | 3203 | PhysActor.VehicleRotationParam(param, rotation); |
3226 | } | 3204 | } |
3227 | } | 3205 | } |
3228 | |||
3229 | public void SetVehicleFlags(int flags) | ||
3230 | { | ||
3231 | if (PhysActor != null) | ||
3232 | { | ||
3233 | PhysActor.VehicleFlagsSet(flags); | ||
3234 | } | ||
3235 | } | ||
3236 | |||
3237 | public void RemoveVehicleFlags(int flags) | ||
3238 | { | ||
3239 | if (PhysActor != null) | ||
3240 | { | ||
3241 | PhysActor.VehicleFlagsRemove(flags); | ||
3242 | } | ||
3243 | } | ||
3244 | 3206 | ||
3245 | /// <summary> | 3207 | /// <summary> |
3246 | /// Set the color of prim faces | 3208 | /// Set the color of prim faces |
@@ -3494,7 +3456,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3494 | 3456 | ||
3495 | public void StopLookAt() | 3457 | public void StopLookAt() |
3496 | { | 3458 | { |
3497 | m_parentGroup.stopLookAt(); | 3459 | m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup. |
3498 | 3460 | ||
3499 | m_parentGroup.ScheduleGroupForTerseUpdate(); | 3461 | m_parentGroup.ScheduleGroupForTerseUpdate(); |
3500 | } | 3462 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f1be4d8..d8f93d7 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -878,7 +878,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
878 | if (land != null) | 878 | if (land != null) |
879 | { | 879 | { |
880 | //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. | 880 | //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. |
881 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_godlevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid) | 881 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_godLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid) |
882 | { | 882 | { |
883 | pos = land.LandData.UserLocation; | 883 | pos = land.LandData.UserLocation; |
884 | } | 884 | } |