How to use Bullet ghost objects?

Anything libgdx related goes here!

How to use Bullet ghost objects?

Postby Blue_CP » Tue Nov 13, 2018 7:52 pm

So I went and did some research on how to get ghost objects to work in Bullet. There was nothing about the Java port of it, so I tried to translate some of the C++ code I found into Java. However, there were multiple problems I ran into.

First, the C++ version of Bullet uses a type called btAlignedObjectArray which doesn't have a corresponding type in the Java port. Second, there's a line in the C++ code which says this:
Code: Select all
if (ghost) {
Where ghost is an instance of btGhostObject. This makes zero sense to me, this statement just doesn't work in Java.

After this, I tried using ghostObj.getNumOverlappingObjects() and ghostObj.getOverlappingObject(0) instead of the 9 or so lines that were used for collision detection in the C++ code, because to be honest that was the only idea I had to make it work. Well, that didn't work either.

And there's not exactly much to go off of in the source code. As far as I can see, using getNumOverlappingObjects() should work, but I know for a fact that's not true.

Could someone please explain how to setup and test collisions for ghost objects?
Posts: 6
Joined: Sat Sep 29, 2018 10:03 pm

Return to Libgdx

Who is online

Users browsing this forum: Google [Bot] and 1 guest