Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@

Known Bugs: TrimeshHeightfield and LayeredTrimeshHeightfield don't work with Convex

TODO
- rename createBHVSpace to BVH!
- Add PH-Tree space???

- Fixed BVH spelling in API [#149](https://github.com/tzaeschke/ode4j/pull/149)
- Post 0.16.6 cleanup [#148](https://github.com/tzaeschke/ode4j/pull/148)
- Re-enabled new BoxPlane collider
- deprecated `DWorld.step()`
Expand Down
32 changes: 32 additions & 0 deletions core/src/main/java/org/ode4j/ode/DBVHSpace.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*************************************************************************
* *
* Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
* All rights reserved. Email: russ@q12.org Web: www.q12.org *
* Open Dynamics Engine 4J, Copyright (C) 2009-2014 Tilmann Zaeschke *
* All rights reserved. Email: ode4j@gmx.de Web: www.ode4j.org *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) The GNU Lesser General Public License as published by the Free *
* Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. The text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file ODE-LICENSE-BSD.TXT and ODE4J-LICENSE-BSD.TXT. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT, ODE-LICENSE-BSD.TXT and ODE4J-LICENSE-BSD.TXT for more *
* details. *
* *
*************************************************************************/
package org.ode4j.ode;

/**
* Bounding volume hierarchy.
*/
public interface DBVHSpace extends DSpace {

}
3 changes: 2 additions & 1 deletion core/src/main/java/org/ode4j/ode/DBhvSpace.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*************************************************************************/
package org.ode4j.ode;

public interface DBhvSpace extends DSpace {
// TODO (TZ) to be removed in 0.6.0
public interface DBhvSpace extends DBVHSpace {

// intentionally undefined, don't use these
// dSimpleSpace (dSimpleSpace &);
Expand Down
38 changes: 33 additions & 5 deletions core/src/main/java/org/ode4j/ode/OdeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,14 @@ public static DQuadTreeSpace createQuadTreeSpace (DSpace space,
return DxQuadTreeSpace.dQuadTreeSpaceCreate((DxSpace) space,
Center, Extents, Depth);
}

/**
* @param staticGeomCategoryMask Geoms that are marked as static are not checked
* for mutual collision. See SpacePerformanceTest for an example.
* @return SAP Space
* @return BVH Space
* @deprecated Please use {@link #createBVHSpace(long)}
*/
@Deprecated // TODO to be removed in 0.6.0 -> also remove DBhvSpace
public static DBhvSpace createBHVSpace (long staticGeomCategoryMask) {
return DxBVHSpace.bvhSpaceCreate(null, 16, false, 0.2, staticGeomCategoryMask);
}
Expand All @@ -615,11 +618,36 @@ public static DBhvSpace createBHVSpace (long staticGeomCategoryMask) {
* @param fatAabbMargin Suggested default: 0.2
* @param staticGeomCategoryMask Geoms that are marked as static are not checked
* for mutual collision. See SpacePerformanceTest for an example.
* @return SAP space
* @return BVH space
* @deprecated Please use {@link #createBVHSpace(DSpace, int, boolean, double, long)}
*/
@Deprecated // TODO to be removed in 0.6.0 -> also remove DBhvSpace
public static DBhvSpace createBHVSpace (DSpace space, int nodesPerLeaf, boolean highQuality,
double fatAabbMargin, long staticGeomCategoryMask) {
return DxBVHSpace.bvhSpaceCreate((DxSpace) space, nodesPerLeaf, highQuality, fatAabbMargin,
staticGeomCategoryMask);
}

/**
* @param staticGeomCategoryMask Geoms that are marked as static are not checked
* for mutual collision. See SpacePerformanceTest for an example.
* @return BVH Space
*/
public static DBVHSpace createBVHSpace (long staticGeomCategoryMask) {
return DxBVHSpace.bvhSpaceCreate(null, 16, false, 0.2, staticGeomCategoryMask);
}
/**
* @param space space
* @param nodesPerLeaf Suggested default: 4-16
* @param highQuality Suggested default: false
* @param fatAabbMargin Suggested default: 0.2
* @param staticGeomCategoryMask Geoms that are marked as static are not checked
* for mutual collision. See SpacePerformanceTest for an example.
* @return BVH space
*/
public static DBhvSpace createBHVSpace (DSpace space, int nodesPerLeaf, boolean highQuality,
double fatAabbMargin, long staticGeomCategoryMask) {
return DxBVHSpace.bvhSpaceCreate((DxSpace) space, nodesPerLeaf, highQuality, fatAabbMargin,
public static DBVHSpace createBVHSpace (DSpace space, int nodesPerLeaf, boolean highQuality,
double fatAabbMargin, long staticGeomCategoryMask) {
return DxBVHSpace.bvhSpaceCreate((DxSpace) space, nodesPerLeaf, highQuality, fatAabbMargin,
staticGeomCategoryMask);
}

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/ode4j/ode/internal/DxBVHSpace.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.ode4j.ode.internal.aabbtree.AABBTreePairCallback;
import org.ode4j.ode.internal.aabbtree.ExternalObjectHandler;

@SuppressWarnings("deprecation")
public class DxBVHSpace extends DxSpace implements DBhvSpace {

private final AABBTree<DxGeom> bvhTree;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ public void demoSimple() {

@Test
public void demoBVH() {
System.out.printf(":::: Using %-20s ", "DBhvSpace");
demoSpace(() -> OdeHelper.createBHVSpace(0));
System.out.printf(":::: Using %-20s ", "DBVHSpace");
demoSpace(() -> OdeHelper.createBVHSpace(0));
}

private void demo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void test_performance_with_dynamic_world(int iterations, int staticGeoms
test_performance_with_dynamic_world(space, iterations, staticGeoms, geoms);
space = OdeHelper.createSapSpace2(null, AXES.XZY, STATIC_CATEGORY);
test_performance_with_dynamic_world(space, iterations, staticGeoms, geoms);
space = OdeHelper.createBHVSpace(null, 16, false, 0.2, STATIC_CATEGORY);
space = OdeHelper.createBVHSpace(null, 16, false, 0.2, STATIC_CATEGORY);
test_performance_with_dynamic_world(space, iterations, staticGeoms, geoms);
}

Expand Down Expand Up @@ -121,7 +121,7 @@ private void test_performance_with_static_world(int iterations, int staticGeoms,
System.out.println("-= Iterations: " + iterations + " Static: " + staticGeoms + " Dynamic: " + geoms + " =-");
DSpace space = OdeHelper.createSapSpace2(null, AXES.XZY, STATIC_CATEGORY);
test_performance_with_static_world(space, iterations, staticGeoms, geoms);
space = OdeHelper.createBHVSpace(null, 4, false, 0.2, STATIC_CATEGORY);
space = OdeHelper.createBVHSpace(null, 4, false, 0.2, STATIC_CATEGORY);
test_performance_with_static_world(space, iterations, staticGeoms, geoms);
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/org/ode4j/ode/DemoSpaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@ public void testSAPSpace() {
@Test
public void testBVHSpace() {
before();
space = OdeHelper.createBHVSpace(0);
space = OdeHelper.createBVHSpace(0);
demo();
after();

before();
space = OdeHelper.createBHVSpace(0);
space = OdeHelper.createBVHSpace(0);
demo();
after();
}
Expand Down
4 changes: 2 additions & 2 deletions demo-cpp/src/main/java/org/ode4j/democpp/DemoSpaceStress.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ private void demo(String[] args) {
// System.out.println(":::: Using DQuadTreeSpace");
// space = OdeHelper.createQuadTreeSpace(Center, Extents, 6);
// } else if (arg.equals("bhv")) {
System.out.println(":::: Using DBhvSpace");
space = OdeHelper.createBHVSpace(0);
System.out.println(":::: Using DBVHSpace");
space = OdeHelper.createBVHSpace(0);
// } else if (arg.equals("hash")) {
// System.out.println(":::: Using DHashSpace");
// space = OdeHelper.createHashSpace();
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/java/org/ode4j/demo/PerfCards.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private void demo(String ... args) {

//space = OdeHelper.createSimpleSpace(null);
//space = OdeHelper.createSapSpace(DSapSpace.AXES.XYZ);
space = OdeHelper.createBHVSpace(0);
space = OdeHelper.createBVHSpace(0);
contactgroup = OdeHelper.createJointGroup();
DGeom ground = OdeHelper.createPlane(space, 0, 0, 1, 0);

Expand Down