public void set(DAABBC aabb) { setMin0(aabb.getMin0()); setMin1(aabb.getMin1()); setMin2(aabb.getMin2()); setMax0(aabb.getMax0()); setMax1(aabb.getMax1()); setMax2(aabb.getMax2()); }
public void set(DAABBC aabb) { setMin0(aabb.getMin0()); setMin1(aabb.getMin1()); setMin2(aabb.getMin2()); setMax0(aabb.getMax0()); setMax1(aabb.getMax1()); setMax2(aabb.getMax2()); }
private double[] getExtents(DxGeom g) { double[] extents = new double[6]; extents[0] = g.getAABB().getMin0(); extents[1] = g.getAABB().getMin1(); extents[2] = g.getAABB().getMin2(); extents[3] = g.getAABB().getMax0(); extents[4] = g.getAABB().getMax1(); extents[5] = g.getAABB().getMax2(); return extents; }
/** * Expand this AABB to include the given AABB. * @param aabb aabb */ public void expand(DAABBC aabb) { if (aabb.getMin0() < _min.get0()) _min.set0(aabb.getMin0()); if (aabb.getMin1() < _min.get1()) _min.set1(aabb.getMin1()); if (aabb.getMin2() < _min.get2()) _min.set2(aabb.getMin2()); if (aabb.getMax0() > _max.get0()) _max.set0(aabb.getMax0()); if (aabb.getMax1() > _max.get1()) _max.set1(aabb.getMax1()); if (aabb.getMax2() > _max.get2()) _max.set2(aabb.getMax2()); }
/** * Expand this AABB to include the given AABB. * @param aabb aabb */ public void expand(DAABBC aabb) { if (aabb.getMin0() < _min.get0()) _min.set0(aabb.getMin0()); if (aabb.getMin1() < _min.get1()) _min.set1(aabb.getMin1()); if (aabb.getMin2() < _min.get2()) _min.set2(aabb.getMin2()); if (aabb.getMax0() > _max.get0()) _max.set0(aabb.getMax0()); if (aabb.getMax1() > _max.get1()) _max.set1(aabb.getMax1()); if (aabb.getMax2() > _max.get2()) _max.set2(aabb.getMax2()); }
private double[] getExtents(DxGeom g) { double[] extents = new double[6]; extents[0] = g.getAABB().getMin0(); extents[1] = g.getAABB().getMin1(); extents[2] = g.getAABB().getMin2(); extents[3] = g.getAABB().getMax0(); extents[4] = g.getAABB().getMax1(); extents[5] = g.getAABB().getMax2(); return extents; }
/** * Checks whether the to AABBs are disjoint. * @param aabb2 aabb2 * @return <tt>false</tt> if the two AABBs overlap. */ @Override public boolean isDisjoint(DAABBC aabb2) { if (getMin0() > aabb2.getMax0() || getMax0() < aabb2.getMin0() || getMin1() > aabb2.getMax1() || getMax1() < aabb2.getMin1() || getMin2() > aabb2.getMax2() || getMax2() < aabb2.getMin2()) { return true; } return false; }
/** * Checks whether the to AABBs are disjoint. * @param aabb2 aabb2 * @return <tt>false</tt> if the two AABBs overlap. */ @Override public boolean isDisjoint(DAABBC aabb2) { if (getMin0() > aabb2.getMax0() || getMax0() < aabb2.getMin0() || getMin1() > aabb2.getMax1() || getMax1() < aabb2.getMin1() || getMin2() > aabb2.getMax2() || getMax2() < aabb2.getMin2()) { return true; } return false; }
test_aabb.minX = (float) aabb.getMin0(); test_aabb.maxX = (float) aabb.getMax0(); test_aabb.minY = (float) aabb.getMin1();
@Override public int dColliderFn(DGeom o1, DGeom o2, int flags, DContactGeomBuffer contacts) { DxGimpact trimesh = (DxGimpact) o2; GimTrimesh ptrimesh = trimesh.m_collision_trimesh; aabb3f test_aabb = new aabb3f(); DAABBC aabb = o1.getAABB(); test_aabb.minX = (float) aabb.getMin0(); test_aabb.maxX = (float) aabb.getMax0(); test_aabb.minY = (float) aabb.getMin1(); test_aabb.maxY = (float) aabb.getMax1(); test_aabb.minZ = (float) aabb.getMin2(); test_aabb.maxZ = (float) aabb.getMax2(); GimDynArrayInt collision_result = GimDynArrayInt.GIM_CREATE_BOXQUERY_LIST(); ptrimesh.getAabbSet().gim_aabbset_box_collision(test_aabb, collision_result); int contactcount = 0; if (collision_result.size() != 0) { int[] boxesresult = Arrays.copyOf(collision_result.GIM_DYNARRAY_POINTER(), collision_result.size()); ptrimesh.gim_trimesh_locks_work_data(); CollideConvexTrimeshTrianglesCCD collideFn = new CollideConvexTrimeshTrianglesCCD(); contactcount = collideFn.collide(o1, o2, boxesresult, flags, contacts); ptrimesh.gim_trimesh_unlocks_work_data(); } collision_result.GIM_DYNARRAY_DESTROY(); return contactcount; } }
@Override public int dColliderFn(DGeom o1, DGeom o2, int flags, DContactGeomBuffer contacts) { DxGimpact trimesh = (DxGimpact) o2; GimTrimesh ptrimesh = trimesh.m_collision_trimesh; aabb3f test_aabb = new aabb3f(); DAABBC aabb = o1.getAABB(); test_aabb.minX = (float) aabb.getMin0(); test_aabb.maxX = (float) aabb.getMax0(); test_aabb.minY = (float) aabb.getMin1(); test_aabb.maxY = (float) aabb.getMax1(); test_aabb.minZ = (float) aabb.getMin2(); test_aabb.maxZ = (float) aabb.getMax2(); GimDynArrayInt collision_result = GimDynArrayInt.GIM_CREATE_BOXQUERY_LIST(); ptrimesh.getAabbSet().gim_aabbset_box_collision(test_aabb, collision_result); int contactcount = 0; if (collision_result.size() != 0) { int[] boxesresult = Arrays.copyOf(collision_result.GIM_DYNARRAY_POINTER(), collision_result.size()); ptrimesh.gim_trimesh_locks_work_data(); CollideConvexTrimeshTrianglesCCD collideFn = new CollideConvexTrimeshTrianglesCCD(); contactcount = collideFn.collide(o1, o2, boxesresult, flags, contacts); ptrimesh.gim_trimesh_unlocks_work_data(); } collision_result.GIM_DYNARRAY_DESTROY(); return contactcount; } }
test_aabb.minX = (float) aabb.getMin0(); test_aabb.maxX = (float) aabb.getMax0(); test_aabb.minY = (float) aabb.getMin1();
test_aabb.minX = (float) aabb.getMin0(); test_aabb.maxX = (float) aabb.getMax0(); test_aabb.minY = (float) aabb.getMin1();
test_aabb.minX = (float) aabb.getMin0(); test_aabb.maxX = (float) aabb.getMax0(); test_aabb.minY = (float) aabb.getMin1();
DVector3 bbpos = new DVector3(); bbpos.set( 0.5* (aabb.getMin0()+aabb.getMax0()), 0.5* (aabb.getMin1()+aabb.getMax1()), 0.5* (aabb.getMin2()+aabb.getMax2()));