Sculpted Prims should now work.

afrisby
MW 2007-07-18 20:29:06 +00:00
parent 643a02ec60
commit d2b459b8e5
9 changed files with 54 additions and 3 deletions

View File

@ -53,6 +53,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void GenericCall7(uint localID, string message);
public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
public delegate void ObjectExtraParams(uint localID, ushort type, bool inUse, byte[] data);
public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient);
public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
@ -106,6 +107,7 @@ namespace OpenSim.Framework.Interfaces
event MoveObject OnGrapUpdate;
event UpdateShape OnUpdatePrimShape;
event ObjectExtraParams OnUpdateExtraParams;
event ObjectSelect OnObjectSelect;
event ObjectDeselect OnObjectDeselect;
event GenericCall7 OnObjectDescription;

View File

@ -35,6 +35,7 @@ namespace OpenSim.Framework
public event MoveObject OnGrapUpdate;
public event UpdateShape OnUpdatePrimShape;
public event ObjectExtraParams OnUpdateExtraParams;
public event ObjectSelect OnObjectSelect;
public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName;

View File

@ -42,6 +42,7 @@ namespace OpenSim.Framework.Types
public sbyte PathTwist;
public sbyte PathTwistBegin;
public byte[] TextureEntry; // a LL textureEntry in byte[] format
public byte[] ExtraParams;
public ShapeType PrimType
{
@ -61,7 +62,7 @@ namespace OpenSim.Framework.Types
public PrimitiveBaseShape()
{
ExtraParams = new byte[1];
}
//void returns need to change of course
@ -81,6 +82,7 @@ namespace OpenSim.Framework.Types
public BoxShape()
{
type = ShapeType.Box;
ExtraParams = new byte[1];
}
public static BoxShape Default
@ -111,6 +113,7 @@ namespace OpenSim.Framework.Types
primShape.PathTwistBegin = 0;
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
primShape.TextureEntry = ntex.ToBytes();
primShape.ExtraParams = new byte[1];
return primShape;
}
@ -122,6 +125,7 @@ namespace OpenSim.Framework.Types
public SphereShape()
{
type = ShapeType.Sphere;
ExtraParams = new byte[1];
}
}
}

View File

@ -59,6 +59,7 @@ namespace OpenSim.Region.ClientStack
public event ObjectDuplicate OnObjectDuplicate;
public event MoveObject OnGrapUpdate;
public event AddNewPrim OnAddPrim;
public event ObjectExtraParams OnUpdateExtraParams;
public event UpdateShape OnUpdatePrimShape;
public event ObjectSelect OnObjectSelect;
public event ObjectDeselect OnObjectDeselect;
@ -968,6 +969,7 @@ namespace OpenSim.Region.ClientStack
objectData.PathTaperY = primData.PathTaperY;
objectData.PathTwist = primData.PathTwist;
objectData.PathTwistBegin = primData.PathTwistBegin;
objectData.ExtraParams = primData.ExtraParams;
}
/// <summary>

View File

@ -218,8 +218,6 @@ namespace OpenSim.Region.ClientStack
if (OnAddPrim != null)
{
ObjectAddPacket addPacket = (ObjectAddPacket) Pack ;
Console.WriteLine(addPacket.ToString());
PrimitiveBaseShape shape = new PrimitiveBaseShape();
shape.PCode = addPacket.ObjectData.PCode;
@ -258,6 +256,13 @@ namespace OpenSim.Region.ClientStack
}
}
break;
case PacketType.ObjectExtraParams:
ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack;
if (OnUpdateExtraParams != null)
{
OnUpdateExtraParams(extraPar.ObjectData[0].ObjectLocalID, extraPar.ObjectData[0].ParamType, extraPar.ObjectData[0].ParamInUse, extraPar.ObjectData[0].ParamData);
}
break;
case PacketType.ObjectDuplicate:
ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack;
for (int i = 0; i < dupe.ObjectData.Length; i++)

View File

@ -588,6 +588,24 @@ namespace OpenSim.Region.Environment.Scenes
#endregion
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
{
this.m_Shape.ExtraParams = new byte[data.Length + 7];
int i =0;
uint length = (uint) data.Length;
this.m_Shape.ExtraParams[i++] = 1;
this.m_Shape.ExtraParams[i++] = (byte)(type % 256);
this.m_Shape.ExtraParams[i++] = (byte)((type >> 8) % 256);
this.m_Shape.ExtraParams[i++] = (byte)(length % 256);
this.m_Shape.ExtraParams[i++] = (byte)((length >> 8) % 256);
this.m_Shape.ExtraParams[i++] = (byte)((length >> 16) % 256);
this.m_Shape.ExtraParams[i++] = (byte)((length >> 24) % 256);
Array.Copy(data, 0, this.m_Shape.ExtraParams, i, data.Length);
this.ScheduleFullUpdate();
}
#region Texture
/// <summary>

View File

@ -327,6 +327,22 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void UpdateExtraParam(uint primLocalID, ushort type, bool inUse, byte[] data)
{
Primitive prim = null;
foreach (EntityBase ent in Entities.Values)
{
if (ent is SceneObject)
{
prim = ((SceneObject)ent).HasChildPrim(primLocalID);
if (prim != null)
{
prim.UpdateExtraParam(type, inUse, data);
break;
}
}
}
}
/// <summary>
///
/// </summary>

View File

@ -548,6 +548,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnUpdatePrimGroupMouseRotation += UpdatePrimRotation;
client.OnUpdatePrimSingleRotation += UpdatePrimSingleRotation;
client.OnUpdatePrimScale += UpdatePrimScale;
client.OnUpdateExtraParams += UpdateExtraParam;
client.OnUpdatePrimShape += UpdatePrimShape;
client.OnRequestMapBlocks += RequestMapBlocks;
client.OnUpdatePrimTexture += UpdatePrimTexture;

View File

@ -47,7 +47,9 @@ namespace SimpleApp
public event ObjectSelect OnDeGrapObject;
public event MoveObject OnGrapUpdate;
public event UpdateShape OnUpdatePrimShape;
public event ObjectExtraParams OnUpdateExtraParams;
public event ObjectSelect OnObjectSelect;
public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName;