aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorUbitUmarov2012-06-13 01:26:15 +0100
committerUbitUmarov2012-06-13 01:26:15 +0100
commitb4ab9a735007604caba2253077434299b4f81b65 (patch)
tree1d6b3e4c7c15db6fc5eab32064c990538f3f34d2 /OpenSim/Region/ScriptEngine/Shared
parent try to replicate SL bug of PRIM_ROTATION also for avas, est a fix to other c... (diff)
downloadopensim-SC-b4ab9a735007604caba2253077434299b4f81b65.zip
opensim-SC-b4ab9a735007604caba2253077434299b4f81b65.tar.gz
opensim-SC-b4ab9a735007604caba2253077434299b4f81b65.tar.bz2
opensim-SC-b4ab9a735007604caba2253077434299b4f81b65.tar.xz
*TEST this will affect inworld sittargets by +-0.1m, so may be very BAD *. Changed the sign of the sitoffset dependent on avatar size in SP.cs. Removed that offset correction from SET/GET..primitiveParams in LSL api. If the sign needs to be the previus one, then all references to avatar positions on LSL api need to be fixed with that correction, not only SET/GETprimitiveParams.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs26
1 files changed, 17 insertions, 9 deletions
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