* 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
0.6.5-rc1
Teravus Ovares 2009-04-09 21:48:11 +00:00
parent 08f83f275d
commit 4050dec682
2 changed files with 12 additions and 11 deletions

View File

@ -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;

View File

@ -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];