From 66f04451735a9473d80d40abdbabb9b9d1ed8b7d Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Mon, 16 Mar 2009 21:41:51 +0000 Subject: Mantis#3306: Thanks tlaukkan for a patch that adds primitive hierarchies support to MXP and improves client disconnect handling. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'OpenSim/Client/MXP/ClientStack') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 5a7accf..30820d3 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -42,6 +42,7 @@ using MXP.Extentions.OpenMetaverseFragments.Proto; using MXP.Util; using MXP.Fragments; using MXP.Common.Proto; +using OpenSim.Region.Framework.Scenes; namespace OpenSim.Client.MXP.ClientStack { @@ -303,11 +304,18 @@ namespace OpenSim.Client.MXP.ClientStack String typeName = ToOmType(primShape.PCode); m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName); - PerceptionEventMessage pe = new PerceptionEventMessage(); - + PerceptionEventMessage pe = new PerceptionEventMessage(); pe.ObjectFragment.ObjectId = objectID.Guid; - // TODO Resolve ParentID + pe.ObjectFragment.ParentObjectId = Guid.Empty; + + // Resolving parent UUID. + OpenSim.Region.Framework.Scenes.Scene scene = (OpenSim.Region.Framework.Scenes.Scene)Scene; + if (scene.Entities.ContainsKey(parentID)) + { + pe.ObjectFragment.ParentObjectId = scene.Entities[parentID].UUID.Guid; + } + pe.ObjectFragment.ObjectIndex = localID; pe.ObjectFragment.ObjectName = typeName + " Object"; pe.ObjectFragment.OwnerId = ownerID.Guid; @@ -387,7 +395,6 @@ namespace OpenSim.Client.MXP.ClientStack PerceptionEventMessage pe = new PerceptionEventMessage(); pe.ObjectFragment.ObjectId = avatarID.Guid; - // TODO Resolve ParentID pe.ObjectFragment.ParentObjectId = parentId.Guid; pe.ObjectFragment.ObjectIndex = avatarLocalID; pe.ObjectFragment.ObjectName = participantName; @@ -397,7 +404,8 @@ namespace OpenSim.Client.MXP.ClientStack pe.ObjectFragment.Acceleration = new MsdVector3f(); pe.ObjectFragment.AngularAcceleration = new MsdQuaternion4f(); pe.ObjectFragment.AngularVelocity = new MsdQuaternion4f(); - pe.ObjectFragment.BoundingSphereRadius = 1; // TODO Fill in appropriate value + + pe.ObjectFragment.BoundingSphereRadius = 1.0f; // TODO Fill in appropriate value pe.ObjectFragment.Location = ToOmVector(position); @@ -425,11 +433,11 @@ namespace OpenSim.Client.MXP.ClientStack pe.ObjectFragment.Acceleration = new MsdVector3f(); pe.ObjectFragment.AngularAcceleration = new MsdQuaternion4f(); pe.ObjectFragment.AngularVelocity = new MsdQuaternion4f(); - pe.ObjectFragment.BoundingSphereRadius = 1; // TODO Fill in appropriate value + pe.ObjectFragment.BoundingSphereRadius = 128f; pe.ObjectFragment.Location = new MsdVector3f(); - pe.ObjectFragment.Mass = 1.0f; // TODO Fill in appropriate value + pe.ObjectFragment.Mass = 1.0f; pe.ObjectFragment.Orientation = new MsdQuaternion4f(); pe.ObjectFragment.Velocity = new MsdVector3f(); -- cgit v1.1