From 9800c05c1b3c7804466d6f3a9c38a739156625fd Mon Sep 17 00:00:00 2001
From: MW
Date: Sun, 1 Jul 2007 17:26:33 +0000
Subject: Started change to having SceneObject and then that having child
Primitives which in turn have a Shape object (currently PrimitiveBaseShape).
The plan is only for the SceneObject to interface with the physics engines.
As a physics Entity should be able to have mulitple shapes connected to it.
---
.../Communications/CommunicationsManager.cs | 7 +-
OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 +
OpenSim/Framework/General/OpenSim.Framework.csproj | 3 +
.../Framework/General/OpenSim.Framework.dll.build | 1 +
.../Framework/General/Types/PrimitiveBaseShape.cs | 106 +++++++++++++++++++++
OpenSim/Framework/Servers/BaseHttpServer.cs | 12 ---
6 files changed, 117 insertions(+), 14 deletions(-)
create mode 100644 OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index b17b37b..48ff40e 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -54,13 +54,16 @@ namespace OpenSim.Framework.Communications
#region Packet Handlers
public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client)
{
+ System.Text.Encoding enc = System.Text.Encoding.ASCII;
UserProfileData profileData = this.UserServer.GetUserProfile(uuid);
if (profileData != null)
{
UUIDNameReplyPacket packet = new UUIDNameReplyPacket();
+ packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1];
+ packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
packet.UUIDNameBlock[0].ID = profileData.UUID;
- packet.UUIDNameBlock[0].FirstName = libsecondlife.Helpers.StringToField(profileData.username);
- packet.UUIDNameBlock[0].LastName = libsecondlife.Helpers.StringToField(profileData.surname);
+ packet.UUIDNameBlock[0].FirstName = enc.GetBytes(profileData.username + "\0");
+ packet.UUIDNameBlock[0].LastName = enc.GetBytes(profileData.surname +"\0");
remote_client.OutPacket((Packet)packet);
}
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index ea4c5c9..9c112ae 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -160,6 +160,8 @@ namespace OpenSim.Framework.Interfaces
void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID , uint flags);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags);
+ void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID);
+ void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID);
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation);
}
}
diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj
index 7d3d53a..a577ea3 100644
--- a/OpenSim/Framework/General/OpenSim.Framework.csproj
+++ b/OpenSim/Framework/General/OpenSim.Framework.csproj
@@ -184,6 +184,9 @@
Code
+
+ Code
+
Code
diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build
index 239e3e5..10fafbf 100644
--- a/OpenSim/Framework/General/OpenSim.Framework.dll.build
+++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build
@@ -43,6 +43,7 @@
+
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
new file mode 100644
index 0000000..094a8a0
--- /dev/null
+++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using libsecondlife;
+using libsecondlife.Packets;
+using OpenSim.Framework.Interfaces;
+
+namespace OpenSim.Framework.Types
+{
+ public enum ShapeType
+ {
+ Box,
+ Sphere,
+ Ring,
+ Tube,
+ Torus,
+ Prism,
+ Scuplted,
+ Cylinder
+ }
+
+ public class PrimitiveBaseShape
+ {
+ private ShapeType type;
+
+ public byte PCode;
+ public ushort PathBegin;
+ public ushort PathEnd;
+ public byte PathScaleX;
+ public byte PathScaleY;
+ public byte PathShearX;
+ public byte PathShearY;
+ public sbyte PathSkew;
+ public ushort ProfileBegin;
+ public ushort ProfileEnd;
+ public LLVector3 Scale;
+ public byte PathCurve;
+ public byte ProfileCurve;
+ public uint ParentID = 0;
+ public ushort ProfileHollow;
+ public sbyte PathRadiusOffset;
+ public byte PathRevolutions;
+ public sbyte PathTaperX;
+ public sbyte PathTaperY;
+ public sbyte PathTwist;
+ public sbyte PathTwistBegin;
+ public byte[] TextureEntry; // a LL textureEntry in byte[] format
+
+ public ShapeType PrimType
+ {
+ get
+ {
+ return this.type;
+ }
+ }
+
+ public LLVector3 PrimScale
+ {
+ get
+ {
+ return this.Scale;
+ }
+ }
+
+ public PrimitiveBaseShape()
+ {
+
+ }
+
+ //void returns need to change of course
+ public void GetMesh()
+ {
+
+ }
+
+ public static PrimitiveBaseShape DefaultCube()
+ {
+ PrimitiveBaseShape primShape = new PrimitiveBaseShape();
+
+ primShape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
+ primShape.PCode = 9;
+ primShape.ParentID = 0;
+ primShape.PathBegin = 0;
+ primShape.PathEnd = 0;
+ primShape.PathScaleX = 0;
+ primShape.PathScaleY = 0;
+ primShape.PathShearX = 0;
+ primShape.PathShearY = 0;
+ primShape.PathSkew = 0;
+ primShape.ProfileBegin = 0;
+ primShape.ProfileEnd = 0;
+ primShape.PathCurve = 16;
+ primShape.ProfileCurve = 1;
+ primShape.ProfileHollow = 0;
+ primShape.PathRadiusOffset = 0;
+ primShape.PathRevolutions = 0;
+ primShape.PathTaperX = 0;
+ primShape.PathTaperY = 0;
+ primShape.PathTwist = 0;
+ primShape.PathTwistBegin = 0;
+
+ return primShape;
+ }
+ }
+
+}
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 8c8204a..681bb46 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -167,18 +167,6 @@ namespace OpenSim.Framework.Servers
return response;
}
- protected virtual string ParseLLSDXML(string requestBody)
- {
- // dummy function for now - IMPLEMENT ME!
- //Console.WriteLine("LLSD request "+requestBody);
- string resp = "";
- if (firstcaps)
- {
- resp = "";
- firstcaps = false;
- }
- return resp;
- }
protected virtual string ParseXMLRPC(string requestBody)
{
--
cgit v1.1