aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Primitive.cs
diff options
context:
space:
mode:
authorMW2007-07-13 19:01:09 +0000
committerMW2007-07-13 19:01:09 +0000
commit401af6ad4a16a39e1460abaf30df1a1170069087 (patch)
tree1c40aa36b6f33ce1ff01183dd5c74f584cb358cd /OpenSim/Region/Environment/Scenes/Primitive.cs
parent* Fixed bug reported by xyzo - region assets are now stored in "regionassets.... (diff)
downloadopensim-SC_OLD-401af6ad4a16a39e1460abaf30df1a1170069087.zip
opensim-SC_OLD-401af6ad4a16a39e1460abaf30df1a1170069087.tar.gz
opensim-SC_OLD-401af6ad4a16a39e1460abaf30df1a1170069087.tar.bz2
opensim-SC_OLD-401af6ad4a16a39e1460abaf30df1a1170069087.tar.xz
Prim Copying (both CTRL+D and shift-drag) should now work.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Primitive.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs18
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index ab50373..e20870f 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -163,21 +163,33 @@ namespace OpenSim.Region.Environment.Scenes
163 dupe.inventoryItems = this.inventoryItems; 163 dupe.inventoryItems = this.inventoryItems;
164 dupe.m_Parent = parent; 164 dupe.m_Parent = parent;
165 dupe.m_RootParent = rootParent; 165 dupe.m_RootParent = rootParent;
166 // TODO: Copy this properly. 166
167 dupe.m_Shape = this.m_Shape.Copy(); 167 dupe.m_Shape = this.m_Shape.Copy();
168 dupe.children = new List<EntityBase>(); 168 dupe.children = new List<EntityBase>();
169 uint newLocalID = this.m_world.PrimIDAllocate(); 169 uint newLocalID = this.m_world.PrimIDAllocate();
170 dupe.uuid = LLUUID.Random(); 170 dupe.uuid = LLUUID.Random();
171 dupe.LocalId = newLocalID; 171 dupe.LocalId = newLocalID;
172 dupe.m_regionHandle = this.m_regionHandle;
173
174 if (parent is SceneObject)
175 {
176 dupe.m_isRootPrim = true;
177 dupe.ParentID = 0;
178 }
179 else
180 {
181 dupe.m_isRootPrim = false;
182 dupe.ParentID = ((Primitive)parent).LocalId;
183 }
172 184
173 dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z); 185 dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z);
174 dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z); 186 dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
175 dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z); 187 dupe.m_pos = new LLVector3(this.m_pos.X, this.m_pos.Y, this.m_pos.Z);
176 rootParent.AddChildToList(dupe); 188 rootParent.AddChildToList(dupe);
177 189
178 foreach (Primitive prim in this.children) 190 foreach (Primitive prim in this.children)
179 { 191 {
180 Primitive primClone = prim.Copy(this, rootParent); 192 Primitive primClone = prim.Copy(dupe, rootParent);
181 dupe.children.Add(primClone); 193 dupe.children.Add(primClone);
182 } 194 }
183 195