diff options
author | Revolution | 2010-02-14 15:41:57 -0600 |
---|---|---|
committer | Melanie | 2010-02-14 22:18:46 +0000 |
commit | 9821c4f566e11c75c8d87721777480c5b2e2bd4e (patch) | |
tree | 04cf7edb4cfe07e1f50ce3ee0ca5d846e6a7a379 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | * SQLite match code casing with regionsettings table field casing (what's wit... (diff) | |
download | opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.zip opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.tar.gz opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.tar.bz2 opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.tar.xz |
Revolution is on the roll again! :)
Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events).
Direct flames and kudos to Revolution, please
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 340 |
1 files changed, 312 insertions, 28 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dd797fc..d339208 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -133,6 +133,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
133 | [XmlIgnore] | 133 | [XmlIgnore] |
134 | public bool DIE_AT_EDGE; | 134 | public bool DIE_AT_EDGE; |
135 | 135 | ||
136 | [XmlIgnore] | ||
137 | public bool RETURN_AT_EDGE; | ||
138 | |||
139 | [XmlIgnore] | ||
140 | public bool BlockGrab; | ||
141 | |||
142 | [XmlIgnore] | ||
143 | public bool StatusSandbox; | ||
144 | |||
145 | [XmlIgnore] | ||
146 | public Vector3 StatusSandboxPos; | ||
147 | |||
136 | // TODO: This needs to be persisted in next XML version update! | 148 | // TODO: This needs to be persisted in next XML version update! |
137 | [XmlIgnore] | 149 | [XmlIgnore] |
138 | public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; | 150 | public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; |
@@ -219,6 +231,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
219 | [XmlIgnore] | 231 | [XmlIgnore] |
220 | public Quaternion SpinOldOrientation = Quaternion.Identity; | 232 | public Quaternion SpinOldOrientation = Quaternion.Identity; |
221 | 233 | ||
234 | [XmlIgnore] | ||
235 | public Quaternion m_APIDTarget = Quaternion.Identity; | ||
236 | |||
237 | [XmlIgnore] | ||
238 | public float m_APIDDamp = 0; | ||
239 | |||
240 | [XmlIgnore] | ||
241 | public float m_APIDStrength = 0; | ||
242 | |||
222 | /// <summary> | 243 | /// <summary> |
223 | /// This part's inventory | 244 | /// This part's inventory |
224 | /// </summary> | 245 | /// </summary> |
@@ -233,6 +254,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
233 | public bool Undoing; | 254 | public bool Undoing; |
234 | 255 | ||
235 | [XmlIgnore] | 256 | [XmlIgnore] |
257 | public bool IgnoreUndoUpdate = false; | ||
258 | |||
259 | [XmlIgnore] | ||
236 | private PrimFlags LocalFlags; | 260 | private PrimFlags LocalFlags; |
237 | [XmlIgnore] | 261 | [XmlIgnore] |
238 | private float m_damage = -1.0f; | 262 | private float m_damage = -1.0f; |
@@ -253,6 +277,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
253 | private string m_text = String.Empty; | 277 | private string m_text = String.Empty; |
254 | private string m_touchName = String.Empty; | 278 | private string m_touchName = String.Empty; |
255 | private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); | 279 | private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5); |
280 | private readonly UndoStack<UndoState> m_redo = new UndoStack<UndoState>(5); | ||
256 | private UUID _creatorID; | 281 | private UUID _creatorID; |
257 | 282 | ||
258 | private bool m_passTouches; | 283 | private bool m_passTouches; |
@@ -501,6 +526,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
501 | } | 526 | } |
502 | } | 527 | } |
503 | 528 | ||
529 | [XmlIgnore] | ||
530 | public Quaternion APIDTarget | ||
531 | { | ||
532 | get { return m_APIDTarget; } | ||
533 | set { m_APIDTarget = value; } | ||
534 | } | ||
535 | |||
536 | [XmlIgnore] | ||
537 | public float APIDDamp | ||
538 | { | ||
539 | get { return m_APIDDamp; } | ||
540 | set { m_APIDDamp = value; } | ||
541 | } | ||
542 | |||
543 | [XmlIgnore] | ||
544 | public float APIDStrength | ||
545 | { | ||
546 | get { return m_APIDStrength; } | ||
547 | set { m_APIDStrength = value; } | ||
548 | } | ||
549 | |||
504 | public ulong RegionHandle | 550 | public ulong RegionHandle |
505 | { | 551 | { |
506 | get { return m_regionHandle; } | 552 | get { return m_regionHandle; } |
@@ -512,6 +558,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
512 | get { return m_scriptAccessPin; } | 558 | get { return m_scriptAccessPin; } |
513 | set { m_scriptAccessPin = (int)value; } | 559 | set { m_scriptAccessPin = (int)value; } |
514 | } | 560 | } |
561 | private SceneObjectPart m_PlaySoundMasterPrim = null; | ||
562 | public SceneObjectPart PlaySoundMasterPrim | ||
563 | { | ||
564 | get { return m_PlaySoundMasterPrim; } | ||
565 | set { m_PlaySoundMasterPrim = value; } | ||
566 | } | ||
567 | |||
568 | private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>(); | ||
569 | public List<SceneObjectPart> PlaySoundSlavePrims | ||
570 | { | ||
571 | get { return m_LoopSoundSlavePrims; } | ||
572 | set { m_LoopSoundSlavePrims = value; } | ||
573 | } | ||
574 | |||
575 | private SceneObjectPart m_LoopSoundMasterPrim = null; | ||
576 | public SceneObjectPart LoopSoundMasterPrim | ||
577 | { | ||
578 | get { return m_LoopSoundMasterPrim; } | ||
579 | set { m_LoopSoundMasterPrim = value; } | ||
580 | } | ||
581 | |||
582 | private List<SceneObjectPart> m_LoopSoundSlavePrims = new List<SceneObjectPart>(); | ||
583 | public List<SceneObjectPart> LoopSoundSlavePrims | ||
584 | { | ||
585 | get { return m_LoopSoundSlavePrims; } | ||
586 | set { m_LoopSoundSlavePrims = value; } | ||
587 | } | ||
515 | 588 | ||
516 | [XmlIgnore] | 589 | [XmlIgnore] |
517 | public Byte[] TextureAnimation | 590 | public Byte[] TextureAnimation |
@@ -573,8 +646,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
573 | } | 646 | } |
574 | set | 647 | set |
575 | { | 648 | { |
576 | StoreUndoState(); | ||
577 | |||
578 | m_groupPosition = value; | 649 | m_groupPosition = value; |
579 | 650 | ||
580 | PhysicsActor actor = PhysActor; | 651 | PhysicsActor actor = PhysActor; |
@@ -1401,6 +1472,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1401 | { | 1472 | { |
1402 | m_undo.Clear(); | 1473 | m_undo.Clear(); |
1403 | } | 1474 | } |
1475 | lock (m_redo) | ||
1476 | { | ||
1477 | m_redo.Clear(); | ||
1478 | } | ||
1404 | StoreUndoState(); | 1479 | StoreUndoState(); |
1405 | } | 1480 | } |
1406 | 1481 | ||
@@ -1711,6 +1786,66 @@ namespace OpenSim.Region.Framework.Scenes | |||
1711 | return m_parentGroup.RootPart.DIE_AT_EDGE; | 1786 | return m_parentGroup.RootPart.DIE_AT_EDGE; |
1712 | } | 1787 | } |
1713 | 1788 | ||
1789 | public bool GetReturnAtEdge() | ||
1790 | { | ||
1791 | if (m_parentGroup == null) | ||
1792 | return false; | ||
1793 | if (m_parentGroup.IsDeleted) | ||
1794 | return false; | ||
1795 | |||
1796 | return m_parentGroup.RootPart.RETURN_AT_EDGE; | ||
1797 | } | ||
1798 | |||
1799 | public void SetReturnAtEdge(bool p) | ||
1800 | { | ||
1801 | if (m_parentGroup == null) | ||
1802 | return; | ||
1803 | if (m_parentGroup.IsDeleted) | ||
1804 | return; | ||
1805 | |||
1806 | m_parentGroup.RootPart.RETURN_AT_EDGE = p; | ||
1807 | } | ||
1808 | |||
1809 | public bool GetBlockGrab() | ||
1810 | { | ||
1811 | if (m_parentGroup == null) | ||
1812 | return false; | ||
1813 | if (m_parentGroup.IsDeleted) | ||
1814 | return false; | ||
1815 | |||
1816 | return m_parentGroup.RootPart.BlockGrab; | ||
1817 | } | ||
1818 | |||
1819 | public void SetBlockGrab(bool p) | ||
1820 | { | ||
1821 | if (m_parentGroup == null) | ||
1822 | return; | ||
1823 | if (m_parentGroup.IsDeleted) | ||
1824 | return; | ||
1825 | |||
1826 | m_parentGroup.RootPart.BlockGrab = p; | ||
1827 | } | ||
1828 | |||
1829 | public void SetStatusSandbox(bool p) | ||
1830 | { | ||
1831 | if (m_parentGroup == null) | ||
1832 | return; | ||
1833 | if (m_parentGroup.IsDeleted) | ||
1834 | return; | ||
1835 | StatusSandboxPos = m_parentGroup.RootPart.AbsolutePosition; | ||
1836 | m_parentGroup.RootPart.StatusSandbox = p; | ||
1837 | } | ||
1838 | |||
1839 | public bool GetStatusSandbox() | ||
1840 | { | ||
1841 | if (m_parentGroup == null) | ||
1842 | return false; | ||
1843 | if (m_parentGroup.IsDeleted) | ||
1844 | return false; | ||
1845 | |||
1846 | return m_parentGroup.RootPart.StatusSandbox; | ||
1847 | } | ||
1848 | |||
1714 | public int GetAxisRotation(int axis) | 1849 | public int GetAxisRotation(int axis) |
1715 | { | 1850 | { |
1716 | //Cannot use ScriptBaseClass constants as no referance to it currently. | 1851 | //Cannot use ScriptBaseClass constants as no referance to it currently. |
@@ -1917,7 +2052,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1917 | // play the sound. | 2052 | // play the sound. |
1918 | if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f) | 2053 | if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f) |
1919 | { | 2054 | { |
1920 | SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0); | 2055 | SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false); |
1921 | } | 2056 | } |
1922 | 2057 | ||
1923 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) | 2058 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) |
@@ -2491,9 +2626,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2491 | List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); | 2626 | List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars(); |
2492 | foreach (ScenePresence p in avatarts) | 2627 | foreach (ScenePresence p in avatarts) |
2493 | { | 2628 | { |
2494 | // TODO: some filtering by distance of avatar | 2629 | if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100)) |
2495 | 2630 | p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | |
2496 | p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | ||
2497 | } | 2631 | } |
2498 | } | 2632 | } |
2499 | 2633 | ||
@@ -2554,7 +2688,38 @@ namespace OpenSim.Region.Framework.Scenes | |||
2554 | 2688 | ||
2555 | public void RotLookAt(Quaternion target, float strength, float damping) | 2689 | public void RotLookAt(Quaternion target, float strength, float damping) |
2556 | { | 2690 | { |
2557 | m_parentGroup.rotLookAt(target, strength, damping); | 2691 | rotLookAt(target, strength, damping); |
2692 | } | ||
2693 | |||
2694 | public void rotLookAt(Quaternion target, float strength, float damping) | ||
2695 | { | ||
2696 | if (IsAttachment) | ||
2697 | { | ||
2698 | /* | ||
2699 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | ||
2700 | if (avatar != null) | ||
2701 | { | ||
2702 | Rotate the Av? | ||
2703 | } */ | ||
2704 | } | ||
2705 | else | ||
2706 | { | ||
2707 | APIDDamp = damping; | ||
2708 | APIDStrength = strength; | ||
2709 | APIDTarget = target; | ||
2710 | } | ||
2711 | } | ||
2712 | |||
2713 | public void startLookAt(Quaternion rot, float damp, float strength) | ||
2714 | { | ||
2715 | APIDDamp = damp; | ||
2716 | APIDStrength = strength; | ||
2717 | APIDTarget = rot; | ||
2718 | } | ||
2719 | |||
2720 | public void stopLookAt() | ||
2721 | { | ||
2722 | APIDTarget = Quaternion.Identity; | ||
2558 | } | 2723 | } |
2559 | 2724 | ||
2560 | /// <summary> | 2725 | /// <summary> |
@@ -2814,7 +2979,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2814 | /// <param name="volume"></param> | 2979 | /// <param name="volume"></param> |
2815 | /// <param name="triggered"></param> | 2980 | /// <param name="triggered"></param> |
2816 | /// <param name="flags"></param> | 2981 | /// <param name="flags"></param> |
2817 | public void SendSound(string sound, double volume, bool triggered, byte flags) | 2982 | public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster) |
2818 | { | 2983 | { |
2819 | if (volume > 1) | 2984 | if (volume > 1) |
2820 | volume = 1; | 2985 | volume = 1; |
@@ -2850,10 +3015,51 @@ namespace OpenSim.Region.Framework.Scenes | |||
2850 | ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>(); | 3015 | ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>(); |
2851 | if (soundModule != null) | 3016 | if (soundModule != null) |
2852 | { | 3017 | { |
2853 | if (triggered) | 3018 | if (useMaster) |
2854 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle); | 3019 | { |
3020 | if (isMaster) | ||
3021 | { | ||
3022 | if (triggered) | ||
3023 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
3024 | else | ||
3025 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
3026 | ParentGroup.PlaySoundMasterPrim = this; | ||
3027 | ownerID = this._ownerID; | ||
3028 | objectID = this.UUID; | ||
3029 | parentID = this.GetRootPartUUID(); | ||
3030 | position = this.AbsolutePosition; // region local | ||
3031 | regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle; | ||
3032 | if (triggered) | ||
3033 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
3034 | else | ||
3035 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
3036 | foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) | ||
3037 | { | ||
3038 | ownerID = prim._ownerID; | ||
3039 | objectID = prim.UUID; | ||
3040 | parentID = prim.GetRootPartUUID(); | ||
3041 | position = prim.AbsolutePosition; // region local | ||
3042 | regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle; | ||
3043 | if (triggered) | ||
3044 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
3045 | else | ||
3046 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
3047 | } | ||
3048 | ParentGroup.PlaySoundSlavePrims.Clear(); | ||
3049 | ParentGroup.PlaySoundMasterPrim = null; | ||
3050 | } | ||
3051 | else | ||
3052 | { | ||
3053 | ParentGroup.PlaySoundSlavePrims.Add(this); | ||
3054 | } | ||
3055 | } | ||
2855 | else | 3056 | else |
2856 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags); | 3057 | { |
3058 | if (triggered) | ||
3059 | soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); | ||
3060 | else | ||
3061 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | ||
3062 | } | ||
2857 | } | 3063 | } |
2858 | } | 3064 | } |
2859 | 3065 | ||
@@ -3156,6 +3362,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3156 | hasProfileCut = hasDimple; // is it the same thing? | 3362 | hasProfileCut = hasDimple; // is it the same thing? |
3157 | } | 3363 | } |
3158 | 3364 | ||
3365 | public void SetVehicleFlags(int param, bool remove) | ||
3366 | { | ||
3367 | if (PhysActor != null) | ||
3368 | { | ||
3369 | PhysActor.VehicleFlags(param, remove); | ||
3370 | } | ||
3371 | } | ||
3372 | |||
3159 | public void SetGroup(UUID groupID, IClientAPI client) | 3373 | public void SetGroup(UUID groupID, IClientAPI client) |
3160 | { | 3374 | { |
3161 | _groupID = groupID; | 3375 | _groupID = groupID; |
@@ -3260,27 +3474,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
3260 | { | 3474 | { |
3261 | if (!Undoing) | 3475 | if (!Undoing) |
3262 | { | 3476 | { |
3263 | if (m_parentGroup != null) | 3477 | if (!IgnoreUndoUpdate) |
3264 | { | 3478 | { |
3265 | lock (m_undo) | 3479 | if (m_parentGroup != null) |
3266 | { | 3480 | { |
3267 | if (m_undo.Count > 0) | 3481 | lock (m_undo) |
3268 | { | 3482 | { |
3269 | UndoState last = m_undo.Peek(); | 3483 | if (m_undo.Count > 0) |
3270 | if (last != null) | ||
3271 | { | 3484 | { |
3272 | if (last.Compare(this)) | 3485 | UndoState last = m_undo.Peek(); |
3273 | return; | 3486 | if (last != null) |
3487 | { | ||
3488 | if (last.Compare(this)) | ||
3489 | return; | ||
3490 | } | ||
3274 | } | 3491 | } |
3275 | } | ||
3276 | 3492 | ||
3277 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 3493 | if (m_parentGroup.GetSceneMaxUndo() > 0) |
3278 | { | 3494 | { |
3279 | UndoState nUndo = new UndoState(this); | 3495 | UndoState nUndo = new UndoState(this); |
3280 | 3496 | ||
3281 | m_undo.Push(nUndo); | 3497 | m_undo.Push(nUndo); |
3282 | } | 3498 | } |
3283 | 3499 | ||
3500 | } | ||
3284 | } | 3501 | } |
3285 | } | 3502 | } |
3286 | } | 3503 | } |
@@ -3751,11 +3968,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
3751 | lock (m_undo) | 3968 | lock (m_undo) |
3752 | { | 3969 | { |
3753 | if (m_undo.Count > 0) | 3970 | if (m_undo.Count > 0) |
3971 | { | ||
3972 | UndoState nUndo = null; | ||
3973 | if (m_parentGroup.GetSceneMaxUndo() > 0) | ||
3754 | { | 3974 | { |
3755 | UndoState goback = m_undo.Pop(); | 3975 | nUndo = new UndoState(this); |
3756 | if (goback != null) | 3976 | } |
3757 | goback.PlaybackState(this); | 3977 | UndoState goback = m_undo.Pop(); |
3978 | if (goback != null) | ||
3979 | { | ||
3980 | goback.PlaybackState(this); | ||
3981 | if (nUndo != null) | ||
3982 | m_redo.Push(nUndo); | ||
3983 | } | ||
3984 | } | ||
3985 | } | ||
3986 | } | ||
3987 | |||
3988 | public void Redo() | ||
3989 | { | ||
3990 | lock (m_redo) | ||
3991 | { | ||
3992 | if (m_parentGroup.GetSceneMaxUndo() > 0) | ||
3993 | { | ||
3994 | UndoState nUndo = new UndoState(this); | ||
3995 | |||
3996 | m_undo.Push(nUndo); | ||
3758 | } | 3997 | } |
3998 | UndoState gofwd = m_redo.Pop(); | ||
3999 | if (gofwd != null) | ||
4000 | gofwd.PlayfwdState(this); | ||
3759 | } | 4001 | } |
3760 | } | 4002 | } |
3761 | 4003 | ||
@@ -3802,6 +4044,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3802 | (pos.Z != OffsetPosition.Z)) | 4044 | (pos.Z != OffsetPosition.Z)) |
3803 | { | 4045 | { |
3804 | Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); | 4046 | Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); |
4047 | |||
4048 | if (ParentGroup.RootPart.GetStatusSandbox()) | ||
4049 | { | ||
4050 | if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10) | ||
4051 | { | ||
4052 | ParentGroup.RootPart.ScriptSetPhysicsStatus(false); | ||
4053 | newPos = OffsetPosition; | ||
4054 | ParentGroup.Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), | ||
4055 | ChatTypeEnum.DebugChannel, 0x7FFFFFFF, ParentGroup.RootPart.AbsolutePosition, Name, UUID, false); | ||
4056 | } | ||
4057 | } | ||
4058 | |||
3805 | OffsetPosition = newPos; | 4059 | OffsetPosition = newPos; |
3806 | ScheduleTerseUpdate(); | 4060 | ScheduleTerseUpdate(); |
3807 | } | 4061 | } |
@@ -4094,7 +4348,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4094 | (rot.Z != RotationOffset.Z) || | 4348 | (rot.Z != RotationOffset.Z) || |
4095 | (rot.W != RotationOffset.W)) | 4349 | (rot.W != RotationOffset.W)) |
4096 | { | 4350 | { |
4097 | //StoreUndoState(); | ||
4098 | RotationOffset = rot; | 4351 | RotationOffset = rot; |
4099 | ParentGroup.HasGroupChanged = true; | 4352 | ParentGroup.HasGroupChanged = true; |
4100 | ScheduleTerseUpdate(); | 4353 | ScheduleTerseUpdate(); |
@@ -4396,5 +4649,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
4396 | 4649 | ||
4397 | Inventory.ApplyNextOwnerPermissions(); | 4650 | Inventory.ApplyNextOwnerPermissions(); |
4398 | } | 4651 | } |
4652 | public void UpdateLookAt() | ||
4653 | { | ||
4654 | try | ||
4655 | { | ||
4656 | if (APIDTarget != Quaternion.Identity) | ||
4657 | { | ||
4658 | if (Single.IsNaN(APIDTarget.W) == true) | ||
4659 | { | ||
4660 | APIDTarget = Quaternion.Identity; | ||
4661 | return; | ||
4662 | } | ||
4663 | Quaternion rot = RotationOffset; | ||
4664 | Quaternion dir = (rot - APIDTarget); | ||
4665 | float speed = ((APIDStrength / APIDDamp) * (float)(Math.PI / 180.0f)); | ||
4666 | if (dir.Z > speed) | ||
4667 | { | ||
4668 | rot.Z -= speed; | ||
4669 | } | ||
4670 | if (dir.Z < -speed) | ||
4671 | { | ||
4672 | rot.Z += speed; | ||
4673 | } | ||
4674 | rot.Normalize(); | ||
4675 | UpdateRotation(rot); | ||
4676 | } | ||
4677 | } | ||
4678 | catch (Exception ex) | ||
4679 | { | ||
4680 | m_log.Error("[Physics] " + ex); | ||
4681 | } | ||
4682 | } | ||
4399 | } | 4683 | } |
4400 | } | 4684 | } |