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


C# CollisionObject.SetBroadphaseHandle方法代码示例

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


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

示例1: RemoveCollisionObject

 public virtual void RemoveCollisionObject(CollisionObject collisionObject)
 {
     //bool removeFromBroadphase = false;
     {
         BroadphaseProxy bp = collisionObject.GetBroadphaseHandle();
         if (bp != null)
         {
             //
             // only clear the cached algorithms
             //
             GetBroadphase().GetOverlappingPairCache().CleanProxyFromPairs(bp, m_dispatcher1);
             GetBroadphase().DestroyProxy(bp, m_dispatcher1);
             collisionObject.SetBroadphaseHandle(null);
         }
     }
     //swapremove
     m_collisionObjects.Remove(collisionObject);
 }
开发者ID:Belxjander,项目名称:Asuna,代码行数:18,代码来源:CollisionWorld.cs

示例2: AddCollisionObject

        public virtual void AddCollisionObject(CollisionObject collisionObject, CollisionFilterGroups collisionFilterGroup, CollisionFilterGroups collisionFilterMask)
        {
            //check that the object isn't already added
            //btAssert( m_collisionObjects.findLinearSearch(collisionObject)  == m_collisionObjects.size());

            Debug.Assert(collisionObject != null);
            //Debug.Assert(!m_collisionObjects.Contains(collisionObject));

            if (m_collisionObjects.Contains(collisionObject))
            {
                return;
            }

            m_collisionObjects.Add(collisionObject);

            //calculate new AABB
            IndexedMatrix trans = collisionObject.GetWorldTransform();
            IndexedVector3 minAabb;
            IndexedVector3 maxAabb;

            collisionObject.GetCollisionShape().GetAabb(ref trans, out minAabb, out maxAabb);

            BroadphaseNativeTypes type = collisionObject.GetCollisionShape().GetShapeType();
            collisionObject.SetBroadphaseHandle(GetBroadphase().CreateProxy(
                ref minAabb,
                ref maxAabb,
                type,
                collisionObject,
                collisionFilterGroup,
                collisionFilterMask,
                m_dispatcher1, 0
                ));
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:33,代码来源:CollisionWorld.cs


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