Пример #1
0
		internal override btPersistentManifold getNewManifold( btCollisionObject body0, btCollisionObject body1 )
		{
			gNumManifold++;

			//Debug.Assert(gNumManifold < 65535);
			//optional relative contact breaking threshold, turned on by default (use setDispatcherFlags to switch off feature for improved performance)
			double contactBreakingThreshold = ( m_dispatcherFlags & DispatcherFlags.CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD ) != 0 ?
				btScalar.btMin( body0.getCollisionShape().getContactBreakingThreshold( btPersistentManifold.gContactBreakingThreshold ), body1.getCollisionShape().getContactBreakingThreshold( btPersistentManifold.gContactBreakingThreshold ) )
				: btPersistentManifold.gContactBreakingThreshold;

			double contactProcessingThreshold = btScalar.btMin( body0.getContactProcessingThreshold(), body1.getContactProcessingThreshold() );

			btPersistentManifold manifold = BulletGlobals.PersistentManifoldPool.Get();
			manifold.Initialize( body0, body1, 0, contactBreakingThreshold, contactProcessingThreshold );
			manifold.m_index1a = m_manifoldsPtr.Count;
			btScalar.Dbg( DbgFlag.Manifolds, "add a manifold (getNewManifold)" );
			m_manifoldsPtr.Add( manifold );

			return manifold;
		}