Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/ScenePresence.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.csavinationmerge
commit
8b657773e4
|
@ -180,7 +180,7 @@ namespace OpenSim.Framework
|
|||
/// Validate the key used for storing separate data stores.
|
||||
/// </summary>
|
||||
/// <param name='key'></param>
|
||||
private static void ValidateKey(string key)
|
||||
public static void ValidateKey(string key)
|
||||
{
|
||||
if (key.Length < MIN_STORE_NAME_LENGTH)
|
||||
throw new Exception("Minimum store name length is " + MIN_STORE_NAME_LENGTH);
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.Serialization;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// This class stores and retrieves dynamic objects.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Experimental - DO NOT USE.
|
||||
/// </remarks>
|
||||
public class DOMap
|
||||
{
|
||||
private IDictionary<string, object> m_map;
|
||||
|
||||
public void Add(string key, object dynObj)
|
||||
{
|
||||
DAMap.ValidateKey(key);
|
||||
|
||||
lock (this)
|
||||
{
|
||||
if (m_map == null)
|
||||
m_map = new Dictionary<string, object>();
|
||||
|
||||
m_map.Add(key, dynObj);
|
||||
}
|
||||
}
|
||||
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return Get(key) != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a dynamic object
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Not providing an index method so that users can't casually overwrite each other's objects.
|
||||
/// </remarks>
|
||||
/// <param name='key'></param>
|
||||
public object Get(string key)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (m_map == null)
|
||||
return null;
|
||||
else
|
||||
return m_map[key];
|
||||
}
|
||||
}
|
||||
|
||||
public bool Remove(string key)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (m_map == null)
|
||||
return false;
|
||||
else
|
||||
return m_map.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -218,7 +218,7 @@ namespace OpenSim.Framework
|
|||
Console.WriteLine ("Looking for updates...");
|
||||
Repositories.UpdateAllRepositories (ps);
|
||||
Console.WriteLine ("Available add-in updates:");
|
||||
bool found = false;
|
||||
|
||||
AddinRepositoryEntry[] entries = Repositories.GetAvailableUpdates();
|
||||
|
||||
foreach (AddinRepositoryEntry entry in entries)
|
||||
|
@ -541,7 +541,7 @@ namespace OpenSim.Framework
|
|||
{
|
||||
list.AddRange(PluginRegistry.GetAddins());
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
Addin[] x = xlist.ToArray(typeof(Addin)) as Addin[];
|
||||
return x;
|
||||
|
|
|
@ -303,12 +303,12 @@ namespace OpenSim.Framework
|
|||
// Clamp the maximum magnitude of a vector
|
||||
public static Vector3 ClampV(Vector3 x, float max)
|
||||
{
|
||||
Vector3 ret = x;
|
||||
float lenSq = x.LengthSquared();
|
||||
if (lenSq > (max * max))
|
||||
{
|
||||
x = x / x.Length() * max;
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,19 +85,27 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DAExampleModule
|
|||
{
|
||||
OSDMap attrs = null;
|
||||
SceneObjectPart sop = m_scene.GetSceneObjectPart(groupId);
|
||||
|
||||
if (sop == null)
|
||||
return true;
|
||||
|
||||
if (!sop.DynAttrs.TryGetValue(Name, out attrs))
|
||||
attrs = new OSDMap();
|
||||
|
||||
OSDInteger newValue;
|
||||
|
||||
if (!attrs.ContainsKey("moves"))
|
||||
newValue = new OSDInteger(1);
|
||||
else
|
||||
newValue = new OSDInteger(((OSDInteger)attrs["moves"]).AsInteger() + 1);
|
||||
|
||||
attrs["moves"] = newValue;
|
||||
|
||||
sop.DynAttrs[Name] = attrs;
|
||||
// We have to lock on the entire dynamic attributes map to avoid race conditions with serialization code.
|
||||
lock (sop.DynAttrs)
|
||||
{
|
||||
if (!attrs.ContainsKey("moves"))
|
||||
newValue = new OSDInteger(1);
|
||||
else
|
||||
newValue = new OSDInteger(attrs["moves"].AsInteger() + 1);
|
||||
|
||||
attrs["moves"] = newValue;
|
||||
|
||||
sop.DynAttrs[Name] = attrs;
|
||||
}
|
||||
|
||||
m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue));
|
||||
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Example module for experimenting with and demonstrating dynamic object ideas.
|
||||
/// </summary>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DOExampleModule")]
|
||||
public class DOExampleModule : INonSharedRegionModule
|
||||
{
|
||||
public class MyObject
|
||||
{
|
||||
public int Moves { get; set; }
|
||||
}
|
||||
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static readonly bool ENABLED = false; // enable for testing
|
||||
|
||||
private Scene m_scene;
|
||||
private IDialogModule m_dialogMod;
|
||||
|
||||
public string Name { get { return "DOExample Module"; } }
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void Initialise(IConfigSource source) {}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (ENABLED)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.EventManager.OnObjectAddedToScene += OnObjectAddedToScene;
|
||||
m_scene.EventManager.OnSceneGroupMove += OnSceneGroupMove;
|
||||
m_dialogMod = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (ENABLED)
|
||||
{
|
||||
m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove;
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene) {}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
RemoveRegion(m_scene);
|
||||
}
|
||||
|
||||
private void OnObjectAddedToScene(SceneObjectGroup so)
|
||||
{
|
||||
so.RootPart.DynObjs.Add(Name, new MyObject());
|
||||
}
|
||||
|
||||
private bool OnSceneGroupMove(UUID groupId, Vector3 delta)
|
||||
{
|
||||
SceneObjectGroup so = m_scene.GetSceneObjectGroup(groupId);
|
||||
|
||||
if (so == null)
|
||||
return true;
|
||||
|
||||
object rawObj = so.RootPart.DynObjs.Get(Name);
|
||||
|
||||
if (rawObj != null)
|
||||
{
|
||||
MyObject myObj = (MyObject)rawObj;
|
||||
|
||||
m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", so.Name, so.UUID, ++myObj.Moves));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -141,6 +141,27 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// Dynamic attributes can be created and deleted as required.
|
||||
/// </summary>
|
||||
public DAMap DynAttrs { get; set; }
|
||||
|
||||
private DOMap m_dynObjs;
|
||||
|
||||
/// <summary>
|
||||
/// Dynamic objects that can be created and deleted as required.
|
||||
/// </summary>
|
||||
public DOMap DynObjs
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_dynObjs == null)
|
||||
m_dynObjs = new DOMap();
|
||||
|
||||
return m_dynObjs;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_dynObjs = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <value>
|
||||
/// Is this a root part?
|
||||
|
|
|
@ -590,12 +590,25 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
*/
|
||||
private Quaternion m_bodyRot = Quaternion.Identity;
|
||||
|
||||
/// <summary>
|
||||
/// The rotation of the avatar.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If the avatar is not sitting, this is with respect to the world
|
||||
/// If the avatar is sitting, this is a with respect to the part that it's sitting upon (a local rotation).
|
||||
/// If you always want the world rotation, use GetWorldRotation()
|
||||
/// </remarks>
|
||||
public Quaternion Rotation
|
||||
{
|
||||
get { return m_bodyRot; }
|
||||
get
|
||||
{
|
||||
return m_bodyRot;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_bodyRot = value;
|
||||
|
||||
if (PhysicsActor != null)
|
||||
{
|
||||
try
|
||||
|
@ -654,6 +667,26 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
set { m_health = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the world rotation of this presence.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Unlike Rotation, this returns the world rotation no matter whether the avatar is sitting on a prim or not.
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
public Quaternion GetWorldRotation()
|
||||
{
|
||||
if (IsSatOnObject)
|
||||
{
|
||||
SceneObjectPart sitPart = ParentPart;
|
||||
|
||||
if (sitPart != null)
|
||||
return sitPart.GetWorldRotation() * Rotation;
|
||||
}
|
||||
|
||||
return Rotation;
|
||||
}
|
||||
|
||||
public void AdjustKnownSeeds()
|
||||
{
|
||||
Dictionary<ulong, string> seeds;
|
||||
|
@ -755,8 +788,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Constructor(s)
|
||||
|
||||
public ScenePresence(
|
||||
|
|
|
@ -2441,14 +2441,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
|
||||
q = avatar.CameraRotation; // Mouselook
|
||||
else
|
||||
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
|
||||
q = avatar.GetWorldRotation(); // Currently infrequently updated so may be inaccurate
|
||||
}
|
||||
else
|
||||
q = part.ParentGroup.GroupRotation; // Likely never get here but just in case
|
||||
}
|
||||
else
|
||||
q = part.ParentGroup.GroupRotation; // just the group rotation
|
||||
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
|
||||
|
||||
return new LSL_Rotation(q);
|
||||
}
|
||||
|
||||
q = part.GetWorldRotation();
|
||||
|
@ -2572,8 +2573,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Vector llGetTorque()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
Vector3 torque = m_host.ParentGroup.GetTorque();
|
||||
return new LSL_Vector(torque.X,torque.Y,torque.Z);
|
||||
|
||||
return new LSL_Vector(m_host.ParentGroup.GetTorque());
|
||||
}
|
||||
|
||||
public void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local)
|
||||
|
@ -2606,13 +2607,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
vel = m_host.ParentGroup.RootPart.Velocity;
|
||||
}
|
||||
|
||||
return new LSL_Vector(vel.X, vel.Y, vel.Z);
|
||||
return new LSL_Vector(vel);
|
||||
}
|
||||
|
||||
public LSL_Vector llGetAccel()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
return new LSL_Vector(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z);
|
||||
|
||||
return new LSL_Vector(m_host.Acceleration);
|
||||
}
|
||||
|
||||
public void llSetAngularVelocity(LSL_Vector avel, int local)
|
||||
|
@ -3447,14 +3449,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
msg.offline = (byte)0; //offline;
|
||||
msg.ParentEstateID = World.RegionInfo.EstateSettings.EstateID;
|
||||
msg.Position = new Vector3(m_host.AbsolutePosition);
|
||||
msg.RegionID = World.RegionInfo.RegionID.Guid;
|
||||
msg.RegionID = World.RegionInfo.RegionID.Guid;//RegionID.Guid;
|
||||
|
||||
Vector3 pos = m_host.AbsolutePosition;
|
||||
msg.binaryBucket
|
||||
= Util.StringToBytes256(
|
||||
"{0}/{1}/{2}/{3}",
|
||||
World.RegionInfo.RegionName,
|
||||
(int)Math.Floor(m_host.AbsolutePosition.X),
|
||||
(int)Math.Floor(m_host.AbsolutePosition.Y),
|
||||
(int)Math.Floor(m_host.AbsolutePosition.Z));
|
||||
(int)Math.Floor(pos.X),
|
||||
(int)Math.Floor(pos.Y),
|
||||
(int)Math.Floor(pos.Z));
|
||||
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
|
@ -4594,9 +4598,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (destination == String.Empty)
|
||||
destination = World.RegionInfo.RegionName;
|
||||
|
||||
Vector3 pos = presence.AbsolutePosition;
|
||||
|
||||
// agent must be over the owners land
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(pos.X, pos.Y).LandData.OwnerID)
|
||||
{
|
||||
DoLLTeleport(presence, destination, targetPos, targetLookAt);
|
||||
}
|
||||
|
@ -4626,9 +4631,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
// agent must not be a god
|
||||
if (presence.GodLevel >= 200) return;
|
||||
|
||||
Vector3 pos = presence.AbsolutePosition;
|
||||
|
||||
// agent must be over the owners land
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(pos.X, pos.Y).LandData.OwnerID)
|
||||
{
|
||||
World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
|
||||
}
|
||||
|
@ -5282,8 +5288,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Vector llGetCenterOfMass()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
Vector3 center = m_host.GetCenterOfMass();
|
||||
return new LSL_Vector(center.X,center.Y,center.Z);
|
||||
|
||||
return new LSL_Vector(m_host.GetCenterOfMass());
|
||||
}
|
||||
|
||||
public LSL_List llListSort(LSL_List src, int stride, int ascending)
|
||||
|
@ -6302,15 +6308,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
ScenePresence presence = World.GetScenePresence(agentID);
|
||||
if (presence != null)
|
||||
{
|
||||
Vector3 pos = presence.AbsolutePosition;
|
||||
|
||||
// agent must be over the owners land
|
||||
ILandObject land = World.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||
ILandObject land = World.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
if (land == null)
|
||||
return;
|
||||
|
||||
if (m_host.OwnerID == land.LandData.OwnerID)
|
||||
{
|
||||
Vector3 pos = World.GetNearestAllowedPosition(presence, land);
|
||||
presence.TeleportWithMomentum(pos, null);
|
||||
Vector3 p = World.GetNearestAllowedPosition(presence, land);
|
||||
presence.TeleportWithMomentum(p, null);
|
||||
presence.ControllingClient.SendAlertMessage("You have been ejected from this land");
|
||||
}
|
||||
}
|
||||
|
@ -6332,19 +6340,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
ScenePresence presence = World.GetScenePresence(key);
|
||||
if (presence != null) // object is an avatar
|
||||
{
|
||||
if (m_host.OwnerID
|
||||
== World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
Vector3 pos = presence.AbsolutePosition;
|
||||
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(pos.X, pos.Y).LandData.OwnerID)
|
||||
return 1;
|
||||
}
|
||||
else // object is not an avatar
|
||||
{
|
||||
SceneObjectPart obj = World.GetSceneObjectPart(key);
|
||||
|
||||
if (obj != null)
|
||||
if (m_host.OwnerID
|
||||
== World.LandChannel.GetLandObject(
|
||||
obj.AbsolutePosition.X, obj.AbsolutePosition.Y).LandData.OwnerID)
|
||||
{
|
||||
Vector3 pos = obj.AbsolutePosition;
|
||||
|
||||
if (m_host.OwnerID == World.LandChannel.GetLandObject(pos.X, pos.Y).LandData.OwnerID)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6453,7 +6464,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
// or
|
||||
// if the object is owned by a person with estate access.
|
||||
|
||||
ILandObject parcel = World.LandChannel.GetLandObject(av.AbsolutePosition.X, av.AbsolutePosition.Y);
|
||||
Vector3 pos = av.AbsolutePosition;
|
||||
|
||||
ILandObject parcel = World.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
if (parcel != null)
|
||||
{
|
||||
if (m_host.OwnerID == parcel.LandData.OwnerID ||
|
||||
|
@ -6465,14 +6478,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public LSL_Vector llGroundSlope(LSL_Vector offset)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
//Get the slope normal. This gives us the equation of the plane tangent to the slope.
|
||||
LSL_Vector vsn = llGroundNormal(offset);
|
||||
|
||||
|
@ -6483,7 +6495,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
vsl.Normalize();
|
||||
//Normalization might be overkill here
|
||||
|
||||
return new LSL_Vector(vsl.X, vsl.Y, vsl.Z);
|
||||
vsn.x = vsl.X;
|
||||
vsn.y = vsl.Y;
|
||||
vsn.z = vsl.Z;
|
||||
|
||||
return vsn;
|
||||
}
|
||||
|
||||
public LSL_Vector llGroundNormal(LSL_Vector offset)
|
||||
|
@ -6533,7 +6549,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
//I believe the crossproduct of two normalized vectors is a normalized vector so
|
||||
//this normalization may be overkill
|
||||
|
||||
return new LSL_Vector(vsn.X, vsn.Y, vsn.Z);
|
||||
return new LSL_Vector(vsn);
|
||||
}
|
||||
|
||||
public LSL_Vector llGroundContour(LSL_Vector offset)
|
||||
|
@ -7037,7 +7053,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
UUID key;
|
||||
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
|
||||
Vector3 pos = m_host.AbsolutePosition;
|
||||
|
||||
ILandObject land = World.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned))
|
||||
{
|
||||
int expires = 0;
|
||||
|
@ -8474,7 +8492,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
|
||||
Vector3 pos = m_host.AbsolutePosition;
|
||||
ILandObject land = World.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
|
||||
if (land.LandData.OwnerID != m_host.OwnerID)
|
||||
return;
|
||||
|
@ -8488,7 +8507,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
|
||||
Vector3 pos = m_host.AbsolutePosition;
|
||||
ILandObject land = World.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
|
||||
if (land.LandData.OwnerID != m_host.OwnerID)
|
||||
return String.Empty;
|
||||
|
@ -8499,8 +8519,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Vector llGetRootPosition()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y,
|
||||
m_host.ParentGroup.AbsolutePosition.Z);
|
||||
|
||||
return new LSL_Vector(m_host.ParentGroup.AbsolutePosition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -8523,13 +8543,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
|
||||
q = avatar.CameraRotation; // Mouselook
|
||||
else
|
||||
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
|
||||
q = avatar.GetWorldRotation(); // Currently infrequently updated so may be inaccurate
|
||||
else
|
||||
q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case
|
||||
}
|
||||
else
|
||||
q = m_host.ParentGroup.GroupRotation; // just the group rotation
|
||||
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
|
||||
|
||||
return new LSL_Rotation(q);
|
||||
}
|
||||
|
||||
public LSL_String llGetObjectDesc()
|
||||
|
@ -13387,4 +13408,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2641,18 +2641,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
UUID npcId;
|
||||
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||
return new LSL_Rotation(Quaternion.Identity);
|
||||
|
||||
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||
return new LSL_Rotation(Quaternion.Identity);
|
||||
|
||||
ScenePresence sp = World.GetScenePresence(npcId);
|
||||
|
||||
if (sp != null)
|
||||
{
|
||||
Quaternion rot = sp.Rotation;
|
||||
return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W);
|
||||
}
|
||||
return new LSL_Rotation(sp.GetWorldRotation());
|
||||
}
|
||||
|
||||
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||
|
|
|
@ -700,4 +700,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
|||
return retList;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue