本文整理汇总了C#中FarseerPhysics.Dynamics.Contacts.Contact.destroy方法的典型用法代码示例。如果您正苦于以下问题:C# Contact.destroy方法的具体用法?C# Contact.destroy怎么用?C# Contact.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FarseerPhysics.Dynamics.Contacts.Contact
的用法示例。
在下文中一共展示了Contact.destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: destroy
internal void destroy( Contact contact )
{
var fixtureA = contact.fixtureA;
var fixtureB = contact.fixtureB;
var bodyA = fixtureA.body;
var bodyB = fixtureB.body;
if( contact.isTouching )
{
//Report the separation to both participants:
if( fixtureA != null && fixtureA.onSeparation != null )
fixtureA.onSeparation( fixtureA, fixtureB );
//Reverse the order of the reported fixtures. The first fixture is always the one that the
//user subscribed to.
if( fixtureB != null && fixtureB.onSeparation != null )
fixtureB.onSeparation( fixtureB, fixtureA );
if( onEndContact != null )
onEndContact( contact );
}
// Remove from the world.
contactList.Remove( contact );
// Remove from body 1
if( contact._nodeA.prev != null )
contact._nodeA.prev.next = contact._nodeA.next;
if( contact._nodeA.next != null )
contact._nodeA.next.prev = contact._nodeA.prev;
if( contact._nodeA == bodyA.contactList )
bodyA.contactList = contact._nodeA.next;
// Remove from body 2
if( contact._nodeB.prev != null )
contact._nodeB.prev.next = contact._nodeB.next;
if( contact._nodeB.next != null )
contact._nodeB.next.prev = contact._nodeB.prev;
if( contact._nodeB == bodyB.contactList )
bodyB.contactList = contact._nodeB.next;
#if USE_ACTIVE_CONTACT_SET
if (ActiveContacts.Contains(contact))
{
ActiveContacts.Remove(contact);
}
#endif
contact.destroy();
}