Today's work on Building support/tools. Think I am slowly getting there.

Sugilite
MW 2007-07-03 20:10:20 +00:00
parent 78e420f48b
commit bd8018fa1c
14 changed files with 396 additions and 118 deletions

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C# Express 2005 # Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}"
@ -29,6 +29,17 @@ Global
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
({FD2D303D-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000})
({17F7F694-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000})
({17F7F6BE-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000})
({6ECC56A9-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000})
({586E2916-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
({60FCC3A6-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
({60FCC3A6-0000-0000-0000-000000000000}).7 = ({4B7BFD1C-0000-0000-0000-000000000000})
({2FC96F92-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000})
({2FC96F92-0000-0000-0000-000000000000}).7 = ({586E2916-0000-0000-0000-000000000000})
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU

View File

@ -56,6 +56,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient);
public delegate void StatusChange(bool status); public delegate void StatusChange(bool status);
public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation);
@ -100,6 +101,7 @@ namespace OpenSim.Framework.Interfaces
event UpdatePrimTexture OnUpdatePrimTexture; event UpdatePrimTexture OnUpdatePrimTexture;
event UpdateVector OnUpdatePrimPosition; event UpdateVector OnUpdatePrimPosition;
event UpdatePrimRotation OnUpdatePrimRotation; event UpdatePrimRotation OnUpdatePrimRotation;
event UpdatePrimGroupRotation OnUpdatePrimGroupRotation;
event UpdateVector OnUpdatePrimScale; event UpdateVector OnUpdatePrimScale;
event StatusChange OnChildAgentStatus; event StatusChange OnChildAgentStatus;
event GenericCall2 OnStopMovement; event GenericCall2 OnStopMovement;

View File

@ -12,6 +12,7 @@ namespace OpenSim.Framework.Types
Prism, Prism,
Scuplted, Scuplted,
Cylinder, Cylinder,
Foliage,
Unknown Unknown
} }

View File

@ -26,8 +26,8 @@
* *
*/ */
namespace OpenSim.Framework.Servers namespace OpenSim.Framework.Servers
{ {/*
/* public class CheckSumServer : UDPServerBase public class CheckSumServer : UDPServerBase
{ {
//protected ConsoleBase m_log; //protected ConsoleBase m_log;
@ -121,6 +121,7 @@ namespace OpenSim.Framework.Servers
{ {
this.Server.SendTo(buffer, size, flags, endp); this.Server.SendTo(buffer, size, flags, endp);
} }
* * }
}*/ */
} }

View File

@ -98,13 +98,6 @@ namespace OpenSim.Region.Capabilities
/// <returns></returns> /// <returns></returns>
protected LLSDCapsDetails GetCapabilities() protected LLSDCapsDetails GetCapabilities()
{ {
/* string capURLS = "";
capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "</string>";
capURLS += "<key>NewFileAgentInventory</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "</string>";
//capURLS += "<key>RequestTextureDownload</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "</string>";
//capURLS += "<key>EventQueueGet</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + "</string>";
return capURLS;*/
LLSDCapsDetails caps = new LLSDCapsDetails(); LLSDCapsDetails caps = new LLSDCapsDetails();
string capsBaseUrl = "http://" + httpListenerHostName + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath; string capsBaseUrl = "http://" + httpListenerHostName + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath;
@ -132,8 +125,6 @@ namespace OpenSim.Region.Capabilities
mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse());
string res = LLSDHelpers.SerialiseLLSDReply(mapResponse); string res = LLSDHelpers.SerialiseLLSDReply(mapResponse);
//Console.WriteLine(" Maplayer response is " + res);
return res; return res;
} }
@ -172,27 +163,23 @@ namespace OpenSim.Region.Capabilities
public string CreateEstablishAgentComms(string caps, string ipAddressPort) public string CreateEstablishAgentComms(string caps, string ipAddressPort)
{ {
string res = "<llsd><map><key>id</key><integer>" + eventQueueCount + "</integer>"; LLSDCapEvent eventItem = new LLSDCapEvent();
res += "<key>events</key><array><map>"; eventItem.id = eventQueueCount;
res += "<key>message</key><string>EstablishAgentCommunication</string>"; //should be creating a EstablishAgentComms item, but there isn't a class for it yet
res += "<key>body</key><map>"; eventItem.events.Array.Add(new LLSDEmpty());
res += "<key>sim-ip-and-port</key><string>" + ipAddressPort + "</string>"; string res = LLSDHelpers.SerialiseLLSDReply(eventItem);
res += "<key>seed-capability</key><string>" + caps + "</string>";
res += "<key>agent-id</key><uuid>" + this.agentID.ToStringHyphenated() + "</uuid>";
res += "</map>";
res += "</map></array>";
res += "</map></llsd>";
eventQueueCount++; eventQueueCount++;
this.CapsEventQueue.Enqueue(res); this.CapsEventQueue.Enqueue(res);
return res; return res;
} }
public string CreateEmptyEventResponse() public string CreateEmptyEventResponse()
{ {
string res = "<llsd><map><key>id</key><integer>" + eventQueueCount + "</integer>"; LLSDCapEvent eventItem = new LLSDCapEvent();
res += "<key>events</key><array><map>"; eventItem.id = eventQueueCount;
res += "</map></array>"; eventItem.events.Array.Add(new LLSDEmpty());
res += "</map></llsd>"; string res = LLSDHelpers.SerialiseLLSDReply(eventItem);
eventQueueCount++; eventQueueCount++;
return res; return res;
} }

