aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorubit2012-06-13 03:07:54 +0200
committerubit2012-06-13 03:07:54 +0200
commitcbeb7c8aef3cee2a15bf645e0c26c69b4f26e368 (patch)
treea3c6f8095d595b9f351f6f80f6d48f3acb63b660
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parentFixed llGetObjectDetails(), OBJECT_ROT for sitting avatars case, plus 'cosmet... (diff)
downloadopensim-SC_OLD-cbeb7c8aef3cee2a15bf645e0c26c69b4f26e368.zip
opensim-SC_OLD-cbeb7c8aef3cee2a15bf645e0c26c69b4f26e368.tar.gz
opensim-SC_OLD-cbeb7c8aef3cee2a15bf645e0c26c69b4f26e368.tar.bz2
opensim-SC_OLD-cbeb7c8aef3cee2a15bf645e0c26c69b4f26e368.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs58
2 files changed, 42 insertions, 19 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..9772c5a 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
@@ -11792,6 +11800,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11792 11800
11793 LSL_List ret = new LSL_List(); 11801 LSL_List ret = new LSL_List();
11794 UUID key = new UUID(); 11802 UUID key = new UUID();
11803
11804
11795 if (UUID.TryParse(id, out key)) 11805 if (UUID.TryParse(id, out key))
11796 { 11806 {
11797 ScenePresence av = World.GetScenePresence(key); 11807 ScenePresence av = World.GetScenePresence(key);
@@ -11809,13 +11819,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11809 ret.Add(new LSL_String("")); 11819 ret.Add(new LSL_String(""));
11810 break; 11820 break;
11811 case ScriptBaseClass.OBJECT_POS: 11821 case ScriptBaseClass.OBJECT_POS:
11812 ret.Add(new LSL_Vector((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z)); 11822 Vector3 avpos = av.AbsolutePosition;
11823 ret.Add(new LSL_Vector((double)avpos.X, (double)avpos.Y, (double)avpos.Z));
11813 break; 11824 break;
11814 case ScriptBaseClass.OBJECT_ROT: 11825 case ScriptBaseClass.OBJECT_ROT:
11815 ret.Add(new LSL_Rotation((double)av.Rotation.X, (double)av.Rotation.Y, (double)av.Rotation.Z, (double)av.Rotation.W)); 11826 Quaternion avrot = av.Rotation;
11827 if(av.ParentID != 0 && av.ParentPart != null)
11828 {
11829 avrot = av.ParentPart.GetWorldRotation() * avrot;
11830 }
11831 ret.Add(new LSL_Rotation((double)avrot.X, (double)avrot.Y, (double)avrot.Z, (double)avrot.W));
11816 break; 11832 break;
11817 case ScriptBaseClass.OBJECT_VELOCITY: 11833 case ScriptBaseClass.OBJECT_VELOCITY:
11818 ret.Add(new LSL_Vector(av.Velocity.X, av.Velocity.Y, av.Velocity.Z)); 11834 Vector3 avvel = av.Velocity;
11835 ret.Add(new LSL_Vector((double)avvel.X, (double)avvel.Y, (double)avvel.Z));
11819 break; 11836 break;
11820 case ScriptBaseClass.OBJECT_OWNER: 11837 case ScriptBaseClass.OBJECT_OWNER:
11821 ret.Add(new LSL_String(id)); 11838 ret.Add(new LSL_String(id));
@@ -11871,17 +11888,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11871 case ScriptBaseClass.OBJECT_NAME: 11888 case ScriptBaseClass.OBJECT_NAME:
11872 ret.Add(new LSL_String(obj.Name)); 11889 ret.Add(new LSL_String(obj.Name));
11873 break; 11890 break;
11874 case ScriptBaseClass.OBJECT_DESC: 11891 case ScriptBaseClass.OBJECT_DESC:
11875 ret.Add(new LSL_String(obj.Description)); 11892 ret.Add(new LSL_String(obj.Description));
11876 break; 11893 break;
11877 case ScriptBaseClass.OBJECT_POS: 11894 case ScriptBaseClass.OBJECT_POS:
11878 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); 11895 Vector3 opos = obj.AbsolutePosition;
11896 ret.Add(new LSL_Vector(opos.X, opos.Y, opos.Z));
11879 break; 11897 break;
11880 case ScriptBaseClass.OBJECT_ROT: 11898 case ScriptBaseClass.OBJECT_ROT:
11881 ret.Add(new LSL_Rotation(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W)); 11899 Quaternion orot = obj.RotationOffset;
11900 ret.Add(new LSL_Rotation(orot.X, orot.Y, orot.Z, orot.W));
11882 break; 11901 break;
11883 case ScriptBaseClass.OBJECT_VELOCITY: 11902 case ScriptBaseClass.OBJECT_VELOCITY:
11884 ret.Add(new LSL_Vector(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z)); 11903 Vector3 ovel = obj.Velocity;
11904 ret.Add(new LSL_Vector(ovel.X, ovel.Y, ovel.Z));
11885 break; 11905 break;
11886 case ScriptBaseClass.OBJECT_OWNER: 11906 case ScriptBaseClass.OBJECT_OWNER:
11887 ret.Add(new LSL_String(obj.OwnerID.ToString())); 11907 ret.Add(new LSL_String(obj.OwnerID.ToString()));
@@ -11919,17 +11939,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11919 // The value returned in SL for normal prims is prim count 11939 // The value returned in SL for normal prims is prim count
11920 ret.Add(new LSL_Integer(0)); 11940 ret.Add(new LSL_Integer(0));
11921 break; 11941 break;
11942
11943 // costs below may need to be diferent for root parts, need to check
11922 case ScriptBaseClass.OBJECT_SERVER_COST: 11944 case ScriptBaseClass.OBJECT_SERVER_COST:
11923 // The value returned in SL for normal prims is prim count 11945 // The value returned in SL for normal prims is prim count
11924 ret.Add(new LSL_Float(0)); 11946 ret.Add(new LSL_Float(0));
11925 break; 11947 break;
11926 case ScriptBaseClass.OBJECT_STREAMING_COST: 11948 case ScriptBaseClass.OBJECT_STREAMING_COST:
11927 // The value returned in SL for normal prims is prim count * 0.06 11949 // The value returned in SL for normal prims is prim count * 0.06
11928 ret.Add(new LSL_Float(0)); 11950 ret.Add(new LSL_Float(obj.StreamingCost));
11929 break; 11951 break;
11930 case ScriptBaseClass.OBJECT_PHYSICS_COST: 11952 case ScriptBaseClass.OBJECT_PHYSICS_COST:
11931 // The value returned in SL for normal prims is prim count 11953 // The value returned in SL for normal prims is prim count
11932 ret.Add(new LSL_Float(0)); 11954 ret.Add(new LSL_Float(obj.PhysicsCost));
11933 break; 11955 break;
11934 default: 11956 default:
11935 // Invalid or unhandled constant. 11957 // Invalid or unhandled constant.