本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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];
}
}
}
}
示例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;
}
}
}
}
示例5: query
import org.jbox2d.callbacks.TreeCallback; //导入依赖的package包/类
@Override
public final void query(final TreeCallback callback, final AABB aabb) {
m_tree.query(callback, aabb);
}
示例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);
}
示例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);
示例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);
示例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);
}
示例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);
}
示例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);
}
示例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);
}