aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs26
2 files changed, 19 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a810de2..059d4c2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2383,7 +2383,8 @@ namespace OpenSim.Region.Framework.Scenes
2383 2383
2384 Vector3 up = new Vector3((float)x, (float)y, (float)z); 2384 Vector3 up = new Vector3((float)x, (float)y, (float)z);
2385 Vector3 sitOffset = up * Appearance.AvatarHeight * 0.02638f; 2385 Vector3 sitOffset = up * Appearance.AvatarHeight * 0.02638f;
2386 m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT; 2386// m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
2387 m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset;
2387 Rotation = sitTargetOrient; 2388 Rotation = sitTargetOrient;
2388 ParentPosition = part.AbsolutePosition; 2389 ParentPosition = part.AbsolutePosition;
2389 part.ParentGroup.AddAvatar(UUID); 2390 part.ParentGroup.AddAvatar(UUID);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 31ce2c4..891d4d6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7964,8 +7964,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7964 Quaternion rot = sitpart.RotationOffset; 7964 Quaternion rot = sitpart.RotationOffset;
7965 pos *= Quaternion.Conjugate(rot); // removed sit part rotation 7965 pos *= Quaternion.Conjugate(rot); // removed sit part rotation
7966 7966
7967 Vector3 sitOffset = (Zrot(av.Rotation)) * (av.Appearance.AvatarHeight * 0.02638f); 7967// Vector3 sitOffset = (Zrot(av.Rotation)) * (av.Appearance.AvatarHeight * 0.02638f);
7968 pos += sitOffset; 7968// pos += sitOffset;
7969 7969
7970 finalPos = pos; 7970 finalPos = pos;
7971 positionChanged = true; 7971 positionChanged = true;
@@ -7984,11 +7984,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7984 Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested world rotation 7984 Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested world rotation
7985 7985
7986// need to replicate SL bug 7986// need to replicate SL bug
7987
7988 SceneObjectGroup sitgrp = sitpart.ParentGroup; 7987 SceneObjectGroup sitgrp = sitpart.ParentGroup;
7989 if (sitgrp != null && sitgrp.RootPart != sitpart) 7988 if (sitgrp != null && sitgrp.RootPart != sitpart)
7990 { 7989 {
7991 rot *= sitgrp.RootPart.RotationOffset; 7990 rot = sitgrp.RootPart.RotationOffset * rot;
7992 } 7991 }
7993 7992
7994 Quaternion srot = sitpart.GetWorldRotation(); 7993 Quaternion srot = sitpart.GetWorldRotation();
@@ -8956,9 +8955,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8956 break; 8955 break;
8957 8956
8958 case (int)ScriptBaseClass.PRIM_POSITION: 8957 case (int)ScriptBaseClass.PRIM_POSITION:
8959 Vector3 pos = avatar.AbsolutePosition; 8958
8960 Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f); 8959 // can't use Abs pos to extract offset...
8961 pos -= sitOffset; 8960// Vector3 pos = avatar.AbsolutePosition;
8961 Vector3 pos = avatar.OffsetPosition;
8962
8963// Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f);
8964// pos -= sitOffset;
8965
8966 if( sitPart != null)
8967 pos = sitPart.GetWorldPosition() + pos * sitPart.GetWorldRotation();
8968
8962 res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z)); 8969 res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z));
8963 break; 8970 break;
8964 8971
@@ -9153,12 +9160,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9153 9160
9154 case (int)ScriptBaseClass.PRIM_POS_LOCAL: 9161 case (int)ScriptBaseClass.PRIM_POS_LOCAL:
9155 Vector3 lpos = avatar.OffsetPosition; // pos relative to sit part 9162 Vector3 lpos = avatar.OffsetPosition; // pos relative to sit part
9163// Vector3 lsitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f);
9164// lpos -= lsitOffset;
9165
9156 if (sitPart != null) 9166 if (sitPart != null)
9157 { 9167 {
9158 lpos = sitPart.OffsetPosition + (lpos * sitPart.RotationOffset); // make it relative to root prim 9168 lpos = sitPart.OffsetPosition + (lpos * sitPart.RotationOffset); // make it relative to root prim
9159 } 9169 }
9160 Vector3 lsitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f);
9161 lpos -= lsitOffset;
9162 res.Add(new LSL_Vector(lpos.X,lpos.Y,lpos.Z)); 9170 res.Add(new LSL_Vector(lpos.X,lpos.Y,lpos.Z));
9163 break; 9171 break;
9164 9172