diff --git a/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build b/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build index a0541433fd..e119279dcb 100644 --- a/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build +++ b/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenGridServices.ServerConsole/OpenGridServices.ServerConsole.dll.build b/OpenGridServices.ServerConsole/OpenGridServices.ServerConsole.dll.build index 270f92525c..2e6ec3e559 100644 --- a/OpenGridServices.ServerConsole/OpenGridServices.ServerConsole.dll.build +++ b/OpenGridServices.ServerConsole/OpenGridServices.ServerConsole.dll.build @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build index f4e58d94e6..710b01b939 100644 --- a/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build +++ b/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Config/SimConfigDb4o/OpenSim.Config.SimConfigDb4o.dll.build b/OpenSim.Config/SimConfigDb4o/OpenSim.Config.SimConfigDb4o.dll.build index 3dfa7ceb18..703abe6c72 100644 --- a/OpenSim.Config/SimConfigDb4o/OpenSim.Config.SimConfigDb4o.dll.build +++ b/OpenSim.Config/SimConfigDb4o/OpenSim.Config.SimConfigDb4o.dll.build @@ -1,47 +1,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build b/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build index 9ceaea6277..2dfc9b0004 100644 --- a/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build +++ b/OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build @@ -1,41 +1,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Framework/OpenSim.Framework.dll.build b/OpenSim.Framework/OpenSim.Framework.dll.build index 79bbf05be0..a5ec58cb37 100644 --- a/OpenSim.Framework/OpenSim.Framework.dll.build +++ b/OpenSim.Framework/OpenSim.Framework.dll.build @@ -1,63 +1,63 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build b/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build index ec65ba8c71..e3b33cbeec 100644 --- a/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build +++ b/OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build b/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build index 206045444e..01bf0df0f4 100644 --- a/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build +++ b/OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build b/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build index f14673337a..4217a06281 100644 --- a/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build +++ b/OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build b/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build index 47e55347cc..4aaca6ad28 100644 --- a/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build +++ b/OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/OdePlugin/OdePlugin.cs b/OpenSim.Physics/OdePlugin/OdePlugin.cs index 352084c5bd..01eaf7704a 100644 --- a/OpenSim.Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim.Physics/OdePlugin/OdePlugin.cs @@ -70,31 +70,54 @@ namespace OpenSim.Physics.OdePlugin public class OdeScene :PhysicsScene { - public IntPtr world; - public IntPtr space; - private IntPtr contactgroup; + static public IntPtr world; + static public IntPtr space; + static private IntPtr contactgroup; + static private IntPtr LandGeom; + static private IntPtr Land; private double[] _heightmap; + static private d.NearCallback nearCallback = near; + private List _characters = new List(); + private static d.ContactGeom[] contacts = new d.ContactGeom[500]; + private static d.Contact contact; - public OdeScene() - { + public OdeScene() { world = d.WorldCreate(); space = d.HashSpaceCreate(IntPtr.Zero); contactgroup = d.JointGroupCreate(0); d.WorldSetGravity(world, 0.0f, 0.0f, -0.5f); d.WorldSetCFM(world, 1e-5f); - d.WorldSetAutoDisableFlag(world, true); - d.WorldSetContactMaxCorrectingVel(world, 0.1f); - d.WorldSetContactSurfaceLayer(world, 0.001f); + d.WorldSetAutoDisableFlag(world, false); this._heightmap=new double[65536]; } + // This function blatantly ripped off from BoxStack.cs + static private void near(IntPtr space, IntPtr g1, IntPtr g2) + { + IntPtr b1 = d.GeomGetBody(g1); + IntPtr b2 = d.GeomGetBody(g2); + if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) + return; + + int count = d.Collide(g1, g2, 500, contacts, d.ContactGeom.SizeOf); + for (int i = 0; i < count; ++i) + { + contact.geom = contacts[i]; + IntPtr joint = d.JointCreateContact(world, contactgroup, ref contact); + d.JointAttach(joint, b1, b2); + } + + } + public override PhysicsActor AddAvatar(PhysicsVector position) { PhysicsVector pos = new PhysicsVector(); pos.X = position.X; pos.Y = position.Y; pos.Z = position.Z; - return new OdeCharacter(this,pos); + OdeCharacter newAv= new OdeCharacter(this,pos); + this._characters.Add(newAv); + return newAv; } public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) @@ -112,7 +135,16 @@ namespace OpenSim.Physics.OdePlugin public override void Simulate(float timeStep) { - + foreach (OdeCharacter actor in _characters) { + actor.Move(timeStep*5f); + } + d.SpaceCollide(space, IntPtr.Zero, nearCallback); + d.WorldQuickStep(world, timeStep*5f); + foreach (OdeCharacter actor in _characters) + { + actor.UpdatePosition(); + } + } public override void GetResults() @@ -135,7 +167,8 @@ namespace OpenSim.Physics.OdePlugin } IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); d.GeomHeightfieldDataBuildDouble(HeightmapData,_heightmap,1,256,256,256,256,1.0f,0.0f,2.0f,0); - d.CreateHeightfield(space, HeightmapData, 0); + LandGeom=d.CreateHeightfield(space, HeightmapData, 1); + d.GeomSetPosition(LandGeom,0,0,0); } } @@ -156,7 +189,10 @@ namespace OpenSim.Physics.OdePlugin _position = pos; _acceleration = new PhysicsVector(); d.MassSetCapsule(out capsule_mass, 5.0f, 3, 0.5f, 2f); - capsule_geom = d.CreateCapsule(parent_scene.space, 0.5f, 2f); + capsule_geom = d.CreateCapsule(OdeScene.space, 0.5f, 2f); + this.BoundingCapsule=d.BodyCreate(OdeScene.world); + d.BodySetMass(BoundingCapsule, ref capsule_mass); + d.BodySetPosition(BoundingCapsule,pos.X,pos.Y,pos.Z); } public override bool Flying @@ -249,12 +285,7 @@ namespace OpenSim.Physics.OdePlugin vec.Y = this._velocity.Y * timeStep; if(flying) { - vec.Z = ( this._velocity.Z) * timeStep; - } - else - { - gravityAccel+= -9.8f; - vec.Z = (gravityAccel + this._velocity.Z) * timeStep; + vec.Z = ( this._velocity.Z+0.5f) * timeStep; } d.BodySetLinearVel(this.BoundingCapsule, vec.X, vec.Y, vec.Z); } @@ -265,7 +296,6 @@ namespace OpenSim.Physics.OdePlugin this._position.X = vec.X; this._position.Y = vec.Y; this._position.Z = vec.Z; - } } @@ -297,7 +327,7 @@ namespace OpenSim.Physics.OdePlugin get { PhysicsVector pos = new PhysicsVector(); - //PhysicsVector vec = this._prim.Position; + // PhysicsVector vec = this._prim.Position; //pos.X = vec.X; //pos.Y = vec.Y; //pos.Z = vec.Z; diff --git a/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build b/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build index c67d8205cb..e738ab1090 100644 --- a/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build +++ b/OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build b/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build index 8f9e7dc80f..395cc6b1e9 100644 --- a/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build +++ b/OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build index 66d55fb8ab..dced3ae0c7 100644 --- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build +++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build @@ -1,69 +1,69 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build b/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build index 44e8597715..ebcda17842 100644 --- a/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build +++ b/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim.build b/OpenSim.build index 972331bed3..a15f8da450 100644 --- a/OpenSim.build +++ b/OpenSim.build @@ -1,109 +1,109 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSim/OpenSim.exe.build b/OpenSim/OpenSim.exe.build index 7d69d90e1e..fc516df66f 100644 --- a/OpenSim/OpenSim.exe.build +++ b/OpenSim/OpenSim.exe.build @@ -1,47 +1,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prebuild/Prebuild.build b/Prebuild/Prebuild.build index 395fb31e54..743b8263b6 100644 --- a/Prebuild/Prebuild.build +++ b/Prebuild/Prebuild.build @@ -1,67 +1,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prebuild/src/Prebuild.exe.build b/Prebuild/src/Prebuild.exe.build index 43f5516127..628e7e160d 100644 --- a/Prebuild/src/Prebuild.exe.build +++ b/Prebuild/src/Prebuild.exe.build @@ -1,80 +1,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +