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


Java TreeCallback类代码示例

本文整理汇总了Java中org.jbox2d.callbacks.TreeCallback的典型用法代码示例。如果您正苦于以下问题:Java TreeCallback类的具体用法?Java TreeCallback怎么用?Java TreeCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
@Override
public final void query(TreeCallback callback, AABB aabb) {
  nodeStack.reset();
  nodeStack.push(m_root);

  while (nodeStack.getCount() > 0) {
    DynamicTreeNode node = nodeStack.pop();
    if (node == null) {
      continue;
    }

    if (AABB.testOverlap(node.aabb, aabb)) {
      if (node.child1 == null) {
        boolean proceed = callback.treeCallback(node.id);
        if (!proceed) {
          return;
        }
      } else {
        nodeStack.push(node.child1);
        nodeStack.push(node.child2);
      }
    }
  }
}
 
开发者ID:pianoman373,项目名称:Point-Engine,代码行数:25,代码来源:DynamicTree.java

示例2: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class is called for each proxy that
 * overlaps the supplied AABB.
 * 
 * @param callback
 * @param araabbgAABB
 */
public final void query(TreeCallback callback, AABB aabb) {
  intStack.reset();
  intStack.push(m_root);

  while (intStack.getCount() > 0) {
    int nodeId = intStack.pop();
    if (nodeId == DynamicTreeNode.NULL_NODE) {
      continue;
    }

    final DynamicTreeNode node = m_nodes[nodeId];

    if (AABB.testOverlap(node.aabb, aabb)) {
      if (node.isLeaf()) {
        boolean proceed = callback.treeCallback(node);
        if (!proceed) {
          return;
        }
      } else {
        intStack.push(node.child1);
        intStack.push(node.child2);
      }
    }
  }
}
 
开发者ID:col726,项目名称:game-engine-CMZ,代码行数:33,代码来源:DynamicTree.java

示例3: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
@Override
public final void query(TreeCallback callback, AABB aabb) {
  nodeStackIndex = 0;
  nodeStack[nodeStackIndex++] = m_root;

  while (nodeStackIndex > 0) {
    int node = nodeStack[--nodeStackIndex];
    if (node == NULL_NODE) {
      continue;
    }

    if (AABB.testOverlap(m_aabb[node], aabb)) {
      int child1 = m_child1[node];
      if (child1 == NULL_NODE) {
        boolean proceed = callback.treeCallback(node);
        if (!proceed) {
          return;
        }
      } else {
        if (nodeStack.length - nodeStackIndex - 2 <= 0) {
          nodeStack =
              BufferUtils.reallocateBuffer(nodeStack, nodeStack.length, nodeStack.length * 2);
        }
        nodeStack[nodeStackIndex++] = child1;
        nodeStack[nodeStackIndex++] = m_child2[node];
      }
    }
  }
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:30,代码来源:DynamicTreeFlatNodes.java

示例4: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
@Override
public final void query(TreeCallback callback, AABB aabb) {
  assert(aabb.isValid());
  nodeStackIndex = 0;
  nodeStack[nodeStackIndex++] = m_root;

  while (nodeStackIndex > 0) {
    DynamicTreeNode node = nodeStack[--nodeStackIndex];
    if (node == null) {
      continue;
    }

    if (AABB.testOverlap(node.aabb, aabb)) {
      if (node.child1 == null) {
        boolean proceed = callback.treeCallback(node.id);
        if (!proceed) {
          return;
        }
      } else {
        if (nodeStack.length - nodeStackIndex - 2 <= 0) {
          DynamicTreeNode[] newBuffer = new DynamicTreeNode[nodeStack.length * 2];
          System.arraycopy(nodeStack, 0, newBuffer, 0, nodeStack.length);
          nodeStack = newBuffer;
        }
        nodeStack[nodeStackIndex++] = node.child1;
        nodeStack[nodeStackIndex++] = node.child2;
      }
    }
  }
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:31,代码来源:DynamicTree.java

示例5: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
@Override
public final void query(final TreeCallback callback, final AABB aabb) {
  m_tree.query(callback, aabb);
}
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:5,代码来源:DefaultBroadPhaseBuffer.java

示例6: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
@Override
public void query(TreeCallback callback, AABB aabb) {
  query(callback, aabb.lowerBound.x, aabb.lowerBound.y, aabb.upperBound.x, aabb.upperBound.y);
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:5,代码来源:BroadPhaseJNI.java

示例7: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class is called for each proxy that
 * overlaps the supplied AABB.
 * 
 * @param callback
 * @param aabb
 */
void query(TreeCallback callback, AABB aabb);
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:9,代码来源:BroadPhase.java

示例8: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class is called for each proxy that
 * overlaps the supplied AABB.
 * 
 * @param callback
 * @param araabbgAABB
 */
void query(TreeCallback callback, AABB aabb);
 
开发者ID:jfcameron,项目名称:G2Dj,代码行数:9,代码来源:BroadPhaseStrategy.java

示例9: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class
 * is called for each proxy that overlaps the supplied AABB.
 * 
 * @param callback
 * @param aabb
 */
public final void query(final TreeCallback callback, final AABB aabb) {
	m_tree.query(callback, aabb);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:BroadPhase.java

示例10: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class
 * is called for each proxy that overlaps the supplied AABB.
 * 
 * @param argCallback
 * @param argAABB
 */
public final void query(TreeCallback argCallback, AABB argAABB) {
	query(argCallback, argAABB, m_root, 1);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:DynamicTree.java

示例11: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class is called for each proxy that
 * overlaps the supplied AABB.
 * 
 * @param callback
 * @param aabb
 */
public final void query(final TreeCallback callback, final AABB aabb) {
  m_tree.query(callback, aabb);
}
 
开发者ID:pianoman373,项目名称:Point-Engine,代码行数:11,代码来源:BroadPhase.java

示例12: query

import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
/**
 * Query an AABB for overlapping proxies. The callback class
 * is called for each proxy that overlaps the supplied AABB.
 * 
 * @param argCallback
 * @param argAABB
 */
public  void query(TreeCallback argCallback, AABB argAABB) {
	query(argCallback, argAABB, m_root, 1);
}
 
开发者ID:dragome,项目名称:dragome-examples,代码行数:11,代码来源:DynamicTree.java


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