Package com.bulletphysics.extras.gimpact.BoxCollision

Examples of com.bulletphysics.extras.gimpact.BoxCollision.AABB


  public void buildSet() {
    // obtain primitive boxes
    BvhDataArray primitive_boxes = new BvhDataArray();
    primitive_boxes.resize(primitive_manager.get_primitive_count());

    AABB tmpAABB = Stack.alloc(AABB.class);

    for (int i = 0; i < primitive_boxes.size(); i++) {
      //primitive_manager.get_primitive_box(i,primitive_boxes[i].bound);
      primitive_manager.get_primitive_box(i, tmpAABB);
      primitive_boxes.setBound(i, tmpAABB);
View Full Code Here


   */
  public boolean boxQuery(AABB box, IntArrayList collided_results) {
    int curIndex = 0;
    int numNodes = getNodeCount();

    AABB bound = Stack.alloc(AABB.class);

    while (curIndex < numNodes) {
      getNodeBound(curIndex, bound);

      // catch bugs in tree data

      boolean aabbOverlap = bound.has_collision(box);
      boolean isleafnode = isLeafNode(curIndex);

      if (isleafnode && aabbOverlap) {
        collided_results.add(getNodeData(curIndex));
      }
View Full Code Here

  /**
   * Returns the indices of the primitives in the primitive_manager field.
   */
  public boolean boxQueryTrans(AABB box, Transform transform, IntArrayList collided_results) {
    AABB transbox = Stack.alloc(box);
    transbox.appy_transform(transform);
    return boxQuery(transbox, collided_results);
  }
View Full Code Here

   */
  public boolean rayQuery(Vector3f ray_dir, Vector3f ray_origin, IntArrayList collided_results) {
    int curIndex = 0;
    int numNodes = getNodeCount();

    AABB bound = Stack.alloc(AABB.class);

    while (curIndex < numNodes) {
      getNodeBound(curIndex, bound);

      // catch bugs in tree data

      boolean aabbOverlap = bound.collide_ray(ray_origin, ray_dir);
      boolean isleafnode = isLeafNode(curIndex);

      if (isleafnode && aabbOverlap) {
        collided_results.add(getNodeData(curIndex));
      }
View Full Code Here

  public BvhTreeNodeArray get_node_pointer() {
    return box_tree.get_node_pointer();
  }

  private static boolean _node_collision(GImpactBvh boxset0, GImpactBvh boxset1, BoxBoxTransformCache trans_cache_1to0, int node0, int node1, boolean complete_primitive_tests) {
    AABB box0 = Stack.alloc(AABB.class);
    boxset0.getNodeBound(node0, box0);
    AABB box1 = Stack.alloc(AABB.class);
    boxset1.getNodeBound(node1, box1);

    return box0.overlapping_trans_cache(box1, trans_cache_1to0, complete_primitive_tests);
    //box1.appy_transform_trans_cache(trans_cache_1to0);
    //return box0.has_collision(box1);
View Full Code Here

TOP

Related Classes of com.bulletphysics.extras.gimpact.BoxCollision.AABB

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.