diff options
author | Robert Adams | 2013-01-01 20:26:31 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-04 17:06:48 -0800 |
commit | 2eda385f5e72e165150d0925c56b1188c77cafe8 (patch) | |
tree | 1708456178efde631dc397874880aa0d7d2bfb16 /OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | |
parent | minor: Rename BUILDING.txt to BUILDING.md in distbin distribution nant target (diff) | |
download | opensim-SC_OLD-2eda385f5e72e165150d0925c56b1188c77cafe8.zip opensim-SC_OLD-2eda385f5e72e165150d0925c56b1188c77cafe8.tar.gz opensim-SC_OLD-2eda385f5e72e165150d0925c56b1188c77cafe8.tar.bz2 opensim-SC_OLD-2eda385f5e72e165150d0925c56b1188c77cafe8.tar.xz |
BulletSim: add ResetBroadphasePool and ResetConstraintSolver diagnostic
functions. If values set from console, the functions are called. Looking
for why the collision pools fill up with unnecessary stuff.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs index 8c6e7d6..45ecf56 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | |||
@@ -530,12 +530,12 @@ public override void SetForceUpdateAllAabbs(BulletWorld world, bool force) | |||
530 | // btDynamicsWorld entries | 530 | // btDynamicsWorld entries |
531 | public override bool AddObjectToWorld(BulletWorld world, BulletBody obj) | 531 | public override bool AddObjectToWorld(BulletWorld world, BulletBody obj) |
532 | { | 532 | { |
533 | // Bullet resets several variables when an object is added to the world. | ||
534 | // Gravity is reset to world default depending on the static/dynamic | ||
535 | // type. Of course, the collision flags in the broadphase proxy are initialized to default. | ||
536 | BulletWorldUnman worldu = world as BulletWorldUnman; | 533 | BulletWorldUnman worldu = world as BulletWorldUnman; |
537 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 534 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
538 | 535 | ||
536 | // Bullet resets several variables when an object is added to the world. | ||
537 | // Gravity is reset to world default depending on the static/dynamic | ||
538 | // type. Of course, the collision flags in the broadphase proxy are initialized to default. | ||
539 | Vector3 origGrav = BSAPICPP.GetGravity2(bodyu.ptr); | 539 | Vector3 origGrav = BSAPICPP.GetGravity2(bodyu.ptr); |
540 | 540 | ||
541 | bool ret = BSAPICPP.AddObjectToWorld2(worldu.ptr, bodyu.ptr); | 541 | bool ret = BSAPICPP.AddObjectToWorld2(worldu.ptr, bodyu.ptr); |
@@ -1259,6 +1259,16 @@ public override void DumpPhysicsStatistics(BulletWorld world) | |||
1259 | BulletWorldUnman worldu = world as BulletWorldUnman; | 1259 | BulletWorldUnman worldu = world as BulletWorldUnman; |
1260 | BSAPICPP.DumpPhysicsStatistics2(worldu.ptr); | 1260 | BSAPICPP.DumpPhysicsStatistics2(worldu.ptr); |
1261 | } | 1261 | } |
1262 | public override void ResetBroadphasePool(BulletWorld world) | ||
1263 | { | ||
1264 | BulletWorldUnman worldu = world as BulletWorldUnman; | ||
1265 | BSAPICPP.ResetBroadphasePool(worldu.ptr); | ||
1266 | } | ||
1267 | public override void ResetConstraintSolver(BulletWorld world) | ||
1268 | { | ||
1269 | BulletWorldUnman worldu = world as BulletWorldUnman; | ||
1270 | BSAPICPP.ResetConstraintSolver(worldu.ptr); | ||
1271 | } | ||
1262 | 1272 | ||
1263 | // ===================================================================================== | 1273 | // ===================================================================================== |
1264 | // ===================================================================================== | 1274 | // ===================================================================================== |
@@ -1832,6 +1842,12 @@ public static extern void DumpAllInfo2(IntPtr sim); | |||
1832 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1842 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1833 | public static extern void DumpPhysicsStatistics2(IntPtr sim); | 1843 | public static extern void DumpPhysicsStatistics2(IntPtr sim); |
1834 | 1844 | ||
1845 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1846 | public static extern void ResetBroadphasePool(IntPtr sim); | ||
1847 | |||
1848 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1849 | public static extern void ResetConstraintSolver(IntPtr sim); | ||
1850 | |||
1835 | } | 1851 | } |
1836 | 1852 | ||
1837 | } | 1853 | } |