当前位置: 首页>>代码示例>>C#>>正文


C# ObjectArray.Sort方法代码示例

本文整理汇总了C#中ObjectArray.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectArray.Sort方法的具体用法?C# ObjectArray.Sort怎么用?C# ObjectArray.Sort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectArray的用法示例。


在下文中一共展示了ObjectArray.Sort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SortOverlappingPairs

        public virtual void SortOverlappingPairs(IDispatcher dispatcher)
        {
            ObjectArray<BroadphasePair> tmpPairs = new ObjectArray<BroadphasePair>();
            tmpPairs.AddRange(m_overlappingPairArray);
            for (int i = 0; i < tmpPairs.Count; i++)
            {
                RemoveOverlappingPair(tmpPairs[i].m_pProxy0, tmpPairs[i].m_pProxy1, dispatcher);
            }

            for (int i = 0; i < m_next.Count; i++)
            {
                m_next[i] = BT_NULL_PAIR;
            }

            tmpPairs.Sort();
            //tmpPairs.quickSort(btBroadphasePairSortPredicate());

            for (int i = 0; i < tmpPairs.Count; i++)
            {
                AddOverlappingPair(tmpPairs[i].m_pProxy0, tmpPairs[i].m_pProxy1);
            }
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:22,代码来源:OverlappingPairCache.cs

示例2: SolveConstraints

		protected virtual void SolveConstraints(ContactSolverInfo solverInfo)
		{
			//sorted version of all btTypedConstraint, based on islandId
			ObjectArray<TypedConstraint> sortedConstraints = new ObjectArray<TypedConstraint>(GetNumConstraints());

			if (BulletGlobals.g_streamWriter != null && debugDiscreteDynamicsWorld)
			{
				BulletGlobals.g_streamWriter.WriteLine("solveConstraints");
			}


			for (int i = 0; i < GetNumConstraints(); i++)
			{
				sortedConstraints.Add(m_constraints[i]);
			}

			//	btAssert(0);

			//sortedConstraints.quickSort(btSortConstraintOnIslandPredicate());
			sortedConstraints.Sort(new SortConstraintOnIslandPredicate());

			ObjectArray<TypedConstraint> constraintsPtr = GetNumConstraints() > 0 ? sortedConstraints : null;

			InplaceSolverIslandCallback solverCallback = new InplaceSolverIslandCallback(solverInfo, m_constraintSolver, constraintsPtr, sortedConstraints.Count, m_debugDrawer, m_dispatcher1);

			if (BulletGlobals.g_streamWriter != null && debugDiscreteDynamicsWorld)
			{
				BulletGlobals.g_streamWriter.WriteLine("prepareSolve");
			}

			m_constraintSolver.PrepareSolve(GetCollisionWorld().GetNumCollisionObjects(), GetCollisionWorld().GetDispatcher().GetNumManifolds());

			if (BulletGlobals.g_streamWriter != null && debugDiscreteDynamicsWorld)
			{
				BulletGlobals.g_streamWriter.WriteLine("buildAndProcessIsland");
			}

			/// solve all the constraints for this island
			m_islandManager.BuildAndProcessIslands(GetCollisionWorld().GetDispatcher(), GetCollisionWorld(), solverCallback);

			solverCallback.ProcessConstraints();

			m_constraintSolver.AllSolved(solverInfo, m_debugDrawer);
		}
开发者ID:HaKDMoDz,项目名称:InVision,代码行数:44,代码来源:DiscreteDynamicsWorld.cs


注:本文中的ObjectArray.Sort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。