View File

@ -64,6 +64,7 @@ namespace OpenSim.Region.ClientStack
public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdatePrimTexture OnUpdatePrimTexture;
public event UpdateVector OnUpdatePrimPosition; public event UpdateVector OnUpdatePrimPosition;
public event UpdatePrimRotation OnUpdatePrimRotation; public event UpdatePrimRotation OnUpdatePrimRotation;
public event UpdatePrimGroupRotation OnUpdatePrimGroupRotation;
public event UpdateVector OnUpdatePrimScale; public event UpdateVector OnUpdatePrimScale;
public event StatusChange OnChildAgentStatus; public event StatusChange OnChildAgentStatus;
public event GenericCall2 OnStopMovement; public event GenericCall2 OnStopMovement;
@ -644,7 +645,7 @@ namespace OpenSim.Region.ClientStack
byte[] pb = pos.GetBytes(); byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
byte[] rot = rotation.GetBytes(); 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); OutPacket(outPacket);
} }

View File

@ -101,8 +101,10 @@ namespace OpenSim.Region.ClientStack
protected bool MultipleObjUpdate(ClientView simClient, Packet packet) protected bool MultipleObjUpdate(ClientView simClient, Packet packet)
{ {
MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
// Console.WriteLine("new multi update packet " + multipleupdate.ToString());
for (int i = 0; i < multipleupdate.ObjectData.Length; i++) for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
{ {
#region position
if (multipleupdate.ObjectData[i].Type == 9) //change position if (multipleupdate.ObjectData[i].Type == 9) //change position
{ {
if (OnUpdatePrimPosition != null) if (OnUpdatePrimPosition != null)
@ -110,24 +112,95 @@ namespace OpenSim.Region.ClientStack
LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
} }
//should update stored position of the prim
} }
else if (multipleupdate.ObjectData[i].Type == 10)//rotation 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);
}
}
#endregion position
#region rotation
else if (multipleupdate.ObjectData[i].Type == 2)// single item of group rotation from tab
{ {
if (OnUpdatePrimRotation != null) if (OnUpdatePrimRotation != null)
{ {
LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); 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); OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
} }
} }
else if (multipleupdate.ObjectData[i].Type == 13)//scale 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 == 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) if (OnUpdatePrimScale != null)
{ {
LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); 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); 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; return true;
} }

View File

@ -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 public virtual Quaternion rotation
{ {

View File

@ -60,7 +60,11 @@ namespace OpenSim.Region.Environment.Scenes
} }
set 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,6 +81,18 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
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) public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject)
{ {
m_regionHandle = regionHandle; m_regionHandle = regionHandle;
@ -86,6 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
this.isRootPrim = isRoot; this.isRootPrim = isRoot;
this.m_RootParent = rootObject; this.m_RootParent = rootObject;
this.CreateFromPacket(addPacket, ownerID, localID); this.CreateFromPacket(addPacket, ownerID, localID);
this.rotation = Axiom.MathLib.Quaternion.Identity;
} }
/// <summary> /// <summary>
@ -104,7 +121,10 @@ namespace OpenSim.Region.Environment.Scenes
this.updateFlag = 0; this.updateFlag = 0;
} }
base.update(); foreach (EntityBase child in children)
{
child.update();
}
} }
/// <summary> /// <summary>
@ -150,6 +170,10 @@ namespace OpenSim.Region.Environment.Scenes
this.updateFlag = 1; this.updateFlag = 1;
} }
/// <summary>
///
/// </summary>
/// <param name="linkObject"></param>
public void AddNewChildren(SceneObject linkObject) 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 + ")");
@ -161,30 +185,73 @@ namespace OpenSim.Region.Environment.Scenes
linkObject.DeleteAllChildren(); linkObject.DeleteAllChildren();
} }
/// <summary>
///
/// </summary>
/// <param name="newParent"></param>
/// <param name="rootParent"></param>
public void SetNewParent(Primitive newParent, SceneObject rootParent) public void SetNewParent(Primitive newParent, SceneObject rootParent)
{ {
LLVector3 oldPos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z); 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.isRootPrim = false;
this.m_Parent = newParent; this.m_Parent = newParent;
this.ParentID = newParent.LocalId; this.ParentID = newParent.LocalId;
this.SetRootParent(rootParent); 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; 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; this.updateFlag = 1;
} }
/// <summary>
///
/// </summary>
/// <param name="newRoot"></param>
public void SetRootParent(SceneObject newRoot) public void SetRootParent(SceneObject newRoot)
{ {
this.m_RootParent = newRoot; this.m_RootParent = newRoot;
this.m_RootParent.AddChildToList(this);
foreach (Primitive child in children) foreach (Primitive child in children)
{ {
child.SetRootParent(newRoot); 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
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -192,14 +259,47 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdatePosition(LLVector3 pos) public void UpdatePosition(LLVector3 pos)
{ {
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
if (this.isRootPrim)
{
this.m_Parent.Pos = newPos;
}
this.Pos = newPos; this.Pos = newPos;
this.updateFlag = 2; 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 #region Client Update Methods
/// <summary> /// <summary>
@ -226,8 +326,10 @@ namespace OpenSim.Region.Environment.Scenes
{ {
LLVector3 lPos; LLVector3 lPos;
lPos = this.Pos; 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);
} }
/// <summary> /// <summary>

View File

@ -233,7 +233,19 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="shapeBlock"></param> /// <param name="shapeBlock"></param>
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) 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;
}
}
}
} }
/// <summary> /// <summary>
@ -341,15 +353,44 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) 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); prim = ((SceneObject)ent).HasChildPrim(localID);
if (prim != null)
{
prim.UpdatePosition(pos);
break; break;
} }
} }
} }
}
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <param name="pos"></param>
/// <param name="rot"></param>
/// <param name="remoteClient"></param>
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;
}
}
}
}
/// <summary> /// <summary>
/// ///
@ -359,7 +400,19 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) 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;
}
}
}
} }
/// <summary> /// <summary>
@ -370,6 +423,19 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) 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;
}
}
}
} }
/// <summary> /// <summary>

