A script/custom application should be able to add a particle system to a prim, just create a new libsecondlife.Primitive.ParticleSystem() and then call AddNewParticleSystem() on the OpenSim particle : we really need to rename our particle class to stop conflict with the one in libsl.

afrisby
MW 2007-07-18 21:26:31 +00:00
parent d2b459b8e5
commit 4c8b8d22ff
6 changed files with 29 additions and 18 deletions

View File

@ -182,8 +182,8 @@ namespace OpenSim.Framework.Interfaces
void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity);
void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem);
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation);
void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items);

View File

@ -118,10 +118,8 @@ namespace OpenSim.Framework
public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity){}
public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint){}
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags){}
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags){}
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID){}
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID){}
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem){}
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem){}
public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation){}
public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items){}

View File

@ -719,9 +719,8 @@ namespace OpenSim.Region.ClientStack
this.OutPacket(attach);
}
public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID)
public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem)
{
ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
outPacket.RegionData.RegionHandle = regionHandle;
@ -733,6 +732,7 @@ namespace OpenSim.Region.ClientStack
outPacket.ObjectData[0].OwnerID = ownerID;
outPacket.ObjectData[0].Text = Helpers.StringToField( text );
outPacket.ObjectData[0].ParentID = parentID;
outPacket.ObjectData[0].PSBlock = particleSystem;
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
byte[] rot = rotation.GetBytes();
@ -740,7 +740,7 @@ namespace OpenSim.Region.ClientStack
OutPacket(outPacket);
}
public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID)
public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem)
{
ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
outPacket.RegionData.RegionHandle = regionHandle;
@ -752,6 +752,7 @@ namespace OpenSim.Region.ClientStack
outPacket.ObjectData[0].OwnerID = ownerID;
outPacket.ObjectData[0].Text = Helpers.StringToField( text );
outPacket.ObjectData[0].ParentID = parentID;
outPacket.ObjectData[0].PSBlock = particleSystem;
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);

View File

@ -38,6 +38,7 @@ namespace OpenSim.Region.Environment.Scenes
public uint BaseMask = FULL_MASK_PERMISSIONS;
private PrimitiveBaseShape m_Shape;
private byte[] m_particleSystem = new byte[0];
public SceneObject m_RootParent;
public bool m_isRootPrim;
@ -620,6 +621,12 @@ namespace OpenSim.Region.Environment.Scenes
#endregion
public void AddNewParticleSystem(libsecondlife.Primitive.ParticleSystem pSystem)
{
this.m_particleSystem = pSystem.GetBytes();
ScheduleFullUpdate();
}
#region Client Update Methods
/// <summary>
@ -653,7 +660,7 @@ namespace OpenSim.Region.Environment.Scenes
lRot = new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w);
remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalId, m_Shape, lPos, lRot, m_flags, m_uuid,
OwnerID, m_text, ParentID);
OwnerID, m_text, ParentID, this.m_particleSystem);
}
/// <summary>

View File

@ -19,7 +19,7 @@ namespace SimpleApp
String objectName = "Processor";
String counterName = "% Processor Time";
String instanceName = "_Total";
m_counter = new PerformanceCounter(objectName, counterName, instanceName);
}

View File

@ -132,10 +132,9 @@ namespace SimpleApp
public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity) { }
public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags) { }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags) { }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID) { }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID) { }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem) { }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem) { }
public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) { }
public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items) { }
@ -152,8 +151,10 @@ namespace SimpleApp
{
Encoding enc = Encoding.ASCII;
this.OnAgentUpdate(this, movementFlag, bodyDirection);
if (this.OnAgentUpdate != null)
{
this.OnAgentUpdate(this, movementFlag, bodyDirection);
}
if (this.flyState == 0)
{
movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
@ -172,8 +173,12 @@ namespace SimpleApp
if (count >= 40)
{
this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here, isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId);
if (OnChatFromViewer != null)
{
this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here, isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId);
}
count = -1;
}
count++;