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