diff options
author | UbitUmarov | 2012-06-12 02:20:47 +0100 |
---|---|---|
committer | UbitUmarov | 2012-06-12 02:20:47 +0100 |
commit | 5fd6f678a46de8109d7178ba788e458053e34c06 (patch) | |
tree | ee1134863f51f52ab863406bc0c8f652c44842da /OpenSim/Region/ScriptEngine/Shared | |
parent | *UNTESTED* extended llGet*PrimitiveParam() to support avatars. Some auxiliar ... (diff) | |
download | opensim-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
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 27 |
1 files changed, 22 insertions, 5 deletions
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 | } |