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


Java Contact.isTouching方法代码示例

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


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

示例1: destroy

import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
public void destroy(Contact c) {
  Fixture fixtureA = c.getFixtureA();
  Fixture fixtureB = c.getFixtureB();
  Body bodyA = fixtureA.getBody();
  Body bodyB = fixtureB.getBody();

  if (m_contactListener != null && c.isTouching()) {
    m_contactListener.endContact(c);
  }

  // Remove from the world.
  if (c.m_prev != null) {
    c.m_prev.m_next = c.m_next;
  }

  if (c.m_next != null) {
    c.m_next.m_prev = c.m_prev;
  }

  if (c == m_contactList) {
    m_contactList = c.m_next;
  }

  // Remove from body 1
  if (c.m_nodeA.prev != null) {
    c.m_nodeA.prev.next = c.m_nodeA.next;
  }

  if (c.m_nodeA.next != null) {
    c.m_nodeA.next.prev = c.m_nodeA.prev;
  }

  if (c.m_nodeA == bodyA.m_contactList) {
    bodyA.m_contactList = c.m_nodeA.next;
  }

  // Remove from body 2
  if (c.m_nodeB.prev != null) {
    c.m_nodeB.prev.next = c.m_nodeB.next;
  }

  if (c.m_nodeB.next != null) {
    c.m_nodeB.next.prev = c.m_nodeB.prev;
  }

  if (c.m_nodeB == bodyB.m_contactList) {
    bodyB.m_contactList = c.m_nodeB.next;
  }

  // Call the factory.
  pool.pushContact(c);
  --m_contactCount;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:54,代码来源:ContactManager.java

示例2: destroy

import org.jbox2d.dynamics.contacts.Contact; //导入方法依赖的package包/类
public void destroy(Contact c) {
	Fixture fixtureA = c.getFixtureA();
	Fixture fixtureB = c.getFixtureB();
	Body bodyA = fixtureA.getBody();
	Body bodyB = fixtureB.getBody();
	
	if (m_contactListener != null && c.isTouching()) {
		m_contactListener.endContact(c);
	}
	
	// Remove from the world.
	if (c.m_prev != null) {
		c.m_prev.m_next = c.m_next;
	}
	
	if (c.m_next != null) {
		c.m_next.m_prev = c.m_prev;
	}
	
	if (c == m_contactList) {
		m_contactList = c.m_next;
	}
	
	// Remove from body 1
	if (c.m_nodeA.prev != null) {
		c.m_nodeA.prev.next = c.m_nodeA.next;
	}
	
	if (c.m_nodeA.next != null) {
		c.m_nodeA.next.prev = c.m_nodeA.prev;
	}
	
	if (c.m_nodeA == bodyA.m_contactList) {
		bodyA.m_contactList = c.m_nodeA.next;
	}
	
	// Remove from body 2
	if (c.m_nodeB.prev != null) {
		c.m_nodeB.prev.next = c.m_nodeB.next;
	}
	
	if (c.m_nodeB.next != null) {
		c.m_nodeB.next.prev = c.m_nodeB.prev;
	}
	
	if (c.m_nodeB == bodyB.m_contactList) {
		bodyB.m_contactList = c.m_nodeB.next;
	}
	
	// Call the factory.
	pool.pushContact(c);
	--m_contactCount;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:54,代码来源:ContactManager.java


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