Package com.bulletphysics.collision.broadphase.Dbvt

Examples of com.bulletphysics.collision.broadphase.Dbvt.Node


    }
   
    if (root != null && (passes > 0)) {
      Node[] root_ref = new Node[1];
      do {
        Node node = root;
        int bit = 0;
        while (node.isinternal()) {
          root_ref[0] = root;
          node = sort(node, root_ref).childs[(opath >>> bit) & 1];
          root = root_ref[0];
         
          bit = (bit + 1) & (/*sizeof(unsigned)*/4 * 8 - 1);
View Full Code Here


      while ((--passes) != 0);
    }
  }

  public Node insert(DbvtAabbMm box, Object data) {
    Node leaf = createnode(this, null, box, data);
    insertleaf(this, root, leaf);
    leaves++;
    return leaf;
  }
View Full Code Here

  public void update(Node leaf) {
    update(leaf, -1);
  }

  public void update(Node leaf, int lookahead) {
    Node root = removeleaf(this, leaf);
    if (root != null) {
      if (lookahead >= 0) {
        for (int i = 0; (i < lookahead) && root.parent != null; i++) {
          root = root.parent;
        }
View Full Code Here

    }
    insertleaf(this, root, leaf);
  }

  public void update(Node leaf, DbvtAabbMm volume) {
    Node root = removeleaf(this, leaf);
    if (root != null) {
      if (lkhd >= 0) {
        for (int i = 0; (i < lkhd) && root.parent != null; i++) {
          root = root.parent;
        }
View Full Code Here

    //DBVT_CHECKTYPE
    if (root != null) {
      ObjectArrayList<Node> stack = new ObjectArrayList<Node>(SIMPLE_STACKSIZE);
      stack.add(root);
      do {
        Node n = stack.remove(stack.size() - 1);
        if (DbvtAabbMm.Intersect(n.volume, volume)) {
          if (n.isinternal()) {
            stack.add(n.childs[0]);
            stack.add(n.childs[1]);
          }
          else {
            policy.Process(n);
View Full Code Here

      invdir.set(1f / normal.x, 1f / normal.y, 1f / normal.z);
      int[] signs = new int[] { direction.x<0 ? 1:0, direction.y<0 ? 1:0, direction.z<0 ? 1:0 };
      ObjectArrayList<Node> stack = new ObjectArrayList<Node>(SIMPLE_STACKSIZE);
      stack.add(root);
      do {
        Node node = stack.remove(stack.size() - 1);
        if (DbvtAabbMm.Intersect(node.volume, origin, invdir, signs)) {
          if (node.isinternal()) {
            stack.add(node.childs[0]);
            stack.add(node.childs[1]);
          }
          else {
            policy.Process(node);
View Full Code Here

    //DBVT_CHECKTYPE
    if (root != null) {
      ObjectArrayList<Node> stack = new ObjectArrayList<Node>(SIMPLE_STACKSIZE);
      stack.add(root);
      do {
        Node n = stack.remove(stack.size() - 1);
        if (policy.Descent(n)) {
          if (n.isinternal()) {
            stack.add(n.childs[0]);
            stack.add(n.childs[1]);
          }
          else {
            policy.Process(n);
View Full Code Here

    }
    deletenode(pdbvt, node);
  }
 
  private static Node createnode(Dbvt pdbvt, Node parent, DbvtAabbMm volume, Object data) {
    Node node;
    if (pdbvt.free != null) {
      node = pdbvt.free;
      pdbvt.free = null;
    }
    else {
      node = new Node();
    }
    node.parent = parent;
    node.volume.set(volume);
    node.data = data;
    node.childs[1] = null;
View Full Code Here

            root = root.childs[1];
          }
        }
        while (!root.isleaf());
      }
      Node prev = root.parent;
      Node node = createnode(pdbvt, prev, merge(leaf.volume, root.volume, new DbvtAabbMm()), null);
      if (prev != null) {
        prev.childs[indexof(root)] = node;
        node.childs[0] = root;
        root.parent = node;
        node.childs[1] = leaf;
View Full Code Here

    if (leaf == pdbvt.root) {
      pdbvt.root = null;
      return null;
    }
    else {
      Node parent = leaf.parent;
      Node prev = parent.parent;
      Node sibling = parent.childs[1 - indexof(leaf)];
      if (prev != null) {
        prev.childs[indexof(parent)] = sibling;
        sibling.parent = prev;
        deletenode(pdbvt, parent);
        while (prev != null) {
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.broadphase.Dbvt.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.