Permalink
Browse files

Merge branch 'master' of https://github.com/tzaeschke/ode4j.git

Conflicts:
	demo/src/test/java/org/ode4j/tests/SpacePerformanceTest.java
  • Loading branch information...
2 parents 804d516 + 09ad5f3 commit b4d755c93c216317f28f7eb9011dd2038a037cef @tzaeschke committed Dec 31, 2015
View
@@ -1,4 +1,7 @@
+- Added new SAP space, PR #43
+- Fixes on SAP space, PR #42 (Piotr)
+- Fixes on removing geoms from space, PR #41 (Piotr)
- Added support for convex-trimesh collision (Piotr)
- Fixed scaling of tacc in quickstep (issue #38, Eduard Nicodei)
- Fixed Common.__ASSERT methods to act correctly if parameter is '0' or 'false', see issue #32
@@ -1,42 +1,42 @@
-package org.ode4j.ode.internal;
-
-import org.ode4j.ode.DAABBC;
-import org.ode4j.ode.DColliderFn;
-import org.ode4j.ode.DContactGeomBuffer;
-import org.ode4j.ode.DGeom;
-import org.ode4j.ode.internal.CollisionLibccd.CollideConvexTrimeshTrianglesCCD;
-import org.ode4j.ode.internal.gimpact.GimDynArrayInt;
-import org.ode4j.ode.internal.gimpact.GimGeometry.aabb3f;
-import org.ode4j.ode.internal.gimpact.GimTrimesh;
-
-public class CollideConvexTrimesh implements DColliderFn {
-
- @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 = collision_result.GIM_DYNARRAY_POINTER();
- 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;
- }
-}
+package org.ode4j.ode.internal;
+
+import org.ode4j.ode.DAABBC;
+import org.ode4j.ode.DColliderFn;
+import org.ode4j.ode.DContactGeomBuffer;
+import org.ode4j.ode.DGeom;
+import org.ode4j.ode.internal.CollisionLibccd.CollideConvexTrimeshTrianglesCCD;
+import org.ode4j.ode.internal.gimpact.GimDynArrayInt;
+import org.ode4j.ode.internal.gimpact.GimGeometry.aabb3f;
+import org.ode4j.ode.internal.gimpact.GimTrimesh;
+
+public class CollideConvexTrimesh implements DColliderFn {
+
+ @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 = collision_result.GIM_DYNARRAY_POINTER();
+ 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;
+ }
+}
@@ -382,8 +382,11 @@ void spaceRemove(DxSpace parent, List<DxGeom> geoms) {
if (_next != null) {
_next._prev = _prev;
}
- parent.setFirst(_next);
-// parent_space.
+ if (_prev != null) {
+ _prev._next = _next;
+ } else {
+ parent.setFirst(_next);
+ }
//TODO use HashSet or IdentitySet or ArrayList? Check call hierarchy for type of usage!
geoms.remove(this);
Oops, something went wrong.

0 comments on commit b4d755c

Please sign in to comment.