internal override btCollisionAlgorithm CreateCollisionAlgorithm( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
			{
				btConvexPlaneCollisionAlgorithm ca = BulletGlobals.ConvexPlaneAlgorithmPool.Get();
				if( !m_swapped )
					ca.Initialize( null, ci, body0Wrap, body1Wrap, false, m_numPerturbationIterations, m_minimumPointsPerturbationThreshold );
				else
					ca.Initialize( null, ci, body0Wrap, body1Wrap, true, m_numPerturbationIterations, m_minimumPointsPerturbationThreshold );
				return ca;
			}
		//btSphereSphereCollisionAlgorithm( btCollisionAlgorithmConstructionInfo ci )
		//		: btActivatingCollisionAlgorithm( ci) { }

		internal void Initialize( btPersistentManifold mf, btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper col0Wrap, btCollisionObjectWrapper col1Wrap )
		{
			base.Initialize( ci, col0Wrap, col1Wrap );
			m_ownManifold = ( false );
			m_manifoldPtr = ( mf );
			if( m_manifoldPtr == null )
			{
				m_manifoldPtr = m_dispatcher.getNewManifold( col0Wrap.m_collisionObject, col1Wrap.m_collisionObject );
				m_ownManifold = true;
			}
		}
		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObjectWrapper* body0Wrap,btCollisionObjectWrapper* body1Wrap)
		{
			object mem = ci.m_dispatcher1.allocateCollisionAlgorithm(sizeof(btSphereBoxCollisionAlgorithm));
			if (!m_swapped)
			{
				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0Wrap,body1Wrap,false);
			} else
			{
				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0Wrap,body1Wrap,true);
			}
		}
		void Initialize( btPersistentManifold mf, btCollisionAlgorithmConstructionInfo ci
						, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
		{
			base.Initialize( ci, body0Wrap, body1Wrap );
			m_ownManifold = ( false );
			m_manifoldPtr = ( mf );
			if( m_manifoldPtr == null && m_dispatcher.needsCollision( body0Wrap.m_collisionObject, body1Wrap.m_collisionObject ) )
			{
				m_manifoldPtr = m_dispatcher.getNewManifold( body0Wrap.m_collisionObject, body1Wrap.m_collisionObject );
				m_ownManifold = true;
			}
		}
		internal void Initialize( btPersistentManifold mf, btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper col0Wrap, btCollisionObjectWrapper col1Wrap, bool isSwapped, int numPerturbationIterations, int minimumPointsPerturbationThreshold )
		{
			base.Initialize( ci );
			m_ownManifold = ( false );
			m_manifoldPtr = ( mf );
			m_swapped = ( isSwapped );
			m_numPerturbationIterations = ( numPerturbationIterations );
			m_minimumPointsPerturbationThreshold = ( minimumPointsPerturbationThreshold );
			btCollisionObjectWrapper convexObjWrap = m_swapped ? col1Wrap : col0Wrap;
			btCollisionObjectWrapper planeObjWrap = m_swapped ? col0Wrap : col1Wrap;

			if( m_manifoldPtr == null && m_dispatcher.needsCollision( convexObjWrap.m_collisionObject, planeObjWrap.m_collisionObject ) )
			{
				m_manifoldPtr = m_dispatcher.getNewManifold( convexObjWrap.m_collisionObject, planeObjWrap.m_collisionObject );
				m_ownManifold = true;
			}
		}
		new internal void Initialize( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap, bool isSwapped )
		{
			base.Initialize( ci, body0Wrap, body1Wrap, isSwapped );

			m_childCollisionAlgorithmCache = new btHashedSimplePairCache();

			btCollisionObjectWrapper col0ObjWrap = body0Wrap;
			Debug.Assert( col0ObjWrap.getCollisionShape().isCompound() );

			btCollisionObjectWrapper col1ObjWrap = body1Wrap;
			Debug.Assert( col1ObjWrap.getCollisionShape().isCompound() );

			btCompoundShape compoundShape0 = (btCompoundShape)( col0ObjWrap.getCollisionShape() );
			m_compoundShapeRevision0 = compoundShape0.getUpdateRevision();

			btCompoundShape compoundShape1 = (btCompoundShape)( col1ObjWrap.getCollisionShape() );
			m_compoundShapeRevision1 = compoundShape1.getUpdateRevision();


		}
		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObjectWrapper* body0Wrap,btCollisionObjectWrapper* body1Wrap)
		{
			object mem = ci.m_dispatcher1.allocateCollisionAlgorithm(sizeof(btGImpactCollisionAlgorithm));
			return new(mem) btGImpactCollisionAlgorithm(ci,body0Wrap,body1Wrap);
		}
	btGImpactCollisionAlgorithm( btCollisionAlgorithmConstructionInfo& ci,btCollisionObjectWrapper* body0Wrap,btCollisionObjectWrapper* body1Wrap);
		public void Initialize( btPersistentManifold mf, btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap, btSimplexSolverInterface simplexSolver, btConvexPenetrationDepthSolver pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold )
		{
			base.Initialize( ci, body0Wrap, body1Wrap );
			m_simplexSolver = ( simplexSolver );
			m_pdSolver = ( pdSolver );
			m_ownManifold = ( false );
			m_manifoldPtr = ( mf );
			m_lowLevelOfDetail = ( false );
#if USE_SEPDISTANCE_UTIL2
m_sepDistance((static_cast<btConvexShape*>(body0.getCollisionShape())).getAngularMotionDisc(),
			  (static_cast<btConvexShape*>(body1.getCollisionShape())).getAngularMotionDisc()),
#endif
			m_numPerturbationIterations = ( numPerturbationIterations );
			m_minimumPointsPerturbationThreshold = ( minimumPointsPerturbationThreshold );
		}
