Changed simpleApp to use basic physics.

Done some work of fixing primitive/SceneObject copying.
Set DefaultHome region to 1000,1000.
afrisby
MW 2007-07-13 16:12:38 +00:00
parent 6c0779f618
commit fcc7f86427
6 changed files with 34 additions and 19 deletions

View File

@ -44,8 +44,8 @@ namespace OpenSim.Framework.Types
public string UserRecvKey = "";
public bool isSandbox;
public uint DefaultHomeLocX = 0;
public uint DefaultHomeLocY = 0;
public uint DefaultHomeLocX = 1000;
public uint DefaultHomeLocY = 1000;
public int HttpListenerPort = 9000;
public int RemotingListenerPort = 8895;

View File

@ -70,6 +70,11 @@ namespace OpenSim.Framework.Types
}
public PrimitiveBaseShape Copy()
{
return (PrimitiveBaseShape) this.MemberwiseClone();
}
public static PrimitiveBaseShape DefaultBox()
{
PrimitiveBaseShape primShape = new PrimitiveBaseShape();

View File

@ -233,7 +233,6 @@ namespace OpenSim
LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager);
}
LocalWorld.StartTimer();
}
}

View File

@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
this.m_isRootPrim = isRoot;
this.m_RootParent = rootObject;
this.CreateFromPacket(ownerID, localID, pos, shape);
this.CreateFromShape(ownerID, localID, pos, shape);
this.Rotation = Axiom.Math.Quaternion.Identity;
}
@ -164,14 +164,22 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_Parent = parent;
dupe.m_RootParent = rootParent;
// TODO: Copy this properly.
dupe.m_Shape = this.m_Shape;
dupe.m_Shape = this.m_Shape.Copy();
dupe.children = new List<EntityBase>();
uint newLocalID = this.m_world.PrimIDAllocate();
dupe.uuid = LLUUID.Random();
dupe.LocalId = newLocalID;
dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z);
dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z);
rootParent.AddChildToList(dupe);
foreach (Primitive prim in this.children)
{
Primitive primClone = prim.Copy(this, rootParent);
dupe.children.Add(primClone);
}
return dupe;
}
@ -210,7 +218,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="addPacket"></param>
/// <param name="ownerID"></param>
/// <param name="localID"></param>
public void CreateFromPacket(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
public void CreateFromShape(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
{
this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
this.OwnerID = ownerID;

View File

@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Scenes
private bool physicsEnabled = false;
private PhysicsScene m_PhysScene;
private PhysicsActor m_PhysActor;
public LLUUID rootUUID
{
get
@ -73,7 +73,7 @@ namespace OpenSim.Region.Environment.Scenes
m_regionHandle = regionHandle;
m_world = world;
this.Pos = pos;
this.CreateRootFromPacket(ownerID, localID, shape, pos );
this.CreateRootFromShape(ownerID, localID, shape, pos);
}
/// <summary>
@ -91,11 +91,11 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="addPacket"></param>
/// <param name="agentID"></param>
/// <param name="localID"></param>
public void CreateRootFromPacket(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
{
this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos);
this.children.Add(rootPrimitive);
this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos);
this.children.Add(rootPrimitive);
this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
}
/// <summary>
@ -207,7 +207,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
{
this.rootPrimitive.Pos = pos ;
this.rootPrimitive.Pos = pos;
this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient);
}
@ -232,16 +232,16 @@ namespace OpenSim.Region.Environment.Scenes
proper.ObjectData[0].OwnerID = this.rootPrimitive.OwnerID;
proper.ObjectData[0].TouchName = enc.GetBytes(this.rootPrimitive.TouchName + "\0");
proper.ObjectData[0].TextureID = new byte[0];
proper.ObjectData[0].SitName = enc.GetBytes(this.rootPrimitive.SitName +"\0") ;
proper.ObjectData[0].Name = enc.GetBytes(this.rootPrimitive.Name +"\0");
proper.ObjectData[0].Description = enc.GetBytes(this.rootPrimitive.Description +"\0");
proper.ObjectData[0].SitName = enc.GetBytes(this.rootPrimitive.SitName + "\0");
proper.ObjectData[0].Name = enc.GetBytes(this.rootPrimitive.Name + "\0");
proper.ObjectData[0].Description = enc.GetBytes(this.rootPrimitive.Description + "\0");
proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask;
proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask;
proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask;
proper.ObjectData[0].EveryoneMask = this.rootPrimitive.EveryoneMask;
proper.ObjectData[0].BaseMask = this.rootPrimitive.BaseMask;
client.OutPacket(proper);
client.OutPacket(proper);
}
}
}

View File

@ -41,6 +41,9 @@ namespace SimpleApp
assetServer.SetReceiver(this);
AssetCache assetCache = new AssetCache(assetServer);
PhysicsManager physManager = new PhysicsManager();
physManager.LoadPlugins();
UDPServer udpServer = new UDPServer( internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager );
PacketServer packetServer = new PacketServer(udpServer);
@ -55,7 +58,7 @@ namespace SimpleApp
RegionInfo regionInfo = new RegionInfo( 1000, 1000, internalEndPoint, "127.0.0.1" );
MyWorld world = new MyWorld(packetServer.ClientManager, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer);
world.PhysScene = PhysicsScene.Null;
world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null;
udpServer.LocalWorld = world;
httpServer.Start();