From 4050dec682e44a27451b708bcd07bade764f9aee Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 9 Apr 2009 21:48:11 +0000 Subject: * Changes the timstep of the bullet world * Enables border crossings when using the BulletDotNETPlugin * Enabled variable time steps in BulletDotNETPlugin * Still no 'linked physical objects' yet * Still no script engine integration --- .../Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs | 8 ++++---- .../Physics/BulletDotNETPlugin/BulletDotNETScene.cs | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs index 03646e5..c584cd6 100644 --- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs +++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs @@ -1019,10 +1019,10 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin PhysicsVector vec = new PhysicsVector(tempVector1.getX(),tempVector1.getY(),tempVector1.getZ()); // kluge to keep things in bounds. ODE lets dead avatars drift away (they should be removed!) - if (vec.X < 0.0f) vec.X = 0.0f; - if (vec.Y < 0.0f) vec.Y = 0.0f; - if (vec.X > (int)Constants.RegionSize - 0.2f) vec.X = (int)Constants.RegionSize - 0.2f; - if (vec.Y > (int)Constants.RegionSize - 0.2f) vec.Y = (int)Constants.RegionSize - 0.2f; + if (vec.X < -10.0f) vec.X = 0.0f; + if (vec.Y < -10.0f) vec.Y = 0.0f; + if (vec.X > (int)Constants.RegionSize + 10.2f) vec.X = (int)Constants.RegionSize + 10.2f; + if (vec.Y > (int)Constants.RegionSize + 10.2f) vec.Y = (int)Constants.RegionSize + 10.2f; m_position.X = vec.X; m_position.Y = vec.Y; diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs index 49a16a0..5c2db53 100644 --- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs +++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs @@ -73,8 +73,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin private float avStandupTensor = 2000000f; private float avDensity = 80f; private float avHeightFudgeFactor = 0.52f; - private float avMovementDivisorWalk = 1.0f; - private float avMovementDivisorRun = 0.75f; + private float avMovementDivisorWalk = 1.8f; + private float avMovementDivisorRun = 0.8f; private float minimumGroundFlightOffset = 3f; @@ -99,8 +99,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin private bool usingGImpactAlgorithm = false; private IConfigSource m_config; - private readonly btVector3 worldAabbMin = new btVector3(0, 0, 0); - private readonly btVector3 worldAabbMax = new btVector3(Constants.RegionSize, Constants.RegionSize , 9000); + private readonly btVector3 worldAabbMin = new btVector3(-10f, -10f, 0); + private readonly btVector3 worldAabbMax = new btVector3((int)Constants.RegionSize + 10f, (int)Constants.RegionSize + 10f, 9000); public IMesher mesher; @@ -245,6 +245,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin public override float Simulate(float timeStep) { + lock (m_taintedActors) { foreach (PhysicsActor act in m_taintedActors) @@ -273,7 +274,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin prim.Move(timeStep); } } - float steps = m_world.stepSimulation(WorldTimeStep, 5, WorldTimeComp); + float steps = m_world.stepSimulation(timeStep * 10, 10, WorldTimeComp); foreach (BulletDotNETCharacter chr in m_characters) { @@ -513,8 +514,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin // Is there any reason that we don't do this in ScenePresence? // The only physics engine that benefits from it in the physics plugin is this one - if ((int)x > Constants.RegionSize || (int)y > Constants.RegionSize || - (int)x < 0.001f || (int)y < 0.001f) + if (x > (int)Constants.RegionSize || y > (int)Constants.RegionSize || + x < 0.001f || y < 0.001f) return 0; return _origheightmap[(int)y * Constants.RegionSize + (int)x]; -- cgit v1.1