From bd8018fa1cb32aa42e2a1a41ebb01fc0f1b0a04b Mon Sep 17 00:00:00 2001
From: MW
Date: Tue, 3 Jul 2007 20:10:20 +0000
Subject: Today's work on Building support/tools. Think I am slowly getting
there.
---
OpenSim/Region/Application/OpenSimMain.cs | 4 +-
OpenSim/Region/Capabilities/Caps.cs | 33 ++----
OpenSim/Region/ClientStack/ClientView.API.cs | 3 +-
.../ClientStack/ClientView.PacketHandlers.cs | 79 ++++++++++++-
OpenSim/Region/Environment/Scenes/EntityBase.cs | 2 +-
OpenSim/Region/Environment/Scenes/Primitive.cs | 130 ++++++++++++++++++---
.../Environment/Scenes/Scene.PacketHandlers.cs | 82 +++++++++++--
OpenSim/Region/Environment/Scenes/Scene.cs | 17 ++-
OpenSim/Region/Environment/Scenes/SceneObject.cs | 24 +++-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 1 +
10 files changed, 319 insertions(+), 56 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index e976fe3..17a32cf 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -51,7 +51,7 @@ namespace OpenSim
public class OpenSimMain : RegionApplicationBase, conscmd_callback
{
protected CommunicationsManager commsManager;
- // private CheckSumServer checkServer;
+ // private CheckSumServer checkServer;
private bool m_silent;
private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
@@ -96,7 +96,7 @@ namespace OpenSim
{
this.SetupLocalGridServers();
// this.checkServer = new CheckSumServer(12036);
- // this.checkServer.ServerListener();
+ // this.checkServer.ServerListener();
this.commsManager = new CommunicationsLocal(this.serversData);
}
else
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs
index b38979d..d9d6f51 100644
--- a/OpenSim/Region/Capabilities/Caps.cs
+++ b/OpenSim/Region/Capabilities/Caps.cs
@@ -98,13 +98,6 @@ namespace OpenSim.Region.Capabilities
///
protected LLSDCapsDetails GetCapabilities()
{
- /* string capURLS = "";
- capURLS += "MapLayerhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "";
- capURLS += "NewFileAgentInventoryhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "";
- //capURLS += "RequestTextureDownloadhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "";
- //capURLS += "EventQueueGethttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + "";
- return capURLS;*/
-
LLSDCapsDetails caps = new LLSDCapsDetails();
string capsBaseUrl = "http://" + httpListenerHostName + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath;
@@ -131,8 +124,6 @@ namespace OpenSim.Region.Capabilities
LLSDMapLayerResponse mapResponse= new LLSDMapLayerResponse();
mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse());
string res = LLSDHelpers.SerialiseLLSDReply(mapResponse);
-
- //Console.WriteLine(" Maplayer response is " + res);
return res;
}
@@ -172,27 +163,23 @@ namespace OpenSim.Region.Capabilities
public string CreateEstablishAgentComms(string caps, string ipAddressPort)
{
- string res = "";
+ LLSDCapEvent eventItem = new LLSDCapEvent();
+ eventItem.id = eventQueueCount;
+ //should be creating a EstablishAgentComms item, but there isn't a class for it yet
+ eventItem.events.Array.Add(new LLSDEmpty());
+ string res = LLSDHelpers.SerialiseLLSDReply(eventItem);
eventQueueCount++;
+
this.CapsEventQueue.Enqueue(res);
return res;
}
public string CreateEmptyEventResponse()
{
- string res = "id" + eventQueueCount + "";
- res += "events";
- res += "";
- res += "";
+ LLSDCapEvent eventItem = new LLSDCapEvent();
+ eventItem.id = eventQueueCount;
+ eventItem.events.Array.Add(new LLSDEmpty());
+ string res = LLSDHelpers.SerialiseLLSDReply(eventItem);
eventQueueCount++;
return res;
}
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 40e0021..6de6af6 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -64,6 +64,7 @@ namespace OpenSim.Region.ClientStack
public event UpdatePrimTexture OnUpdatePrimTexture;
public event UpdateVector OnUpdatePrimPosition;
public event UpdatePrimRotation OnUpdatePrimRotation;
+ public event UpdatePrimGroupRotation OnUpdatePrimGroupRotation;
public event UpdateVector OnUpdatePrimScale;
public event StatusChange OnChildAgentStatus;
public event GenericCall2 OnStopMovement;
@@ -644,7 +645,7 @@ namespace OpenSim.Region.ClientStack
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
byte[] rot = rotation.GetBytes();
- Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length);
+ Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length);
OutPacket(outPacket);
}
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
index e4512d1..0b6c4f6 100644
--- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
+++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
@@ -101,8 +101,10 @@ namespace OpenSim.Region.ClientStack
protected bool MultipleObjUpdate(ClientView simClient, Packet packet)
{
MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
+ // Console.WriteLine("new multi update packet " + multipleupdate.ToString());
for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
{
+ #region position
if (multipleupdate.ObjectData[i].Type == 9) //change position
{
if (OnUpdatePrimPosition != null)
@@ -110,24 +112,95 @@ namespace OpenSim.Region.ClientStack
LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
}
- //should update stored position of the prim
+
+ }
+ else if (multipleupdate.ObjectData[i].Type == 1) //single item of group change position
+ {
+ if (OnUpdatePrimPosition != null)
+ {
+ // libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ //OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
+ }
}
- else if (multipleupdate.ObjectData[i].Type == 10)//rotation
+ #endregion position
+ #region rotation
+ else if (multipleupdate.ObjectData[i].Type == 2)// single item of group rotation from tab
{
if (OnUpdatePrimRotation != null)
{
LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
+ // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
+ OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
+ }
+ }
+ else if (multipleupdate.ObjectData[i].Type == 3)// single item of group rotation from mouse
+ {
+ if (OnUpdatePrimRotation != null)
+ {
+ libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
+ // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
+ OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
+ }
+ }
+ else if (multipleupdate.ObjectData[i].Type == 10)//group rotation from object tab
+ {
+ if (OnUpdatePrimRotation != null)
+ {
+ libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
+ // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
}
}
- else if (multipleupdate.ObjectData[i].Type == 13)//scale
+ else if (multipleupdate.ObjectData[i].Type == 11)//group rotation from mouse
+ {
+ if (OnUpdatePrimGroupRotation != null)
+ {
+ libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
+ //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
+ // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
+ OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this);
+ }
+ }
+ #endregion
+ #region scale
+ else if (multipleupdate.ObjectData[i].Type == 13)//group scale from object tab
{
if (OnUpdatePrimScale != null)
{
LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
+ //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
+ OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
+ }
+ }
+ else if (multipleupdate.ObjectData[i].Type == 29)//group scale from mouse
+ {
+ if (OnUpdatePrimScale != null)
+ {
+ libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
+ // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z );
+ // OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
+ }
+ }
+ else if (multipleupdate.ObjectData[i].Type == 5)//single scale from object tab
+ {
+ if (OnUpdatePrimScale != null)
+ {
+ libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
+ // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
+ OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
+ }
+ }
+ else if (multipleupdate.ObjectData[i].Type == 21)//single scale from mouse
+ {
+ if (OnUpdatePrimScale != null)
+ {
+ libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
+ // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
}
}
+ #endregion
}
return true;
}
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index a8eb9ce..2874ae2 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- public Quaternion _rotation;
+ public Quaternion _rotation = new Quaternion(0,0,1,0);
public virtual Quaternion rotation
{
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index a767bd2..803bd28 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes
private PrimitiveBaseShape m_Shape;
public SceneObject m_RootParent;
- public bool isRootPrim;
+ public bool isRootPrim;
public EntityBase m_Parent;
public override LLVector3 Pos
@@ -60,7 +60,11 @@ namespace OpenSim.Region.Environment.Scenes
}
set
{
- this.m_pos = m_Parent.Pos - value; //should we being subtracting the parent position
+ if (isRootPrim)
+ {
+ m_Parent.Pos = value;
+ }
+ this.m_pos = value - m_Parent.Pos;
}
}
@@ -77,7 +81,19 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent , SceneObject rootObject)
+ public LLVector3 Scale
+ {
+ set
+ {
+ this.m_Shape.Scale = value;
+ }
+ get
+ {
+ return this.m_Shape.Scale;
+ }
+ }
+
+ public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject)
{
m_regionHandle = regionHandle;
m_world = world;
@@ -86,12 +102,13 @@ namespace OpenSim.Region.Environment.Scenes
this.isRootPrim = isRoot;
this.m_RootParent = rootObject;
this.CreateFromPacket(addPacket, ownerID, localID);
+ this.rotation = Axiom.MathLib.Quaternion.Identity;
}
///
///
///
- public override void update()
+ public override void update()
{
if (this.updateFlag == 1) // is a new prim just been created/reloaded or has major changes
{
@@ -104,7 +121,10 @@ namespace OpenSim.Region.Environment.Scenes
this.updateFlag = 0;
}
- base.update();
+ foreach (EntityBase child in children)
+ {
+ child.update();
+ }
}
///
@@ -150,9 +170,13 @@ namespace OpenSim.Region.Environment.Scenes
this.updateFlag = 1;
}
+ ///
+ ///
+ ///
+ ///
public void AddNewChildren(SceneObject linkObject)
{
- // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")");
+ // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")");
//TODO check permissions
this.children.Add(linkObject.rootPrimitive);
linkObject.rootPrimitive.SetNewParent(this, this.m_RootParent);
@@ -161,30 +185,73 @@ namespace OpenSim.Region.Environment.Scenes
linkObject.DeleteAllChildren();
}
+ ///
+ ///
+ ///
+ ///
+ ///
public void SetNewParent(Primitive newParent, SceneObject rootParent)
{
LLVector3 oldPos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z);
- //Console.WriteLine("have a new parent and my old position is " + this.Pos.X + " , " + this.Pos.Y + " , " + this.Pos.Z);
this.isRootPrim = false;
this.m_Parent = newParent;
this.ParentID = newParent.LocalId;
this.SetRootParent(rootParent);
- // Console.WriteLine("have a new parent and its position is " + this.m_Parent.Pos.X + " , " + this.m_Parent.Pos.Y + " , " + this.m_Parent.Pos.Z);
this.Pos = oldPos;
- // Console.WriteLine("have a new parent so my new offset position is " + this.Pos.X + " , " + this.Pos.Y + " , " + this.Pos.Z);
+ Axiom.MathLib.Vector3 axPos = new Axiom.MathLib.Vector3(this.m_pos.X, m_pos.Y, m_pos.Z);
+ axPos = this.m_Parent.rotation.Inverse() * axPos;
+ this.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z);
+ this.rotation = this.rotation * this.m_Parent.rotation.Inverse();
this.updateFlag = 1;
}
+ ///
+ ///
+ ///
+ ///
public void SetRootParent(SceneObject newRoot)
{
this.m_RootParent = newRoot;
+ this.m_RootParent.AddChildToList(this);
foreach (Primitive child in children)
{
child.SetRootParent(newRoot);
}
}
+ public void AddOffsetToChildren(LLVector3 offset)
+ {
+ foreach (Primitive prim in this.children)
+ {
+ prim.m_pos += offset;
+ prim.updateFlag = 2;
+ }
+ }
+
+ #region Resizing/Scale
+ public void ResizeGoup(LLVector3 scale)
+ {
+ LLVector3 offset = (scale - this.m_Shape.Scale);
+ offset.X /= 2;
+ offset.Y /= 2;
+ offset.Z /= 2;
+ if (this.isRootPrim)
+ {
+ this.m_Parent.Pos += offset;
+ }
+ else
+ {
+ this.m_pos += offset;
+ }
+
+ this.AddOffsetToChildren(new LLVector3(-offset.X, -offset.Y, -offset.Z));
+ this.m_Shape.Scale = scale;
+
+ this.updateFlag = 1;
+ }
+ #endregion
+
///
///
///
@@ -192,14 +259,47 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdatePosition(LLVector3 pos)
{
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
- if (this.isRootPrim)
- {
- this.m_Parent.Pos = newPos;
- }
+
this.Pos = newPos;
this.updateFlag = 2;
}
+ public void UpdateRotation(LLQuaternion rot)
+ {
+ this.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
+ this.updateFlag = 2;
+ }
+
+ public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot)
+ {
+ this.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
+ this.Pos = pos;
+ this.updateFlag = 2;
+ }
+
+ public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
+ {
+ this.m_Shape.PathBegin = shapeBlock.PathBegin;
+ this.m_Shape.PathEnd = shapeBlock.PathEnd;
+ this.m_Shape.PathScaleX = shapeBlock.PathScaleX;
+ this.m_Shape.PathScaleY = shapeBlock.PathScaleY;
+ this.m_Shape.PathShearX = shapeBlock.PathShearX;
+ this.m_Shape.PathShearY = shapeBlock.PathShearY;
+ this.m_Shape.PathSkew = shapeBlock.PathSkew;
+ this.m_Shape.ProfileBegin = shapeBlock.ProfileBegin;
+ this.m_Shape.ProfileEnd = shapeBlock.ProfileEnd;
+ this.m_Shape.PathCurve = shapeBlock.PathCurve;
+ this.m_Shape.ProfileCurve = shapeBlock.ProfileCurve;
+ this.m_Shape.ProfileHollow = shapeBlock.ProfileHollow;
+ this.m_Shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
+ this.m_Shape.PathRevolutions = shapeBlock.PathRevolutions;
+ this.m_Shape.PathTaperX = shapeBlock.PathTaperX;
+ this.m_Shape.PathTaperY = shapeBlock.PathTaperY;
+ this.m_Shape.PathTwist = shapeBlock.PathTwist;
+ this.m_Shape.PathTwistBegin = shapeBlock.PathTwistBegin;
+ this.updateFlag = 1;
+ }
+
#region Client Update Methods
///
@@ -226,8 +326,10 @@ namespace OpenSim.Region.Environment.Scenes
{
LLVector3 lPos;
lPos = this.Pos;
+ LLQuaternion lRot;
+ lRot = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w);
- remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.m_Shape, lPos, new LLUUID("00000000-0000-0000-9999-000000000005"), this.flags, this.uuid, this.OwnerID, this.Text, this.ParentID);
+ remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.m_Shape, lPos, lRot, new LLUUID("00000000-0000-0000-9999-000000000005"), this.flags, this.uuid, this.OwnerID, this.Text, this.ParentID);
}
///
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 669039f..0927903 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -233,7 +233,19 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
{
-
+ Primitive prim = null;
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ prim = ((SceneObject)ent).HasChildPrim(primLocalID);
+ if (prim != null)
+ {
+ prim.UpdateShape(shapeBlock);
+ break;
+ }
+ }
+ }
}
///
@@ -263,7 +275,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void PrimDescription(uint primLocalID, string description)
{
- Primitive prim = null;
+ Primitive prim = null;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
@@ -271,7 +283,7 @@ namespace OpenSim.Region.Environment.Scenes
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
{
- prim.Description = description;
+ prim.Description = description;
break;
}
}
@@ -341,12 +353,41 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
{
- foreach (Entity ent in Entities.Values)
+ Primitive prim = null;
+ foreach (EntityBase ent in Entities.Values)
{
- if (ent.LocalId == localID)
+ if (ent is SceneObject)
{
- ((PrimitiveOld)ent).UpdatePosition(pos);
- break;
+ prim = ((SceneObject)ent).HasChildPrim(localID);
+ if (prim != null)
+ {
+ prim.UpdatePosition(pos);
+ break;
+ }
+ }
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient)
+ {
+ Primitive prim = null;
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ prim = ((SceneObject)ent).HasChildPrim(localID);
+ if (prim != null)
+ {
+ prim.UpdateGroupMouseRotation( pos, rot);
+ break;
+ }
}
}
}
@@ -359,7 +400,19 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
{
-
+ Primitive prim = null;
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ prim = ((SceneObject)ent).HasChildPrim(localID);
+ if (prim != null)
+ {
+ prim.UpdateRotation(rot);
+ break;
+ }
+ }
+ }
}
///
@@ -370,6 +423,19 @@ namespace OpenSim.Region.Environment.Scenes
///
public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
{
+ Primitive prim = null;
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ prim = ((SceneObject)ent).HasChildPrim(localID);
+ if (prim != null)
+ {
+ prim.ResizeGoup(scale);
+ break;
+ }
+ }
+ }
}
///
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d13b3ab..838d722 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -452,7 +452,11 @@ namespace OpenSim.Region.Environment.Scenes
client.OnChatFromViewer += this.SimChat;
client.OnRequestWearables += this.InformClientOfNeighbours;
client.OnAddPrim += this.AddNewPrim;
- //client.OnUpdatePrimPosition += this.UpdatePrimPosition;
+ client.OnUpdatePrimPosition += this.UpdatePrimPosition;
+ client.OnUpdatePrimRotation += this.UpdatePrimRotation;
+ client.OnUpdatePrimGroupRotation += this.UpdatePrimRotation;
+ client.OnUpdatePrimScale += this.UpdatePrimScale;
+ client.OnUpdatePrimShape += this.UpdatePrimShape;
client.OnRequestMapBlocks += this.RequestMapBlocks;
client.OnTeleportLocationRequest += this.RequestTeleportLocation;
client.OnObjectSelect += this.SelectPrim;
@@ -596,6 +600,17 @@ namespace OpenSim.Region.Environment.Scenes
return false;
}
+ public void SendAllSceneObjectsToClient(IClientAPI client)
+ {
+ foreach (EntityBase ent in Entities.Values)
+ {
+ if (ent is SceneObject)
+ {
+ ((SceneObject)ent).SendAllChildPrimsToClient(client);
+ }
+ }
+ }
+
#region RegionCommsHost
///
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs
index 04ed408..3d97a06 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObject.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs
@@ -63,6 +63,7 @@ namespace OpenSim.Region.Environment.Scenes
return this.LocalId;
}
}
+
///
///
///
@@ -72,8 +73,8 @@ namespace OpenSim.Region.Environment.Scenes
m_world = world;
this.Pos = addPacket.ObjectData.RayEnd;
this.CreateRootFromPacket(addPacket, ownerID, localID);
-
}
+
///
///
///
@@ -115,6 +116,13 @@ namespace OpenSim.Region.Environment.Scenes
this.rootPrimitive.AddNewChildren(primObject);
}
+ public void AddChildToList(Primitive prim)
+ {
+ if (!this.ChildPrimitives.ContainsKey(prim.uuid))
+ {
+ this.ChildPrimitives.Add(prim.uuid, prim);
+ }
+ }
///
///
///
@@ -130,10 +138,15 @@ namespace OpenSim.Region.Environment.Scenes
return null;
}
+ ///
+ ///
+ ///
+ ///
+ ///
public Primitive HasChildPrim(uint localID)
{
Primitive returnPrim = null;
- foreach (Primitive prim in this.children)
+ foreach (Primitive prim in this.ChildPrimitives.Values)
{
if (prim.LocalId == localID)
{
@@ -144,6 +157,11 @@ namespace OpenSim.Region.Environment.Scenes
return returnPrim;
}
+ public void SendAllChildPrimsToClient(IClientAPI client)
+ {
+ this.rootPrimitive.SendFullUpdateForAllChildren(client);
+ }
+
///
///
///
@@ -160,7 +178,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
{
- this.Pos = pos;
+ //this.Pos = pos;
this.rootPrimitive.Pos = pos;
this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient);
}
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index dcca848..98fa2ed 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -384,6 +384,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendOurAppearance(IClientAPI OurClient)
{
this.ControllingClient.SendWearables(this.Wearables);
+ this.m_world.SendAllSceneObjectsToClient(this.ControllingClient);
}
///
--
cgit v1.1