org.jbox2d.dynamics.Body.getContactList()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(204)

本文整理了Java中org.jbox2d.dynamics.Body.getContactList()方法的一些代码示例,展示了Body.getContactList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.getContactList()方法的具体详情如下:
包路径:org.jbox2d.dynamics.Body
类名称:Body
方法名:getContactList

Body.getContactList介绍

[英]Get the list of all contacts attached to this body.
[中]获取附加到此正文的所有联系人的列表。

代码示例

代码示例来源:origin: libgdx/libgdx

/**
 * Call this if you want to establish collision that was previously disabled by
 * ContactFilter::ShouldCollide.
 */
public void refilter() {
 if (m_body == null) {
  return;
 }
 // Flag associated contacts for filtering.
 ContactEdge edge = m_body.getContactList();
 while (edge != null) {
  Contact contact = edge.contact;
  Fixture fixtureA = contact.getFixtureA();
  Fixture fixtureB = contact.getFixtureB();
  if (fixtureA == this || fixtureB == this) {
   contact.flagForFiltering();
  }
  edge = edge.next;
 }
 World world = m_body.getWorld();
 if (world == null) {
  return;
 }
 // Touch each proxy so that new pairs may be created
 BroadPhase broadPhase = world.m_contactManager.m_broadPhase;
 for (int i = 0; i < m_proxyCount; ++i) {
  broadPhase.touchProxy(m_proxies[i].proxyId);
 }
}

代码示例来源:origin: libgdx/libgdx

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: libgdx/libgdx

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: libgdx/libgdx

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: jbox2d/jbox2d

/**
 * Call this if you want to establish collision that was previously disabled by
 * ContactFilter::ShouldCollide.
 */
public void refilter() {
 if (m_body == null) {
  return;
 }
 // Flag associated contacts for filtering.
 ContactEdge edge = m_body.getContactList();
 while (edge != null) {
  Contact contact = edge.contact;
  Fixture fixtureA = contact.getFixtureA();
  Fixture fixtureB = contact.getFixtureB();
  if (fixtureA == this || fixtureB == this) {
   contact.flagForFiltering();
  }
  edge = edge.next;
 }
 World world = m_body.getWorld();
 if (world == null) {
  return;
 }
 // Touch each proxy so that new pairs may be created
 BroadPhase broadPhase = world.m_contactManager.m_broadPhase;
 for (int i = 0; i < m_proxyCount; ++i) {
  broadPhase.touchProxy(m_proxies[i].proxyId);
 }
}

代码示例来源:origin: jbox2d/jbox2d

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: jbox2d/jbox2d

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: jbox2d/jbox2d

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: andmizi/MobikeTags

/**
 * Call this if you want to establish collision that was previously disabled by
 * ContactFilter::ShouldCollide.
 */
public void refilter() {
 if (m_body == null) {
  return;
 }
 // Flag associated contacts for filtering.
 ContactEdge edge = m_body.getContactList();
 while (edge != null) {
  Contact contact = edge.contact;
  Fixture fixtureA = contact.getFixtureA();
  Fixture fixtureB = contact.getFixtureB();
  if (fixtureA == this || fixtureB == this) {
   contact.flagForFiltering();
  }
  edge = edge.next;
 }
 World world = m_body.getWorld();
 if (world == null) {
  return;
 }
 // Touch each proxy so that new pairs may be created
 BroadPhase broadPhase = world.m_contactManager.m_broadPhase;
 for (int i = 0; i < m_proxyCount; ++i) {
  broadPhase.touchProxy(m_proxies[i].proxyId);
 }
}

代码示例来源:origin: com.github.almasb/fxgl-physics

/**
 * Call this if you want to establish collision that was previously disabled by
 * ContactFilter::ShouldCollide.
 */
public void refilter() {
  // Flag associated contacts for filtering.
  ContactEdge edge = body.getContactList();
  while (edge != null) {
    Contact contact = edge.contact;
    Fixture fixtureA = contact.getFixtureA();
    Fixture fixtureB = contact.getFixtureB();
    if (fixtureA == this || fixtureB == this) {
      contact.flagForFiltering();
    }
    edge = edge.next;
  }
  World world = body.getWorld();
  if (world == null) {
    return;
  }
  // Touch each proxy so that new pairs may be created
  BroadPhase broadPhase = world.m_contactManager.m_broadPhase;
  for (int i = 0; i < proxyCount; ++i) {
    broadPhase.touchProxy(m_proxies[i].proxyId);
  }
}

代码示例来源:origin: org.jbox2d/jbox2d-library

/**
 * Call this if you want to establish collision that was previously disabled by
 * ContactFilter::ShouldCollide.
 */
public void refilter() {
 if (m_body == null) {
  return;
 }
 // Flag associated contacts for filtering.
 ContactEdge edge = m_body.getContactList();
 while (edge != null) {
  Contact contact = edge.contact;
  Fixture fixtureA = contact.getFixtureA();
  Fixture fixtureB = contact.getFixtureB();
  if (fixtureA == this || fixtureB == this) {
   contact.flagForFiltering();
  }
  edge = edge.next;
 }
 World world = m_body.getWorld();
 if (world == null) {
  return;
 }
 // Touch each proxy so that new pairs may be created
 BroadPhase broadPhase = world.m_contactManager.m_broadPhase;
 for (int i = 0; i < m_proxyCount; ++i) {
  broadPhase.touchProxy(m_proxies[i].proxyId);
 }
}

代码示例来源:origin: com.github.almasb/fxgl-physics

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
  if (edge.other == bodyA) {

代码示例来源:origin: org.jbox2d/jbox2d-library

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: andmizi/MobikeTags

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: com.github.almasb/fxgl-physics

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
  if (edge.other == bodyA) {

代码示例来源:origin: org.jbox2d/jbox2d-library

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: andmizi/MobikeTags

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: andmizi/MobikeTags

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

代码示例来源:origin: com.github.almasb/fxgl-physics

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
  if (edge.other == bodyA) {

代码示例来源:origin: org.jbox2d/jbox2d-library

ContactEdge edge = bodyB.getContactList();
while (edge != null) {
 if (edge.other == bodyA) {

相关文章