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


C# IDispatcher.getManifoldByIndexInternal方法代码示例

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


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

示例1: buildIslands


//.........这里部分代码省略.........
                        if (colObj0.ActivationState == ActivationStateFlags.ACTIVE_TAG)
                        {
                            allSleeping = false;
                        }
                        if (colObj0.ActivationState == ActivationStateFlags.DISABLE_DEACTIVATION)
                        {
                            allSleeping = false;
                        }
                    }
                }


                if (allSleeping)
                {
                    for (int idx = startIslandIndex; idx < endIslandIndex; idx++)
                    {
                        int i = UnionFind.getElement(idx).m_sz;
                        CollisionObject colObj0 = collisionObjects[i];
                        if ((colObj0.IslandTag != islandId) && (colObj0.IslandTag != -1))
                        {
                            //					printf("error in island management\n");
                        }

                        Debug.Assert((colObj0.IslandTag == islandId) || (colObj0.IslandTag == -1));

                        if (colObj0.IslandTag == islandId)
                        {
                            colObj0.ActivationState = ActivationStateFlags.ISLAND_SLEEPING;
                        }
                    }
                }
                else
                {

                    int idx;
                    for (idx = startIslandIndex; idx < endIslandIndex; idx++)
                    {
                        int i = UnionFind.getElement(idx).m_sz;

                        CollisionObject colObj0 = collisionObjects[i];
                        if ((colObj0.IslandTag != islandId) && (colObj0.IslandTag != -1))
                        {
                            //					printf("error in island management\n");
                        }

                        Debug.Assert((colObj0.IslandTag == islandId) || (colObj0.IslandTag == -1));

                        if (colObj0.IslandTag == islandId)
                        {
                            if (colObj0.ActivationState == ActivationStateFlags.ISLAND_SLEEPING)
                            {
                                colObj0.ActivationState = ActivationStateFlags.WANTS_DEACTIVATION;
                                colObj0.DeactivationTime = 0f;
                            }
                        }
                    }
                }
            }


            int maxNumManifolds = dispatcher.NumManifolds;

            //#define SPLIT_ISLANDS 1
            //#ifdef SPLIT_ISLANDS


            //#endif //SPLIT_ISLANDS


            for (int i = 0; i < maxNumManifolds; i++)
            {
                PersistentManifold manifold = dispatcher.getManifoldByIndexInternal(i);

                CollisionObject colObj0 = manifold.Body0;
                CollisionObject colObj1 = manifold.Body1;

                ///@todo: check sleeping conditions!
                if (((colObj0 != null) && colObj0.ActivationState != ActivationStateFlags.ISLAND_SLEEPING) ||
                   ((colObj1 != null) && colObj1.ActivationState != ActivationStateFlags.ISLAND_SLEEPING))
                {

                    //kinematic objects don't merge islands, but wake up all connected objects
                    if (colObj0.isKinematicObject && colObj0.ActivationState != ActivationStateFlags.ISLAND_SLEEPING)
                    {
                        colObj1.activate(false);
                    }
                    if (colObj1.isKinematicObject && colObj1.ActivationState != ActivationStateFlags.ISLAND_SLEEPING)
                    {
                        colObj0.activate(false);
                    }
                    if (m_splitIslands)
                    {
                        //filtering for response
                        if (dispatcher.needsResponse(colObj0, colObj1))
                            m_islandmanifold.Add(manifold);
                    }
                }
            }
            BulletGlobal.EndProfile("0-3-1-0 buildIslands");
        }
开发者ID:himapo,项目名称:ccm,代码行数:101,代码来源:SimulationIslandManager.cs


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