aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2012-06-12 02:20:47 +0100
committerUbitUmarov2012-06-12 02:20:47 +0100
commit5fd6f678a46de8109d7178ba788e458053e34c06 (patch)
treeee1134863f51f52ab863406bc0c8f652c44842da
parent*UNTESTED* extended llGet*PrimitiveParam() to support avatars. Some auxiliar ... (diff)
downloadopensim-SC_OLD-5fd6f678a46de8109d7178ba788e458053e34c06.zip
opensim-SC_OLD-5fd6f678a46de8109d7178ba788e458053e34c06.tar.gz
opensim-SC_OLD-5fd6f678a46de8109d7178ba788e458053e34c06.tar.bz2
opensim-SC_OLD-5fd6f678a46de8109d7178ba788e458053e34c06.tar.xz
Moved auxiliar funtions of last commit from sop to lsl api since they are only used on one place each
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs34
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs27
2 files changed, 22 insertions, 39 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 21e2878..a810de2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -519,40 +519,6 @@ namespace OpenSim.Region.Framework.Scenes
519 } 519 }
520 } 520 }
521 521
522 // returns offset position relative to root prim of object when siting
523 public Vector3 OffsetPositionToSOGRoot
524 {
525 get
526 {
527 if (ParentPart != null)
528 return ParentPart.OffsetPosition + (m_pos * ParentPart.RotationOffset);
529 else
530 return m_pos;
531 }
532 }
533
534 public Quaternion OffsetRotationToSOGRoot
535 {
536 get
537 {
538 if (ParentPart != null)
539 return ParentPart.RotationOffset * Rotation;
540 else
541 return Rotation;
542 }
543 }
544
545 public Quaternion WorldRotation
546 {
547 get
548 {
549 if (ParentPart != null)
550 return ParentPart.GetWorldRotation() * Rotation;
551 else
552 return Rotation;
553 }
554 }
555
556 /// <summary> 522 /// <summary>
557 /// Current velocity of the avatar. 523 /// Current velocity of the avatar.
558 /// </summary> 524 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b2c21cd..4f6803f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -8914,6 +8914,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8914 // replies as SL wiki 8914 // replies as SL wiki
8915 8915
8916 LSL_List res = new LSL_List(); 8916 LSL_List res = new LSL_List();
8917 SceneObjectPart sitPart = avatar.ParentPart; // most likelly it will be needed
8917 int idx = 0; 8918 int idx = 0;
8918 while (idx < rules.Length) 8919 while (idx < rules.Length)
8919 { 8920 {
@@ -8949,7 +8950,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8949 break; 8950 break;
8950 8951
8951 case (int)ScriptBaseClass.PRIM_ROTATION: 8952 case (int)ScriptBaseClass.PRIM_ROTATION:
8952 Quaternion rot = avatar.WorldRotation; 8953 Quaternion rot = avatar.Rotation;
8954 if (sitPart != null)
8955 {
8956 rot = sitPart.GetWorldRotation() * rot; // apply sit part world rotation
8957 }
8958
8953 res.Add(new LSL_Rotation (rot.X, rot.Y, rot.Z, rot.W)); 8959 res.Add(new LSL_Rotation (rot.X, rot.Y, rot.Z, rot.W));
8954 break; 8960 break;
8955 8961
@@ -9036,7 +9042,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9036 return res; 9042 return res;
9037 face = (int)rules.GetLSLIntegerItem(idx++); 9043 face = (int)rules.GetLSLIntegerItem(idx++);
9038 9044
9039 int fullbright;
9040 if (face == ScriptBaseClass.ALL_SIDES) 9045 if (face == ScriptBaseClass.ALL_SIDES)
9041 { 9046 {
9042 for (face = 0; face < 21; face++) 9047 for (face = 0; face < 21; face++)
@@ -9110,18 +9115,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9110 res.Add(new LSL_Vector(0f,0f,0f)); 9115 res.Add(new LSL_Vector(0f,0f,0f));
9111 res.Add(new LSL_Float(1.0f)); 9116 res.Add(new LSL_Float(1.0f));
9112 break; 9117 break;
9118
9113 case (int)ScriptBaseClass.PRIM_NAME: 9119 case (int)ScriptBaseClass.PRIM_NAME:
9114 res.Add(new LSL_String(avatar.Name)); 9120 res.Add(new LSL_String(avatar.Name));
9115 break; 9121 break;
9122
9116 case (int)ScriptBaseClass.PRIM_DESC: 9123 case (int)ScriptBaseClass.PRIM_DESC:
9117 res.Add(new LSL_String("")); 9124 res.Add(new LSL_String(""));
9118 break; 9125 break;
9119 case (int)ScriptBaseClass.PRIM_ROT_LOCAL: 9126
9120 Quaternion lrot = avatar.OffsetRotationToSOGRoot; 9127 case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
9128 Quaternion lrot = avatar.Rotation;
9129 if (sitPart != null)
9130 {
9131 lrot = sitPart.RotationOffset * lrot; // apply sit part rotation offset
9132 }
9121 res.Add(new LSL_Rotation(lrot.X, lrot.Y, lrot.Z, lrot.W)); 9133 res.Add(new LSL_Rotation(lrot.X, lrot.Y, lrot.Z, lrot.W));
9122 break; 9134 break;
9135
9123 case (int)ScriptBaseClass.PRIM_POS_LOCAL: 9136 case (int)ScriptBaseClass.PRIM_POS_LOCAL:
9124 Vector3 lpos = avatar.OffsetPositionToSOGRoot; 9137 Vector3 lpos = avatar.OffsetPosition; // pos relative to sit part
9138 if (sitPart != null)
9139 {
9140 lpos = sitPart.OffsetPosition + (lpos * sitPart.RotationOffset); // make it relative to root prim
9141 }
9125 res.Add(new LSL_Vector(lpos.X,lpos.Y,lpos.Z)); 9142 res.Add(new LSL_Vector(lpos.X,lpos.Y,lpos.Z));
9126 break; 9143 break;
9127 } 9144 }