aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMW2007-07-18 21:26:31 +0000
committerMW2007-07-18 21:26:31 +0000
commit4c8b8d22ff66605b11a4881cdb7004cb4ce49592 (patch)
tree6ba59b1027c989614e542b957ebcaeaa8fec0654 /OpenSim/Region
parentSculpted Prims should now work. (diff)
downloadopensim-SC_OLD-4c8b8d22ff66605b11a4881cdb7004cb4ce49592.zip
opensim-SC_OLD-4c8b8d22ff66605b11a4881cdb7004cb4ce49592.tar.gz
opensim-SC_OLD-4c8b8d22ff66605b11a4881cdb7004cb4ce49592.tar.bz2
opensim-SC_OLD-4c8b8d22ff66605b11a4881cdb7004cb4ce49592.tar.xz
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.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs9
-rw-r--r--OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs19
4 files changed, 25 insertions, 12 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 440f583..73b3887 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -719,9 +719,8 @@ namespace OpenSim.Region.ClientStack
719 719
720 this.OutPacket(attach); 720 this.OutPacket(attach);
721 } 721 }
722
723 722
724 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) 723 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)
725 { 724 {
726 ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); 725 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
727 outPacket.RegionData.RegionHandle = regionHandle; 726 outPacket.RegionData.RegionHandle = regionHandle;
@@ -733,6 +732,7 @@ namespace OpenSim.Region.ClientStack
733 outPacket.ObjectData[0].OwnerID = ownerID; 732 outPacket.ObjectData[0].OwnerID = ownerID;
734 outPacket.ObjectData[0].Text = Helpers.StringToField( text ); 733 outPacket.ObjectData[0].Text = Helpers.StringToField( text );
735 outPacket.ObjectData[0].ParentID = parentID; 734 outPacket.ObjectData[0].ParentID = parentID;
735 outPacket.ObjectData[0].PSBlock = particleSystem;
736 byte[] pb = pos.GetBytes(); 736 byte[] pb = pos.GetBytes();
737 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 737 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
738 byte[] rot = rotation.GetBytes(); 738 byte[] rot = rotation.GetBytes();
@@ -740,7 +740,7 @@ namespace OpenSim.Region.ClientStack
740 OutPacket(outPacket); 740 OutPacket(outPacket);
741 } 741 }
742 742
743 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID) 743 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)
744 { 744 {
745 ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); 745 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
746 outPacket.RegionData.RegionHandle = regionHandle; 746 outPacket.RegionData.RegionHandle = regionHandle;
@@ -752,6 +752,7 @@ namespace OpenSim.Region.ClientStack
752 outPacket.ObjectData[0].OwnerID = ownerID; 752 outPacket.ObjectData[0].OwnerID = ownerID;
753 outPacket.ObjectData[0].Text = Helpers.StringToField( text ); 753 outPacket.ObjectData[0].Text = Helpers.StringToField( text );
754 outPacket.ObjectData[0].ParentID = parentID; 754 outPacket.ObjectData[0].ParentID = parentID;
755 outPacket.ObjectData[0].PSBlock = particleSystem;
755 byte[] pb = pos.GetBytes(); 756 byte[] pb = pos.GetBytes();
756 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 757 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
757 758
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index bca8e0c..7484393 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -38,6 +38,7 @@ namespace OpenSim.Region.Environment.Scenes
38 public uint BaseMask = FULL_MASK_PERMISSIONS; 38 public uint BaseMask = FULL_MASK_PERMISSIONS;
39 39
40 private PrimitiveBaseShape m_Shape; 40 private PrimitiveBaseShape m_Shape;
41 private byte[] m_particleSystem = new byte[0];
41 42
42 public SceneObject m_RootParent; 43 public SceneObject m_RootParent;
43 public bool m_isRootPrim; 44 public bool m_isRootPrim;
@@ -620,6 +621,12 @@ namespace OpenSim.Region.Environment.Scenes
620 621
621 #endregion 622 #endregion
622 623
624 public void AddNewParticleSystem(libsecondlife.Primitive.ParticleSystem pSystem)
625 {
626 this.m_particleSystem = pSystem.GetBytes();
627 ScheduleFullUpdate();
628 }
629
623 #region Client Update Methods 630 #region Client Update Methods
624 631
625 /// <summary> 632 /// <summary>
@@ -653,7 +660,7 @@ namespace OpenSim.Region.Environment.Scenes
653 lRot = new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w); 660 lRot = new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w);
654 661
655 remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalId, m_Shape, lPos, lRot, m_flags, m_uuid, 662 remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalId, m_Shape, lPos, lRot, m_flags, m_uuid,
656 OwnerID, m_text, ParentID); 663 OwnerID, m_text, ParentID, this.m_particleSystem);
657 } 664 }
658 665
659 /// <summary> 666 /// <summary>
diff --git a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
index 26ecf01..e6505b4 100644
--- a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
@@ -19,7 +19,7 @@ namespace SimpleApp
19 String objectName = "Processor"; 19 String objectName = "Processor";
20 String counterName = "% Processor Time"; 20 String counterName = "% Processor Time";
21 String instanceName = "_Total"; 21 String instanceName = "_Total";
22 22
23 m_counter = new PerformanceCounter(objectName, counterName, instanceName); 23 m_counter = new PerformanceCounter(objectName, counterName, instanceName);
24 } 24 }
25 25
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 308dea7..8274912 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -132,10 +132,9 @@ namespace SimpleApp
132 public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity) { } 132 public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity) { }
133 133
134 public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { } 134 public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { }
135 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags) { } 135
136 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags) { } 136 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) { }
137 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) { } 137 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) { }
138 public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID) { }
139 public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) { } 138 public virtual void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) { }
140 139
141 public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items) { } 140 public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items) { }
@@ -152,8 +151,10 @@ namespace SimpleApp
152 { 151 {
153 Encoding enc = Encoding.ASCII; 152 Encoding enc = Encoding.ASCII;
154 153
155 this.OnAgentUpdate(this, movementFlag, bodyDirection); 154 if (this.OnAgentUpdate != null)
156 155 {
156 this.OnAgentUpdate(this, movementFlag, bodyDirection);
157 }
157 if (this.flyState == 0) 158 if (this.flyState == 0)
158 { 159 {
159 movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG; 160 movementFlag = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
@@ -172,8 +173,12 @@ namespace SimpleApp
172 173
173 if (count >= 40) 174 if (count >= 40)
174 { 175 {
175 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); 176 if (OnChatFromViewer != null)
177 {
178 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);
179 }
176 count = -1; 180 count = -1;
181
177 } 182 }
178 183
179 count++; 184 count++;