本文整理汇总了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);
}
示例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
));
}