diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4778cf8..c8deec5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -13483,8 +13483,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13483 | { | 13483 | { |
13484 | avpos = av.OffsetPosition; | 13484 | avpos = av.OffsetPosition; |
13485 | 13485 | ||
13486 | Vector3 sitOffset = (Zrot(av.Rotation)) * (av.Appearance.AvatarHeight * 0.02638f *2.0f); | 13486 | if(!av.LegacySitOffsets) |
13487 | avpos -= sitOffset; | 13487 | { |
13488 | Vector3 sitOffset = (Zrot(av.Rotation)) * (av.Appearance.AvatarHeight * 0.02638f *2.0f); | ||
13489 | avpos -= sitOffset; | ||
13490 | } | ||
13491 | |||
13488 | SceneObjectPart sitRoot = av.ParentPart.ParentGroup.RootPart; | 13492 | SceneObjectPart sitRoot = av.ParentPart.ParentGroup.RootPart; |
13489 | avpos = sitRoot.GetWorldPosition() + avpos * sitRoot.GetWorldRotation(); | 13493 | avpos = sitRoot.GetWorldPosition() + avpos * sitRoot.GetWorldRotation(); |
13490 | } | 13494 | } |
@@ -15731,9 +15735,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
15731 | LSL_Vector v; | 15735 | LSL_Vector v; |
15732 | v = rules.GetVector3Item(idx++); | 15736 | v = rules.GetVector3Item(idx++); |
15733 | 15737 | ||
15734 | LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); | 15738 | if(!av.LegacySitOffsets) |
15739 | { | ||
15740 | LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); | ||
15735 | 15741 | ||
15736 | v = v + 2 * sitOffset; | 15742 | v = v + 2 * sitOffset; |
15743 | } | ||
15737 | 15744 | ||
15738 | av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z); | 15745 | av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z); |
15739 | positionChanged = true; | 15746 | positionChanged = true; |
@@ -15910,8 +15917,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
15910 | { | 15917 | { |
15911 | pos = avatar.OffsetPosition; | 15918 | pos = avatar.OffsetPosition; |
15912 | 15919 | ||
15913 | Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f); | 15920 | if(!avatar.LegacySitOffsets) |
15914 | pos -= sitOffset; | 15921 | { |
15922 | Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f); | ||
15923 | pos -= sitOffset; | ||
15924 | } | ||
15915 | 15925 | ||
15916 | SceneObjectPart sitroot = sitPart.ParentGroup.RootPart; | 15926 | SceneObjectPart sitroot = sitPart.ParentGroup.RootPart; |
15917 | pos = sitroot.AbsolutePosition + pos * sitroot.GetWorldRotation(); | 15927 | pos = sitroot.AbsolutePosition + pos * sitroot.GetWorldRotation(); |
@@ -16104,8 +16114,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
16104 | 16114 | ||
16105 | case (int)ScriptBaseClass.PRIM_POS_LOCAL: | 16115 | case (int)ScriptBaseClass.PRIM_POS_LOCAL: |
16106 | Vector3 lpos = avatar.OffsetPosition; | 16116 | Vector3 lpos = avatar.OffsetPosition; |
16107 | Vector3 lsitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f * 2.0f); | 16117 | |
16108 | lpos -= lsitOffset; | 16118 | if(!avatar.LegacySitOffsets) |
16119 | { | ||
16120 | Vector3 lsitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f * 2.0f); | ||
16121 | lpos -= lsitOffset; | ||
16122 | } | ||
16109 | 16123 | ||
16110 | res.Add(new LSL_Vector(lpos.X,lpos.Y,lpos.Z)); | 16124 | res.Add(new LSL_Vector(lpos.X,lpos.Y,lpos.Z)); |
16111 | break; | 16125 | break; |