aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs27
1 files changed, 14 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs
index 93643c9..ba96905 100644
--- a/OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSNPlugin/BulletSimAPI.cs
@@ -894,7 +894,7 @@ static class BulletSimAPI {
894 return capsuleShapeZ; 894 return capsuleShapeZ;
895 } 895 }
896 896
897 public static object Initialize2(Vector3 worldExtent, ConfigurationParameters[] o, int mMaxCollisionsPerFrame, ref List<BulletXNA.CollisionDesc> collisionArray, int mMaxUpdatesPerFrame, ref List<BulletXNA.EntityProperties> updateArray, object mDebugLogCallbackHandle) 897 public static object Initialize2(Vector3 worldExtent, ConfigurationParameters[] o, int mMaxCollisionsPerFrame, ref BulletXNA.CollisionDesc[] collisionArray, int mMaxUpdatesPerFrame, ref BulletXNA.EntityProperties[] updateArray, object mDebugLogCallbackHandle)
898 { 898 {
899 CollisionWorld.WorldData.ParamData p = new CollisionWorld.WorldData.ParamData(); 899 CollisionWorld.WorldData.ParamData p = new CollisionWorld.WorldData.ParamData();
900 900
@@ -1436,14 +1436,14 @@ static class BulletSimAPI {
1436 1436
1437 } 1437 }
1438 1438
1439 internal static int PhysicsStep2(object pWorld, float timeStep, int m_maxSubSteps, float m_fixedTimeStep, out int updatedEntityCount, out List<BulletXNA.EntityProperties> updatedEntities, out int collidersCount, out List<BulletXNA.CollisionDesc>colliders) 1439 internal static int PhysicsStep2(object pWorld, float timeStep, int m_maxSubSteps, float m_fixedTimeStep, out int updatedEntityCount, out BulletXNA.EntityProperties[] updatedEntities, out int collidersCount, out BulletXNA.CollisionDesc[] colliders)
1440 { 1440 {
1441 int epic = PhysicsStepint2(pWorld, timeStep, m_maxSubSteps, m_fixedTimeStep, out updatedEntityCount, out updatedEntities, 1441 int epic = PhysicsStepint2(pWorld, timeStep, m_maxSubSteps, m_fixedTimeStep, out updatedEntityCount, out updatedEntities,
1442 out collidersCount, out colliders); 1442 out collidersCount, out colliders);
1443 return epic; 1443 return epic;
1444 } 1444 }
1445 1445
1446 private static int PhysicsStepint2(object pWorld,float timeStep, int m_maxSubSteps, float m_fixedTimeStep, out int updatedEntityCount, out List<BulletXNA.EntityProperties> updatedEntities, out int collidersCount, out List<BulletXNA.CollisionDesc> colliders) 1446 private static int PhysicsStepint2(object pWorld,float timeStep, int m_maxSubSteps, float m_fixedTimeStep, out int updatedEntityCount, out BulletXNA.EntityProperties[] updatedEntities, out int collidersCount, out BulletXNA.CollisionDesc[] colliders)
1447 { 1447 {
1448 int numSimSteps = 0; 1448 int numSimSteps = 0;
1449 1449
@@ -1462,16 +1462,16 @@ static class BulletSimAPI {
1462 numSimSteps = world.StepSimulation(timeStep, m_maxSubSteps, m_fixedTimeStep); 1462 numSimSteps = world.StepSimulation(timeStep, m_maxSubSteps, m_fixedTimeStep);
1463 int updates = 0; 1463 int updates = 0;
1464 1464
1465 updatedEntityCount = world.UpdatedObjects.Count; 1465 updatedEntityCount = world.UpdatedObjects.Length;
1466 updatedEntities = new List<BulletXNA.EntityProperties>(world.UpdatedObjects); 1466 updatedEntities = (world.UpdatedObjects);
1467 updatedEntityCount = updatedEntities.Count; 1467 updatedEntityCount = updatedEntities.Length;
1468 world.UpdatedObjects.Clear(); 1468 //world.UpdatedObjects = ;
1469 1469
1470 1470
1471 collidersCount = world.UpdatedCollisions.Count; 1471 collidersCount = world.UpdatedCollisions.Length;
1472 colliders = new List<BulletXNA.CollisionDesc>(world.UpdatedCollisions); 1472 colliders = (world.UpdatedCollisions);
1473 1473
1474 world.UpdatedCollisions.Clear(); 1474 world.UpdatedCollisions = new BulletXNA.CollisionDesc[0];
1475 m_collisionsThisFrame = 0; 1475 m_collisionsThisFrame = 0;
1476 int numManifolds = world.GetDispatcher().GetNumManifolds(); 1476 int numManifolds = world.GetDispatcher().GetNumManifolds();
1477 for (int j = 0; j < numManifolds; j++) 1477 for (int j = 0; j < numManifolds; j++)
@@ -1501,10 +1501,10 @@ static class BulletSimAPI {
1501 else 1501 else
1502 { 1502 {
1503 //if (updatedEntities is null) 1503 //if (updatedEntities is null)
1504 updatedEntities = new List<BulletXNA.EntityProperties>(); 1504 updatedEntities = new BulletXNA.EntityProperties[0];
1505 updatedEntityCount = 0; 1505 updatedEntityCount = 0;
1506 //if (colliders is null) 1506 //if (colliders is null)
1507 colliders = new List<BulletXNA.CollisionDesc>(); 1507 colliders = new BulletXNA.CollisionDesc[0];
1508 collidersCount = 0; 1508 collidersCount = 0;
1509 } 1509 }
1510 return numSimSteps; 1510 return numSimSteps;
@@ -1538,7 +1538,8 @@ static class BulletSimAPI {
1538 point = contact, 1538 point = contact,
1539 normal = contactNormal 1539 normal = contactNormal
1540 }; 1540 };
1541 world.UpdatedCollisions.Add(cDesc); 1541 if (world.LastCollisionDesc < world.UpdatedCollisions.Length)
1542 world.UpdatedCollisions[world.LastCollisionDesc++] = (cDesc);
1542 m_collisionsThisFrame++; 1543 m_collisionsThisFrame++;
1543 1544
1544 1545