Native Bullet sweepTest

Would I be right in assuming that sweepTest has not yet been implemented in Native Bullet, as per this post?

I’ll go ahead and try to JNI it into JME3 if not.



I believe its already in there, but thanks

The ray is definitly in, I’m 100% sure of that ^^
I think sweep is also there, but never used it.

* Performs a sweep collision test and returns the results as a list of PhysicsSweepTestResults<br/>
* You have to use different Transforms for start and end (at least distance > 0.4f).
* SweepTest will not see a collision if it starts INSIDE an object and is moving AWAY from its center.
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end) {
List<PhysicsSweepTestResult> results = new LinkedList<PhysicsSweepTestResult>();
// if (!(shape.getCShape() instanceof ConvexShape)) {
// Logger.getLogger(PhysicsSpace.class.getName()).log(Level.WARNING, “Trying to sweep test with incompatible mesh shape!”);
// return results;
// }
// dynamicsWorld.convexSweepTest((ConvexShape) shape.getCShape(), Converter.convert(start, sweepTrans1), Converter.convert(end, sweepTrans2), new InternalSweepListener(results));
return results;


Ray is definitely implemented, but as you can see sweepTest returns an empty list.

1 Like


Does someone plan to add some support of the sweep test into JMonkeyEngine 3? It is useful for the continuous collision detection.

Well whoever needs it most will probably end up implementing it ^^