aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-07-13 16:12:38 +0000
committerMW2007-07-13 16:12:38 +0000
commitfcc7f86427f14f9a43a918f30cdf97b438c49a77 (patch)
treeaad3ff8beb98e63365db9b6982fff14817aad2f6 /OpenSim
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')
-rw-r--r--OpenSim/Framework/General/Types/NetworkServersInfo.cs4
-rw-r--r--OpenSim/Framework/General/Types/PrimitiveBaseShape.cs5
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject.cs22
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs5
6 files changed, 34 insertions, 19 deletions
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs
index 89ebf94..21ff4b9 100644
--- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs
+++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs
@@ -44,8 +44,8 @@ namespace OpenSim.Framework.Types
44 public string UserRecvKey = ""; 44 public string UserRecvKey = "";
45 public bool isSandbox; 45 public bool isSandbox;
46 46
47 public uint DefaultHomeLocX = 0; 47 public uint DefaultHomeLocX = 1000;
48 public uint DefaultHomeLocY = 0; 48 public uint DefaultHomeLocY = 1000;
49 49
50 public int HttpListenerPort = 9000; 50 public int HttpListenerPort = 9000;
51 public int RemotingListenerPort = 8895; 51 public int RemotingListenerPort = 8895;
diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
index 886c00d..1844caa 100644
--- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs
@@ -70,6 +70,11 @@ namespace OpenSim.Framework.Types
70 70
71 } 71 }
72 72
73 public PrimitiveBaseShape Copy()
74 {
75 return (PrimitiveBaseShape) this.MemberwiseClone();
76 }
77
73 public static PrimitiveBaseShape DefaultBox() 78 public static PrimitiveBaseShape DefaultBox()
74 { 79 {
75 PrimitiveBaseShape primShape = new PrimitiveBaseShape(); 80 PrimitiveBaseShape primShape = new PrimitiveBaseShape();
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 67b4d8c..bc9537b 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -233,7 +233,6 @@ namespace OpenSim
233 LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager); 233 LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager);
234 } 234 }
235 235
236
237 LocalWorld.StartTimer(); 236 LocalWorld.StartTimer();
238 } 237 }
239 } 238 }
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}
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 7770538..ce3c056 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -41,6 +41,9 @@ namespace SimpleApp
41 assetServer.SetReceiver(this); 41 assetServer.SetReceiver(this);
42 42
43 AssetCache assetCache = new AssetCache(assetServer); 43 AssetCache assetCache = new AssetCache(assetServer);
44
45 PhysicsManager physManager = new PhysicsManager();
46 physManager.LoadPlugins();
44 47
45 UDPServer udpServer = new UDPServer( internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager ); 48 UDPServer udpServer = new UDPServer( internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager );
46 PacketServer packetServer = new PacketServer(udpServer); 49 PacketServer packetServer = new PacketServer(udpServer);
@@ -55,7 +58,7 @@ namespace SimpleApp
55 RegionInfo regionInfo = new RegionInfo( 1000, 1000, internalEndPoint, "127.0.0.1" ); 58 RegionInfo regionInfo = new RegionInfo( 1000, 1000, internalEndPoint, "127.0.0.1" );
56 59
57 MyWorld world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer); 60 MyWorld world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer);
58 world.PhysScene = PhysicsScene.Null; 61 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null;
59 udpServer.LocalWorld = world; 62 udpServer.LocalWorld = world;
60 63
61 httpServer.Start(); 64 httpServer.Start();