Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.csavinationmerge
commit
e903709847
|
@ -51,10 +51,12 @@ namespace OpenSim.Framework
|
||||||
protected object m_senderObject;
|
protected object m_senderObject;
|
||||||
protected ChatTypeEnum m_type;
|
protected ChatTypeEnum m_type;
|
||||||
protected UUID m_fromID;
|
protected UUID m_fromID;
|
||||||
|
protected UUID m_toID;
|
||||||
|
|
||||||
public OSChatMessage()
|
public OSChatMessage()
|
||||||
{
|
{
|
||||||
m_position = new Vector3();
|
m_position = new Vector3();
|
||||||
|
m_toID = UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -102,6 +104,15 @@ namespace OpenSim.Framework
|
||||||
set { m_from = value; }
|
set { m_from = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The name of the sender (needed for scripts)
|
||||||
|
/// </summary>
|
||||||
|
public string To
|
||||||
|
{
|
||||||
|
get { return m_from; }
|
||||||
|
set { m_from = value; }
|
||||||
|
}
|
||||||
|
|
||||||
#region IEventArgs Members
|
#region IEventArgs Members
|
||||||
|
|
||||||
/// TODO: Sender and SenderObject should just be Sender and of
|
/// TODO: Sender and SenderObject should just be Sender and of
|
||||||
|
@ -131,6 +142,15 @@ namespace OpenSim.Framework
|
||||||
set { m_fromID = value; }
|
set { m_fromID = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The single recipient or all if not set.
|
||||||
|
/// </summary>
|
||||||
|
public UUID TargetUUID
|
||||||
|
{
|
||||||
|
get { return m_toID; }
|
||||||
|
set { m_toID = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -197,6 +197,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
string fromName = c.From;
|
string fromName = c.From;
|
||||||
string fromNamePrefix = "";
|
string fromNamePrefix = "";
|
||||||
UUID fromID = UUID.Zero;
|
UUID fromID = UUID.Zero;
|
||||||
|
UUID targetID = c.TargetUUID;
|
||||||
string message = c.Message;
|
string message = c.Message;
|
||||||
IScene scene = c.Scene;
|
IScene scene = c.Scene;
|
||||||
Vector3 fromPos = c.Position;
|
Vector3 fromPos = c.Position;
|
||||||
|
@ -235,17 +236,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
message = message.Substring(0, 1000);
|
message = message.Substring(0, 1000);
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}",
|
// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}, targetID {5}",
|
||||||
// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
|
// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType, targetID);
|
||||||
|
|
||||||
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
||||||
|
|
||||||
foreach (Scene s in m_scenes)
|
foreach (Scene s in m_scenes)
|
||||||
{
|
{
|
||||||
// This should use ForEachClient, but clients don't have a position.
|
if (targetID == UUID.Zero)
|
||||||
// If camera is moved into client, then camera position can be used
|
{
|
||||||
s.ForEachRootScenePresence(
|
// This should use ForEachClient, but clients don't have a position.
|
||||||
delegate(ScenePresence presence)
|
// If camera is moved into client, then camera position can be used
|
||||||
|
s.ForEachRootScenePresence(
|
||||||
|
delegate(ScenePresence presence)
|
||||||
|
{
|
||||||
|
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType, false))
|
||||||
|
receiverIDs.Add(presence.UUID);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This is a send to a specific client eg from llRegionSayTo
|
||||||
|
// no need to check distance etc, jand send is as say
|
||||||
|
ScenePresence presence = s.GetScenePresence(targetID);
|
||||||
|
if (presence != null && !presence.IsChildAgent)
|
||||||
{
|
{
|
||||||
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||||
if (Presencecheck != null)
|
if (Presencecheck != null)
|
||||||
|
@ -256,15 +271,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
// objects on a parcel with access restrictions
|
// objects on a parcel with access restrictions
|
||||||
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
|
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
|
||||||
{
|
{
|
||||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType))
|
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType, false))
|
||||||
receiverIDs.Add(presence.UUID);
|
receiverIDs.Add(presence.UUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(scene as Scene).EventManager.TriggerOnChatToClients(
|
(scene as Scene).EventManager.TriggerOnChatToClients(
|
||||||
fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
|
fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
|
||||||
}
|
}
|
||||||
|
@ -344,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
/// precondition</returns>
|
/// precondition</returns>
|
||||||
protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
|
protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
|
||||||
UUID fromAgentID, string fromName, ChatTypeEnum type,
|
UUID fromAgentID, string fromName, ChatTypeEnum type,
|
||||||
string message, ChatSourceType src)
|
string message, ChatSourceType src, bool ignoreDistance)
|
||||||
{
|
{
|
||||||
// don't send stuff to child agents
|
// don't send stuff to child agents
|
||||||
if (presence.IsChildAgent) return false;
|
if (presence.IsChildAgent) return false;
|
||||||
|
@ -355,12 +369,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
|
presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
|
||||||
|
|
||||||
int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
|
int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
|
||||||
|
|
||||||
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
if (!ignoreDistance)
|
||||||
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
|
||||||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
|
||||||
{
|
{
|
||||||
return false;
|
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
||||||
|
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
||||||
|
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
|
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
|
||||||
|
|
|
@ -308,56 +308,56 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||||
/// <param name='msg'>
|
/// <param name='msg'>
|
||||||
/// Message.
|
/// Message.
|
||||||
/// </param>
|
/// </param>
|
||||||
public bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error)
|
public void DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg)
|
||||||
{
|
{
|
||||||
error = null;
|
|
||||||
// Is id an avatar?
|
// Is id an avatar?
|
||||||
ScenePresence sp = m_scene.GetScenePresence(target);
|
ScenePresence sp = m_scene.GetScenePresence(target);
|
||||||
|
|
||||||
if (sp != null)
|
if (sp != null)
|
||||||
{
|
{
|
||||||
// Send message to avatar
|
// ignore if a child agent this is restricted to inside one region
|
||||||
|
if (sp.IsChildAgent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Send message to the avatar.
|
||||||
|
// Channel zero only goes to the avatar
|
||||||
|
// non zero channel messages only go to the attachments
|
||||||
if (channel == 0)
|
if (channel == 0)
|
||||||
{
|
{
|
||||||
m_scene.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Broadcast, 0, pos, name, id, false);
|
m_scene.SimChatToAgent(target, Utils.StringToBytes(msg), pos, name, id, false);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
List<SceneObjectGroup> attachments = sp.GetAttachments();
|
|
||||||
|
|
||||||
if (attachments.Count == 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Get uuid of attachments
|
|
||||||
List<UUID> targets = new List<UUID>();
|
|
||||||
foreach (SceneObjectGroup sog in attachments)
|
|
||||||
{
|
{
|
||||||
if (!sog.IsDeleted)
|
List<SceneObjectGroup> attachments = sp.GetAttachments();
|
||||||
targets.Add(sog.UUID);
|
if (attachments.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Get uuid of attachments
|
||||||
|
List<UUID> targets = new List<UUID>();
|
||||||
|
foreach (SceneObjectGroup sog in attachments)
|
||||||
|
{
|
||||||
|
if (!sog.IsDeleted)
|
||||||
|
targets.Add(sog.UUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Need to check each attachment
|
||||||
|
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
||||||
|
{
|
||||||
|
if (li.GetHostID().Equals(id))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (m_scene.GetSceneObjectPart(li.GetHostID()) == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (targets.Contains(li.GetHostID()))
|
||||||
|
QueueMessage(new ListenerInfo(li, name, id, msg));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to check each attachment
|
return;
|
||||||
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
|
||||||
{
|
|
||||||
if (li.GetHostID().Equals(id))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (m_scene.GetSceneObjectPart(li.GetHostID()) == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (targets.Contains(li.GetHostID()))
|
|
||||||
QueueMessage(new ListenerInfo(li, name, id, msg));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Need to toss an error here
|
|
||||||
if (channel == 0)
|
|
||||||
{
|
|
||||||
error = "Cannot use llRegionSayTo to message objects on channel 0";
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No avatar found so look for an object
|
||||||
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
||||||
{
|
{
|
||||||
// Dont process if this message is from yourself!
|
// Dont process if this message is from yourself!
|
||||||
|
@ -375,7 +375,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void QueueMessage(ListenerInfo li)
|
protected void QueueMessage(ListenerInfo li)
|
||||||
|
|
|
@ -102,9 +102,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
|
||||||
Vector3 groupPosition = new Vector3(10, 20, 30);
|
Vector3 groupPosition = new Vector3(10, 20, 30);
|
||||||
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||||
Vector3 offsetPosition = new Vector3(5, 10, 15);
|
// Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||||
|
|
||||||
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
|
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, Vector3.Zero) { Name = partName };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SceneObjectPart CreateSceneObjectPart2()
|
protected SceneObjectPart CreateSceneObjectPart2()
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name='msg'>
|
/// <param name='msg'>
|
||||||
/// Message.
|
/// Message.
|
||||||
/// </param>
|
/// </param>
|
||||||
bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error);
|
void DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Are there any listen events ready to be dispatched?
|
/// Are there any listen events ready to be dispatched?
|
||||||
|
|
|
@ -38,8 +38,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
public partial class Scene
|
public partial class Scene
|
||||||
{
|
{
|
||||||
|
|
||||||
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
|
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
|
||||||
UUID fromID, bool fromAgent, bool broadcast)
|
UUID fromID, UUID targetID, bool fromAgent, bool broadcast)
|
||||||
{
|
{
|
||||||
OSChatMessage args = new OSChatMessage();
|
OSChatMessage args = new OSChatMessage();
|
||||||
|
|
||||||
|
@ -63,14 +64,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
args.From = fromName;
|
args.From = fromName;
|
||||||
//args.
|
args.TargetUUID = targetID;
|
||||||
|
|
||||||
if (broadcast)
|
if (broadcast)
|
||||||
EventManager.TriggerOnChatBroadcast(this, args);
|
EventManager.TriggerOnChatBroadcast(this, args);
|
||||||
else
|
else
|
||||||
EventManager.TriggerOnChatFromWorld(this, args);
|
EventManager.TriggerOnChatFromWorld(this, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
|
||||||
|
UUID fromID, bool fromAgent, bool broadcast)
|
||||||
|
{
|
||||||
|
SimChat(message, type, channel, fromPos, fromName, fromID, UUID.Zero, fromAgent, broadcast);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -108,6 +115,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true);
|
SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="fromPos"></param>
|
||||||
|
/// <param name="fromName"></param>
|
||||||
|
/// <param name="fromAgentID"></param>
|
||||||
|
/// <param name="targetID"></param>
|
||||||
|
public void SimChatToAgent(UUID targetID, byte[] message, Vector3 fromPos, string fromName, UUID fromID, bool fromAgent)
|
||||||
|
{
|
||||||
|
SimChat(message, ChatTypeEnum.Say, 0, fromPos, fromName, fromID, targetID, fromAgent, false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when the client requests a prim.
|
/// Invoked when the client requests a prim.
|
||||||
|
|
|
@ -833,13 +833,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
|
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Mock constructor for scene group persistency unit tests.
|
|
||||||
/// SceneObjectGroup RegionId property is delegated to Scene.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="regInfo"></param>
|
|
||||||
public Scene(RegionInfo regInfo)
|
public Scene(RegionInfo regInfo)
|
||||||
{
|
{
|
||||||
|
PhysicalPrims = true;
|
||||||
|
CollidablePrims = true;
|
||||||
|
|
||||||
BordersLocked = true;
|
BordersLocked = true;
|
||||||
Border northBorder = new Border();
|
Border northBorder = new Border();
|
||||||
northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<---
|
northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<---
|
||||||
|
@ -866,8 +864,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_eventManager = new EventManager();
|
m_eventManager = new EventManager();
|
||||||
|
|
||||||
m_permissions = new ScenePermissions(this);
|
m_permissions = new ScenePermissions(this);
|
||||||
|
|
||||||
// m_lastUpdate = Util.EnvironmentTickCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -2673,7 +2673,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
linkPart.LinkNum = linkNum++;
|
linkPart.LinkNum = linkNum++;
|
||||||
linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
|
linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false);
|
||||||
|
|
||||||
SceneObjectPart[] ogParts = objectGroup.Parts;
|
SceneObjectPart[] ogParts = objectGroup.Parts;
|
||||||
Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
|
Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
|
||||||
|
@ -2910,7 +2910,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Quaternion newRot = Quaternion.Inverse(parentRot) * worldRot;
|
Quaternion newRot = Quaternion.Inverse(parentRot) * worldRot;
|
||||||
part.RotationOffset = newRot;
|
part.RotationOffset = newRot;
|
||||||
|
|
||||||
part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
|
part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -4685,7 +4685,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else // it already has a physical representation
|
else // it already has a physical representation
|
||||||
{
|
{
|
||||||
DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
|
DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
|
||||||
|
|
|
@ -62,6 +62,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
|
m_scene.AddSceneObject(m_so1);
|
||||||
|
|
||||||
SceneObjectPart rootPart = m_so1.RootPart;
|
SceneObjectPart rootPart = m_so1.RootPart;
|
||||||
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
|
||||||
|
|
||||||
|
@ -80,6 +82,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
|
m_scene.AddSceneObject(m_so1);
|
||||||
|
|
||||||
SceneObjectPart rootPart = m_so1.RootPart;
|
SceneObjectPart rootPart = m_so1.RootPart;
|
||||||
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
|
||||||
|
|
||||||
|
|
|
@ -36,13 +36,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
{
|
{
|
||||||
public class BasicActor : PhysicsActor
|
public class BasicActor : PhysicsActor
|
||||||
{
|
{
|
||||||
private Vector3 _position;
|
|
||||||
private Vector3 _velocity;
|
|
||||||
private Vector3 _acceleration;
|
|
||||||
private Vector3 _size;
|
private Vector3 _size;
|
||||||
private Vector3 m_rotationalVelocity;
|
|
||||||
private bool flying;
|
|
||||||
private bool iscolliding;
|
|
||||||
|
|
||||||
public BasicActor(Vector3 size)
|
public BasicActor(Vector3 size)
|
||||||
{
|
{
|
||||||
|
@ -55,11 +49,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
set { return; }
|
set { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 RotationalVelocity
|
public override Vector3 RotationalVelocity { get; set; }
|
||||||
{
|
|
||||||
get { return m_rotationalVelocity; }
|
|
||||||
set { m_rotationalVelocity = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool SetAlwaysRun
|
public override bool SetAlwaysRun
|
||||||
{
|
{
|
||||||
|
@ -105,17 +95,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
set { return; }
|
set { return; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Flying
|
public override bool Flying { get; set; }
|
||||||
{
|
|
||||||
get { return flying; }
|
|
||||||
set { flying = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool IsColliding
|
public override bool IsColliding { get; set; }
|
||||||
{
|
|
||||||
get { return iscolliding; }
|
|
||||||
set { iscolliding = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CollidingGround
|
public override bool CollidingGround
|
||||||
{
|
{
|
||||||
|
@ -134,11 +116,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
get { return false; }
|
get { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 Position
|
public override Vector3 Position { get; set; }
|
||||||
{
|
|
||||||
get { return _position; }
|
|
||||||
set { _position = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Vector3 Size
|
public override Vector3 Size
|
||||||
{
|
{
|
||||||
|
@ -206,11 +184,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
get { return Vector3.Zero; }
|
get { return Vector3.Zero; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 Velocity
|
public override Vector3 Velocity { get; set; }
|
||||||
{
|
|
||||||
get { return _velocity; }
|
|
||||||
set { _velocity = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Vector3 Torque
|
public override Vector3 Torque
|
||||||
{
|
{
|
||||||
|
@ -230,11 +204,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
set { }
|
set { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 Acceleration
|
public override Vector3 Acceleration { get; set; }
|
||||||
{
|
|
||||||
get { return _acceleration; }
|
|
||||||
set { _acceleration = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Kinematic
|
public override bool Kinematic
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,314 @@
|
||||||
|
/*
|
||||||
|
* 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 Nini.Config;
|
||||||
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Region.Physics.Manager;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
|
{
|
||||||
|
public class BasicPhysicsPrim : PhysicsActor
|
||||||
|
{
|
||||||
|
private Vector3 _size;
|
||||||
|
private PrimitiveBaseShape _shape;
|
||||||
|
|
||||||
|
public BasicPhysicsPrim(
|
||||||
|
string name, uint localId, Vector3 position, Vector3 size, Quaternion orientation, PrimitiveBaseShape shape)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
LocalID = localId;
|
||||||
|
Position = position;
|
||||||
|
Size = size;
|
||||||
|
Orientation = orientation;
|
||||||
|
Shape = shape;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int PhysicsActorType
|
||||||
|
{
|
||||||
|
get { return (int) ActorTypes.Agent; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 RotationalVelocity { get; set; }
|
||||||
|
|
||||||
|
public override bool SetAlwaysRun
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override uint LocalID
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Grabbed
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Selected
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float Buoyancy
|
||||||
|
{
|
||||||
|
get { return 0f; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool FloatOnWater
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsPhysical
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool ThrottleUpdates
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Flying { get; set; }
|
||||||
|
|
||||||
|
public override bool IsColliding { get; set; }
|
||||||
|
|
||||||
|
public override bool CollidingGround
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CollidingObj
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Stopped
|
||||||
|
{
|
||||||
|
get { return false; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 Position { get; set; }
|
||||||
|
|
||||||
|
public override Vector3 Size
|
||||||
|
{
|
||||||
|
get { return _size; }
|
||||||
|
set {
|
||||||
|
_size = value;
|
||||||
|
_size.Z = _size.Z / 2.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PrimitiveBaseShape Shape
|
||||||
|
{
|
||||||
|
set { _shape = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float Mass
|
||||||
|
{
|
||||||
|
get { return 0f; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 Force
|
||||||
|
{
|
||||||
|
get { return Vector3.Zero; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int VehicleType
|
||||||
|
{
|
||||||
|
get { return 0; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void VehicleFloatParam(int param, float value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void VehicleVectorParam(int param, Vector3 value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void VehicleRotationParam(int param, Quaternion rotation)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void VehicleFlags(int param, bool remove)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetVolumeDetect(int param)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 CenterOfMass
|
||||||
|
{
|
||||||
|
get { return Vector3.Zero; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 GeometricCenter
|
||||||
|
{
|
||||||
|
get { return Vector3.Zero; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 Velocity { get; set; }
|
||||||
|
|
||||||
|
public override Vector3 Torque
|
||||||
|
{
|
||||||
|
get { return Vector3.Zero; }
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float CollisionScore
|
||||||
|
{
|
||||||
|
get { return 0f; }
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Quaternion Orientation { get; set; }
|
||||||
|
|
||||||
|
public override Vector3 Acceleration { get; set; }
|
||||||
|
|
||||||
|
public override bool Kinematic
|
||||||
|
{
|
||||||
|
get { return true; }
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void link(PhysicsActor obj)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void delink()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void LockAngularMotion(Vector3 axis)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddForce(Vector3 force, bool pushforce)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddAngularForce(Vector3 force, bool pushforce)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetMomentum(Vector3 momentum)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void CrossingFailure()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Vector3 PIDTarget
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool PIDActive
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float PIDTau
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float PIDHoverHeight
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool PIDHoverActive
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override PIDHoverType PIDHoverType
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float PIDHoverTau
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Quaternion APIDTarget
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool APIDActive
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float APIDStrength
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float APIDDamping
|
||||||
|
{
|
||||||
|
set { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SubscribeEvents(int ms)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void UnSubscribeEvents()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool SubscribedEvents()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,9 +34,17 @@ using OpenSim.Region.Physics.Manager;
|
||||||
|
|
||||||
namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This is an incomplete extremely basic physics implementation
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Not useful for anything at the moment apart from some regression testing in other components where some form
|
||||||
|
/// of physics plugin is needed.
|
||||||
|
/// </remarks>
|
||||||
public class BasicScene : PhysicsScene
|
public class BasicScene : PhysicsScene
|
||||||
{
|
{
|
||||||
private List<BasicActor> _actors = new List<BasicActor>();
|
private List<BasicActor> _actors = new List<BasicActor>();
|
||||||
|
private List<BasicPhysicsPrim> _prims = new List<BasicPhysicsPrim>();
|
||||||
private float[] _heightMap;
|
private float[] _heightMap;
|
||||||
|
|
||||||
//protected internal string sceneIdentifier;
|
//protected internal string sceneIdentifier;
|
||||||
|
@ -50,10 +58,19 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose() {}
|
||||||
{
|
|
||||||
|
|
||||||
|
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
|
||||||
|
Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
|
||||||
|
{
|
||||||
|
BasicPhysicsPrim prim = new BasicPhysicsPrim(primName, localid, position, size, rotation, pbs);
|
||||||
|
prim.IsPhysical = isPhysical;
|
||||||
|
|
||||||
|
_prims.Add(prim);
|
||||||
|
|
||||||
|
return prim;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
|
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
|
||||||
{
|
{
|
||||||
BasicActor act = new BasicActor(size);
|
BasicActor act = new BasicActor(size);
|
||||||
|
@ -63,30 +80,18 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
||||||
return act;
|
return act;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RemovePrim(PhysicsActor prim)
|
public override void RemovePrim(PhysicsActor actor)
|
||||||
{
|
{
|
||||||
|
BasicPhysicsPrim prim = (BasicPhysicsPrim)actor;
|
||||||
|
if (_prims.Contains(prim))
|
||||||
|
_prims.Remove(prim);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RemoveAvatar(PhysicsActor actor)
|
public override void RemoveAvatar(PhysicsActor actor)
|
||||||
{
|
{
|
||||||
BasicActor act = (BasicActor) actor;
|
BasicActor act = (BasicActor)actor;
|
||||||
if (_actors.Contains(act))
|
if (_actors.Contains(act))
|
||||||
{
|
|
||||||
_actors.Remove(act);
|
_actors.Remove(act);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
public override PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
|
|
||||||
Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddPhysicsActorTaint(PhysicsActor prim)
|
public override void AddPhysicsActorTaint(PhysicsActor prim)
|
||||||
|
|
|
@ -948,13 +948,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
if (channel == ScriptBaseClass.DEBUG_CHANNEL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UUID TargetID;
|
UUID TargetID;
|
||||||
UUID.TryParse(target, out TargetID);
|
UUID.TryParse(target, out TargetID);
|
||||||
|
|
||||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||||
if (wComm != null)
|
if (wComm != null)
|
||||||
if (!wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg, out error))
|
wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg);
|
||||||
LSLError(error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Integer llListen(int channelID, string name, string ID, string msg)
|
public LSL_Integer llListen(int channelID, string name, string ID, string msg)
|
||||||
|
|
Loading…
Reference in New Issue