aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMW2007-07-13 16:12:38 +0000
committerMW2007-07-13 16:12:38 +0000
commitfcc7f86427f14f9a43a918f30cdf97b438c49a77 (patch)
treeaad3ff8beb98e63365db9b6982fff14817aad2f6 /OpenSim/Region/Environment
parentrename file to not have spaces in it (diff)
downloadopensim-SC-fcc7f86427f14f9a43a918f30cdf97b438c49a77.zip
opensim-SC-fcc7f86427f14f9a43a918f30cdf97b438c49a77.tar.gz
opensim-SC-fcc7f86427f14f9a43a918f30cdf97b438c49a77.tar.bz2
opensim-SC-fcc7f86427f14f9a43a918f30cdf97b438c49a77.tar.xz
Changed simpleApp to use basic physics.
Done some work of fixing primitive/SceneObject copying. Set DefaultHome region to 1000,1000.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject.cs22
2 files changed, 23 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index 4bb43d2..53314e3 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
139 this.m_isRootPrim = isRoot; 139 this.m_isRootPrim = isRoot;
140 this.m_RootParent = rootObject; 140 this.m_RootParent = rootObject;
141 141
142 this.CreateFromPacket(ownerID, localID, pos, shape); 142 this.CreateFromShape(ownerID, localID, pos, shape);
143 this.Rotation = Axiom.Math.Quaternion.Identity; 143 this.Rotation = Axiom.Math.Quaternion.Identity;
144 } 144 }
145 145
@@ -164,14 +164,22 @@ namespace OpenSim.Region.Environment.Scenes
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 // TODO: Copy this properly.
167 dupe.m_Shape = this.m_Shape; 167 dupe.m_Shape = this.m_Shape.Copy();
168 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.LocalId = newLocalID; 171 dupe.LocalId = newLocalID;
171 172
172 dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z); 173 dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z);
173 dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z); 174 dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
174 dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z); 175 dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z);
176 rootParent.AddChildToList(dupe);
177
178 foreach (Primitive prim in this.children)
179 {
180 Primitive primClone = prim.Copy(this, rootParent);
181 dupe.children.Add(primClone);
182 }
175 183
176 return dupe; 184 return dupe;
177 } 185 }
@@ -210,7 +218,7 @@ namespace OpenSim.Region.Environment.Scenes
210 /// <param name="addPacket"></param> 218 /// <param name="addPacket"></param>
211 /// <param name="ownerID"></param> 219 /// <param name="ownerID"></param>
212 /// <param name="localID"></param> 220 /// <param name="localID"></param>
213 public void CreateFromPacket(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) 221 public void CreateFromShape(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
214 { 222 {
215 this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 223 this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
216 this.OwnerID = ownerID; 224 this.OwnerID = ownerID;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs
index 5eed115..c586e9b 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObject.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Scenes
46 private bool physicsEnabled = false; 46 private bool physicsEnabled = false;
47 private PhysicsScene m_PhysScene; 47 private PhysicsScene m_PhysScene;
48 private PhysicsActor m_PhysActor; 48 private PhysicsActor m_PhysActor;
49 49
50 public LLUUID rootUUID 50 public LLUUID rootUUID
51 { 51 {
52 get 52 get
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Environment.Scenes
73 m_regionHandle = regionHandle; 73 m_regionHandle = regionHandle;
74 m_world = world; 74 m_world = world;
75 this.Pos = pos; 75 this.Pos = pos;
76 this.CreateRootFromPacket(ownerID, localID, shape, pos ); 76 this.CreateRootFromShape(ownerID, localID, shape, pos);
77 } 77 }
78 78
79 /// <summary> 79 /// <summary>
@@ -91,11 +91,11 @@ namespace OpenSim.Region.Environment.Scenes
91 /// <param name="addPacket"></param> 91 /// <param name="addPacket"></param>
92 /// <param name="agentID"></param> 92 /// <param name="agentID"></param>
93 /// <param name="localID"></param> 93 /// <param name="localID"></param>
94 public void CreateRootFromPacket(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos) 94 public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
95 { 95 {
96 this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos); 96 this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos);
97 this.children.Add(rootPrimitive); 97 this.children.Add(rootPrimitive);
98 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive); 98 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
@@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
207 /// <param name="remoteClient"></param> 207 /// <param name="remoteClient"></param>
208 public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 208 public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
209 { 209 {
210 this.rootPrimitive.Pos = pos ; 210 this.rootPrimitive.Pos = pos;
211 this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient); 211 this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient);
212 } 212 }
213 213
@@ -232,16 +232,16 @@ namespace OpenSim.Region.Environment.Scenes
232 proper.ObjectData[0].OwnerID = this.rootPrimitive.OwnerID; 232 proper.ObjectData[0].OwnerID = this.rootPrimitive.OwnerID;
233 proper.ObjectData[0].TouchName = enc.GetBytes(this.rootPrimitive.TouchName + "\0"); 233 proper.ObjectData[0].TouchName = enc.GetBytes(this.rootPrimitive.TouchName + "\0");
234 proper.ObjectData[0].TextureID = new byte[0]; 234 proper.ObjectData[0].TextureID = new byte[0];
235 proper.ObjectData[0].SitName = enc.GetBytes(this.rootPrimitive.SitName +"\0") ; 235 proper.ObjectData[0].SitName = enc.GetBytes(this.rootPrimitive.SitName + "\0");
236 proper.ObjectData[0].Name = enc.GetBytes(this.rootPrimitive.Name +"\0"); 236 proper.ObjectData[0].Name = enc.GetBytes(this.rootPrimitive.Name + "\0");
237 proper.ObjectData[0].Description = enc.GetBytes(this.rootPrimitive.Description +"\0"); 237 proper.ObjectData[0].Description = enc.GetBytes(this.rootPrimitive.Description + "\0");
238 proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask; 238 proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask;
239 proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask; 239 proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask;
240 proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask; 240 proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask;
241 proper.ObjectData[0].EveryoneMask = this.rootPrimitive.EveryoneMask; 241 proper.ObjectData[0].EveryoneMask = this.rootPrimitive.EveryoneMask;
242 proper.ObjectData[0].BaseMask = this.rootPrimitive.BaseMask; 242 proper.ObjectData[0].BaseMask = this.rootPrimitive.BaseMask;
243 243
244 client.OutPacket(proper); 244 client.OutPacket(proper);
245 } 245 }
246 } 246 }
247} 247}