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


Java BroadPhase.NULL_PROXY属性代码示例

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


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

示例1: destroyProxies

/**
 * Internal method
 * 
 * @param broadPhase
 */
public void destroyProxies(BroadPhase broadPhase) {
  // Destroy proxies in the broad-phase.
  for (int i = 0; i < m_proxyCount; ++i) {
    FixtureProxy proxy = m_proxies[i];
    broadPhase.destroyProxy(proxy.proxyId);
    proxy.proxyId = BroadPhase.NULL_PROXY;
  }

  m_proxyCount = 0;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:15,代码来源:Fixture.java

示例2: create

public void create(Body body, FixtureDef def) {
  m_userData = def.userData;
  m_friction = def.friction;
  m_restitution = def.restitution;

  m_body = body;
  m_next = null;


  m_filter.set(def.filter);

  m_isSensor = def.isSensor;

  m_shape = def.shape.clone();

  // Reserve proxy space
  int childCount = m_shape.getChildCount();
  if (m_proxies == null) {
    m_proxies = new FixtureProxy[childCount];
    for (int i = 0; i < childCount; i++) {
      m_proxies[i] = new FixtureProxy();
      m_proxies[i].fixture = null;
      m_proxies[i].proxyId = BroadPhase.NULL_PROXY;
    }
  }

  if (m_proxies.length < childCount) {
    FixtureProxy[] old = m_proxies;
    int newLen = MathUtils.max(old.length * 2, childCount);
    m_proxies = new FixtureProxy[newLen];
    System.arraycopy(old, 0, m_proxies, 0, old.length);
    for (int i = 0; i < newLen; i++) {
      if (i >= old.length) {
        m_proxies[i] = new FixtureProxy();
      }
      m_proxies[i].fixture = null;
      m_proxies[i].proxyId = BroadPhase.NULL_PROXY;
    }
  }
  m_proxyCount = 0;

  m_density = def.density;
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:43,代码来源:Fixture.java


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