View File

@ -452,7 +452,11 @@ namespace OpenSim.Region.Environment.Scenes
client.OnChatFromViewer += this.SimChat; client.OnChatFromViewer += this.SimChat;
client.OnRequestWearables += this.InformClientOfNeighbours; client.OnRequestWearables += this.InformClientOfNeighbours;
client.OnAddPrim += this.AddNewPrim; 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.OnRequestMapBlocks += this.RequestMapBlocks;
client.OnTeleportLocationRequest += this.RequestTeleportLocation; client.OnTeleportLocationRequest += this.RequestTeleportLocation;
client.OnObjectSelect += this.SelectPrim; client.OnObjectSelect += this.SelectPrim;
@ -596,6 +600,17 @@ namespace OpenSim.Region.Environment.Scenes
return false; return false;
} }
public void SendAllSceneObjectsToClient(IClientAPI client)
{
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
{
((SceneObject)ent).SendAllChildPrimsToClient(client);
}
}
}
#region RegionCommsHost #region RegionCommsHost
/// <summary> /// <summary>

View File

@ -63,6 +63,7 @@ namespace OpenSim.Region.Environment.Scenes
return this.LocalId; return this.LocalId;
} }
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -72,8 +73,8 @@ namespace OpenSim.Region.Environment.Scenes
m_world = world; m_world = world;
this.Pos = addPacket.ObjectData.RayEnd; this.Pos = addPacket.ObjectData.RayEnd;
this.CreateRootFromPacket(addPacket, ownerID, localID); this.CreateRootFromPacket(addPacket, ownerID, localID);
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -115,6 +116,13 @@ namespace OpenSim.Region.Environment.Scenes
this.rootPrimitive.AddNewChildren(primObject); this.rootPrimitive.AddNewChildren(primObject);
} }
public void AddChildToList(Primitive prim)
{
if (!this.ChildPrimitives.ContainsKey(prim.uuid))
{
this.ChildPrimitives.Add(prim.uuid, prim);
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -130,10 +138,15 @@ namespace OpenSim.Region.Environment.Scenes
return null; return null;
} }
/// <summary>
///
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
public Primitive HasChildPrim(uint localID) public Primitive HasChildPrim(uint localID)
{ {
Primitive returnPrim = null; Primitive returnPrim = null;
foreach (Primitive prim in this.children) foreach (Primitive prim in this.ChildPrimitives.Values)
{ {
if (prim.LocalId == localID) if (prim.LocalId == localID)
{ {
@ -144,6 +157,11 @@ namespace OpenSim.Region.Environment.Scenes
return returnPrim; return returnPrim;
} }
public void SendAllChildPrimsToClient(IClientAPI client)
{
this.rootPrimitive.SendFullUpdateForAllChildren(client);
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -160,7 +178,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
{ {
this.Pos = pos; //this.Pos = pos;
this.rootPrimitive.Pos = pos; this.rootPrimitive.Pos = pos;
this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient); this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient);
} }

View File

@ -384,6 +384,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SendOurAppearance(IClientAPI OurClient) public void SendOurAppearance(IClientAPI OurClient)
{ {
this.ControllingClient.SendWearables(this.Wearables); this.ControllingClient.SendWearables(this.Wearables);
this.m_world.SendAllSceneObjectsToClient(this.ControllingClient);
} }
/// <summary> /// <summary>