aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-07-18 20:29:06 +0000
committerMW2007-07-18 20:29:06 +0000
commitd2b459b8e592b48edbdd03a154dcaa7336d5ce8d (patch)
tree6431743dd3a7962ce22f788b15b869c6222b1ebe /OpenSim
parentMore testing some ideas, to find best method for SceneObject Primitive classes. (diff)
downloadopensim-SC_OLD-d2b459b8e592b48edbdd03a154dcaa7336d5ce8d.zip
opensim-SC_OLD-d2b459b8e592b48edbdd03a154dcaa7336d5ce8d.tar.gz
opensim-SC_OLD-d2b459b8e592b48edbdd03a154dcaa7336d5ce8d.tar.bz2
opensim-SC_OLD-d2b459b8e592b48edbdd03a154dcaa7336d5ce8d.tar.xz
Sculpted Prims should now work.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/General/Interfaces/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/General/NullClientAPI.cs1
-rw-r--r--OpenSim/Framework/General/Types/PrimitiveBaseShape.cs6
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs2
9 files changed, 54 insertions, 3 deletions
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
index c7e1901..858126b 100644
--- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs
+++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs
@@ -53,6 +53,7 @@ namespace OpenSim.Framework.Interfaces
53 public delegate void GenericCall7(uint localID, string message); 53 public delegate void GenericCall7(uint localID, string message);
54 54
55 public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); 55 public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
56 public delegate void ObjectExtraParams(uint localID, ushort type, bool inUse, byte[] data);
56 public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); 57 public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
57 public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); 58 public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient);
58 public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); 59 public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
@@ -106,6 +107,7 @@ namespace OpenSim.Framework.Interfaces
106 event MoveObject OnGrapUpdate; 107 event MoveObject OnGrapUpdate;
107 108
108 event UpdateShape OnUpdatePrimShape; 109 event UpdateShape OnUpdatePrimShape;
110 event ObjectExtraParams OnUpdateExtraParams;
109 event ObjectSelect OnObjectSelect; 111 event ObjectSelect OnObjectSelect;
110 event ObjectDeselect OnObjectDeselect; 112 event ObjectDeselect OnObjectDeselect;
111 event GenericCall7 OnObjectDescription; 113 event GenericCall7 OnObjectDescription;
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs
index 44bc588..a5539ef 100644
--- a/OpenSim/Framework/General/NullClientAPI.cs
+++ b/OpenSim/Framework/General/NullClientAPI.cs
@@ -35,6 +35,7 @@ namespace OpenSim.Framework
35 public event MoveObject OnGrapUpdate; 35 public event MoveObject OnGrapUpdate;
36 36
37 public event UpdateShape OnUpdatePrimShape; 37 public event UpdateShape OnUpdatePrimShape;
38 public event ObjectExtraParams OnUpdateExtraParams;
38 public event ObjectSelect OnObjectSelect; 39 public event ObjectSelect OnObjectSelect;
39 public event GenericCall7 OnObjectDescription; 40 public event GenericCall7 OnObjectDescription;
40 public event GenericCall7 OnObjectName; 41 public event GenericCall7 OnObjectName;
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
index a582209..d08c903 100644
--- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
@@ -42,6 +42,7 @@ namespace OpenSim.Framework.Types
42 public sbyte PathTwist; 42 public sbyte PathTwist;
43 public sbyte PathTwistBegin; 43 public sbyte PathTwistBegin;
44 public byte[] TextureEntry; // a LL textureEntry in byte[] format 44 public byte[] TextureEntry; // a LL textureEntry in byte[] format
45 public byte[] ExtraParams;
45 46
46 public ShapeType PrimType 47 public ShapeType PrimType
47 { 48 {
@@ -61,7 +62,7 @@ namespace OpenSim.Framework.Types
61 62
62 public PrimitiveBaseShape() 63 public PrimitiveBaseShape()
63 { 64 {
64 65 ExtraParams = new byte[1];
65 } 66 }
66 67
67 //void returns need to change of course 68 //void returns need to change of course
@@ -81,6 +82,7 @@ namespace OpenSim.Framework.Types
81 public BoxShape() 82 public BoxShape()
82 { 83 {
83 type = ShapeType.Box; 84 type = ShapeType.Box;
85 ExtraParams = new byte[1];
84 } 86 }
85 87
86 public static BoxShape Default 88 public static BoxShape Default
@@ -111,6 +113,7 @@ namespace OpenSim.Framework.Types
111 primShape.PathTwistBegin = 0; 113 primShape.PathTwistBegin = 0;
112 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); 114 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
113 primShape.TextureEntry = ntex.ToBytes(); 115 primShape.TextureEntry = ntex.ToBytes();
116 primShape.ExtraParams = new byte[1];
114 117
115 return primShape; 118 return primShape;
116 } 119 }
@@ -122,6 +125,7 @@ namespace OpenSim.Framework.Types
122 public SphereShape() 125 public SphereShape()
123 { 126 {
124 type = ShapeType.Sphere; 127 type = ShapeType.Sphere;
128 ExtraParams = new byte[1];
125 } 129 }
126 } 130 }
127} 131}
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 54ddd97..440f583 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Region.ClientStack
59 public event ObjectDuplicate OnObjectDuplicate; 59 public event ObjectDuplicate OnObjectDuplicate;
60 public event MoveObject OnGrapUpdate; 60 public event MoveObject OnGrapUpdate;
61 public event AddNewPrim OnAddPrim; 61 public event AddNewPrim OnAddPrim;
62 public event ObjectExtraParams OnUpdateExtraParams;
62 public event UpdateShape OnUpdatePrimShape; 63 public event UpdateShape OnUpdatePrimShape;
63 public event ObjectSelect OnObjectSelect; 64 public event ObjectSelect OnObjectSelect;
64 public event ObjectDeselect OnObjectDeselect; 65 public event ObjectDeselect OnObjectDeselect;
@@ -968,6 +969,7 @@ namespace OpenSim.Region.ClientStack
968 objectData.PathTaperY = primData.PathTaperY; 969 objectData.PathTaperY = primData.PathTaperY;
969 objectData.PathTwist = primData.PathTwist; 970 objectData.PathTwist = primData.PathTwist;
970 objectData.PathTwistBegin = primData.PathTwistBegin; 971 objectData.PathTwistBegin = primData.PathTwistBegin;
972 objectData.ExtraParams = primData.ExtraParams;
971 } 973 }
972 974
973 /// <summary> 975 /// <summary>
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 338471e..c248b29 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -218,8 +218,6 @@ namespace OpenSim.Region.ClientStack
218 if (OnAddPrim != null) 218 if (OnAddPrim != null)
219 { 219 {
220 ObjectAddPacket addPacket = (ObjectAddPacket) Pack ; 220 ObjectAddPacket addPacket = (ObjectAddPacket) Pack ;
221 Console.WriteLine(addPacket.ToString());
222
223 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 221 PrimitiveBaseShape shape = new PrimitiveBaseShape();
224 222
225 shape.PCode = addPacket.ObjectData.PCode; 223 shape.PCode = addPacket.ObjectData.PCode;
@@ -258,6 +256,13 @@ namespace OpenSim.Region.ClientStack
258 } 256 }
259 } 257 }
260 break; 258 break;
259 case PacketType.ObjectExtraParams:
260 ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack;
261 if (OnUpdateExtraParams != null)
262 {
263 OnUpdateExtraParams(extraPar.ObjectData[0].ObjectLocalID, extraPar.ObjectData[0].ParamType, extraPar.ObjectData[0].ParamInUse, extraPar.ObjectData[0].ParamData);
264 }
265 break;
261 case PacketType.ObjectDuplicate: 266 case PacketType.ObjectDuplicate:
262 ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack; 267 ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack;
263 for (int i = 0; i < dupe.ObjectData.Length; i++) 268 for (int i = 0; i < dupe.ObjectData.Length; i++)
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index 4818348..bca8e0c 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -588,6 +588,24 @@ namespace OpenSim.Region.Environment.Scenes
588 588
589 #endregion 589 #endregion
590 590
591 public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
592 {
593 this.m_Shape.ExtraParams = new byte[data.Length + 7];
594 int i =0;
595 uint length = (uint) data.Length;
596 this.m_Shape.ExtraParams[i++] = 1;
597 this.m_Shape.ExtraParams[i++] = (byte)(type % 256);
598 this.m_Shape.ExtraParams[i++] = (byte)((type >> 8) % 256);
599
600 this.m_Shape.ExtraParams[i++] = (byte)(length % 256);
601 this.m_Shape.ExtraParams[i++] = (byte)((length >> 8) % 256);
602 this.m_Shape.ExtraParams[i++] = (byte)((length >> 16) % 256);
603 this.m_Shape.ExtraParams[i++] = (byte)((length >> 24) % 256);
604 Array.Copy(data, 0, this.m_Shape.ExtraParams, i, data.Length);
605
606 this.ScheduleFullUpdate();
607 }
608
591 #region Texture 609 #region Texture
592 610
593 /// <summary> 611 /// <summary>
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index f39d56a..5bfdccb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -327,6 +327,22 @@ namespace OpenSim.Region.Environment.Scenes
327 } 327 }
328 } 328 }
329 329
330 public void UpdateExtraParam(uint primLocalID, ushort type, bool inUse, byte[] data)
331 {
332 Primitive prim = null;
333 foreach (EntityBase ent in Entities.Values)
334 {
335 if (ent is SceneObject)
336 {
337 prim = ((SceneObject)ent).HasChildPrim(primLocalID);
338 if (prim != null)
339 {
340 prim.UpdateExtraParam(type, inUse, data);
341 break;
342 }
343 }
344 }
345 }
330 /// <summary> 346 /// <summary>
331 /// 347 ///
332 /// </summary> 348 /// </summary>
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 70d2c6a..1ba23b4 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -548,6 +548,7 @@ namespace OpenSim.Region.Environment.Scenes
548 client.OnUpdatePrimGroupMouseRotation += UpdatePrimRotation; 548 client.OnUpdatePrimGroupMouseRotation += UpdatePrimRotation;
549 client.OnUpdatePrimSingleRotation += UpdatePrimSingleRotation; 549 client.OnUpdatePrimSingleRotation += UpdatePrimSingleRotation;
550 client.OnUpdatePrimScale += UpdatePrimScale; 550 client.OnUpdatePrimScale += UpdatePrimScale;
551 client.OnUpdateExtraParams += UpdateExtraParam;
551 client.OnUpdatePrimShape += UpdatePrimShape; 552 client.OnUpdatePrimShape += UpdatePrimShape;
552 client.OnRequestMapBlocks += RequestMapBlocks; 553 client.OnRequestMapBlocks += RequestMapBlocks;
553 client.OnUpdatePrimTexture += UpdatePrimTexture; 554 client.OnUpdatePrimTexture += UpdatePrimTexture;
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index f7bf5d6..308dea7 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -47,7 +47,9 @@ namespace SimpleApp
47 public event ObjectSelect OnDeGrapObject; 47 public event ObjectSelect OnDeGrapObject;
48 public event MoveObject OnGrapUpdate; 48 public event MoveObject OnGrapUpdate;
49 49
50
50 public event UpdateShape OnUpdatePrimShape; 51 public event UpdateShape OnUpdatePrimShape;
52 public event ObjectExtraParams OnUpdateExtraParams;
51 public event ObjectSelect OnObjectSelect; 53 public event ObjectSelect OnObjectSelect;
52 public event GenericCall7 OnObjectDescription; 54 public event GenericCall7 OnObjectDescription;
53 public event GenericCall7 OnObjectName; 55 public event GenericCall7 OnObjectName;