diff options
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1e98a49..9526ba8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -13069,21 +13069,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13069 | LSL_Vector v; | 13069 | LSL_Vector v; |
13070 | v = rules.GetVector3Item(idx++); | 13070 | v = rules.GetVector3Item(idx++); |
13071 | 13071 | ||
13072 | SceneObjectPart part = World.GetSceneObjectPart(av.ParentID); | ||
13073 | if (part == null) | ||
13074 | break; | ||
13075 | |||
13076 | LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION; | ||
13077 | LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR; | ||
13078 | if (part.LinkNum > 1) | ||
13079 | { | ||
13080 | localRot = GetPartLocalRot(part); | ||
13081 | localPos = GetPartLocalPos(part); | ||
13082 | } | ||
13083 | |||
13084 | v -= localPos; | ||
13085 | v /= localRot; | ||
13086 | |||
13087 | LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); | 13072 | LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); |
13088 | 13073 | ||
13089 | v = v + 2 * sitOffset; | 13074 | v = v + 2 * sitOffset; |
@@ -13103,18 +13088,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13103 | LSL_Rotation r; | 13088 | LSL_Rotation r; |
13104 | r = rules.GetQuaternionItem(idx++); | 13089 | r = rules.GetQuaternionItem(idx++); |
13105 | 13090 | ||
13106 | SceneObjectPart part = World.GetSceneObjectPart(av.ParentID); | 13091 | av.Rotation = r * llGetRootRotation(); |
13107 | if (part == null) | ||
13108 | break; | ||
13109 | |||
13110 | LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION; | ||
13111 | LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR; | ||
13112 | |||
13113 | if (part.LinkNum > 1) | ||
13114 | localRot = GetPartLocalRot(part); | ||
13115 | |||
13116 | r = r * llGetRootRotation() / localRot; | ||
13117 | av.Rotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); | ||
13118 | av.SendAvatarDataToAllAgents(); | 13092 | av.SendAvatarDataToAllAgents(); |
13119 | } | 13093 | } |
13120 | break; | 13094 | break; |
@@ -13268,8 +13242,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13268 | Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f); | 13242 | Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f); |
13269 | pos -= sitOffset; | 13243 | pos -= sitOffset; |
13270 | 13244 | ||
13271 | if( sitPart != null) | 13245 | //if( sitPart != null) |
13272 | pos = sitPart.GetWorldPosition() + pos * sitPart.GetWorldRotation(); | 13246 | // pos = sitPart.GetWorldPosition() + pos * sitPart.GetWorldRotation(); |
13273 | 13247 | ||
13274 | res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z)); | 13248 | res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z)); |
13275 | break; | 13249 | break; |
@@ -13283,13 +13257,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13283 | break; | 13257 | break; |
13284 | 13258 | ||
13285 | case (int)ScriptBaseClass.PRIM_ROTATION: | 13259 | case (int)ScriptBaseClass.PRIM_ROTATION: |
13286 | Quaternion rot = avatar.Rotation; | 13260 | //Quaternion rot = avatar.Rotation / llGetRootRotation(); |
13287 | if (sitPart != null) | 13261 | LSL_Rotation rot = new LSL_Rotation(avatar.Rotation.X, avatar.Rotation.Y, avatar.Rotation.Z, avatar.Rotation.W) / llGetRootRotation(); |
13288 | { | 13262 | //if (sitPart != null) |
13289 | rot = sitPart.GetWorldRotation() * rot; // apply sit part world rotation | 13263 | //{ |
13290 | } | 13264 | // rot = sitPart.GetWorldRotation() * rot; // apply sit part world rotation |
13291 | 13265 | //} | |
13292 | res.Add(new LSL_Rotation (rot.X, rot.Y, rot.Z, rot.W)); | 13266 | |
13267 | //res.Add(new LSL_Rotation (rot.X, rot.Y, rot.Z, rot.W)); | ||
13268 | res.Add(rot); | ||
13293 | break; | 13269 | break; |
13294 | 13270 | ||
13295 | case (int)ScriptBaseClass.PRIM_TYPE: | 13271 | case (int)ScriptBaseClass.PRIM_TYPE: |