Example #10
0
			internal override btCollisionAlgorithm CreateCollisionAlgorithm( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
			{
				btConvexConvexAlgorithm ca = BulletGlobals.ConvexConvexAlgorithmPool.Get();
				ca.Initialize( ci.m_manifold, ci, body0Wrap, body1Wrap, m_simplexSolver, m_pdSolver, m_numPerturbationIterations, m_minimumPointsPerturbationThreshold );
				return ca;
			}
			internal override btCollisionAlgorithm CreateCollisionAlgorithm( btCollisionAlgorithmConstructionInfo  ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
			{
				btCompoundCollisionAlgorithm ca = BulletGlobals.CompoundCollisionAlgorithmPool.Get();
				ca.Initialize( ci, body0Wrap, body1Wrap, true );
				return ca;
			}
	btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,btCollisionAlgorithmConstructionInfo& ci,btCollisionObjectWrapper* body0Wrap,btCollisionObjectWrapper* body1Wrap, bool isSwapped);
Example #13
0
		internal abstract btCollisionAlgorithm CreateCollisionAlgorithm( btCollisionAlgorithmConstructionInfo info, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap );
		internal void Initialize( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap, bool isSwapped )
		{
			base.Initialize( ci, body0Wrap, body1Wrap );
			m_isSwapped = ( isSwapped );
			m_btConvexTriangleCallback = BulletGlobals.ConvexTriangleCallbackPool.Get();
			m_btConvexTriangleCallback.Initialize( ci.m_dispatcher1, body0Wrap, body1Wrap, isSwapped );
		}
		/*
		btActivatingCollisionAlgorithm( btCollisionAlgorithmConstructionInfo ci ) :
			base(ci)
		{
		}
		btActivatingCollisionAlgorithm( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
			: base( ci )
		{
			//		m_colObj0 = colObj0;
			//		m_colObj1 = colObj1;
			//		
			//		m_colObj0.activate();
			//		m_colObj1.activate();
		}
		*/

		new internal void Initialize( btCollisionAlgorithmConstructionInfo ci )
		{
			base.Initialize( ci );
		}
		internal void Initialize( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
		{
			base.Initialize( ci );
		}
			internal override btCollisionAlgorithm CreateCollisionAlgorithm( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap )
			{
				btSphereTriangleCollisionAlgorithm ca = BulletGlobals.SphereTriangleCollisionAlgorithmPool.Get();
				ca.Initialize( ci.m_manifold, ci, body0Wrap, body1Wrap, m_swapped );
				return ca;
			}
		internal void Initialize( btCollisionAlgorithmConstructionInfo ci, btCollisionObjectWrapper body0Wrap, btCollisionObjectWrapper body1Wrap, bool isSwapped )
		{
			base.Initialize( ci, body0Wrap, body1Wrap );
			m_isSwapped = ( isSwapped );
			m_sharedManifold = ( ci.m_manifold );
			m_ownsManifold = false;

			btCollisionObjectWrapper colObjWrap = m_isSwapped ? body1Wrap : body0Wrap;
			Debug.Assert( colObjWrap.getCollisionShape().isCompound() );

			btCompoundShape compoundShape = (btCompoundShape)( colObjWrap.getCollisionShape() );
			m_compoundShapeRevision = compoundShape.getUpdateRevision();


			preallocateChildAlgorithms( body0Wrap, body1Wrap );
		}
		new public void Initialize( btCollisionAlgorithmConstructionInfo ci )
		{
			base.Initialize( ci );
		}