GhostControl collision with another GhostControl

I’m trying to get my player to walk over(collide) with a Box shaped Geometry that has a GhostControl attached. My player has a GhostControl attached and he is walking around the world fine because other objects have RigidBodyControls attached. The PhysicsCollisionListener I have never reports that the “player” and the “item” collide. The “item” will collide with other Rigid bodies around but not the player. Also, the listener reports the player colliding just fine. But they never collide together.

I’m trying to implement a minecraft clone to learn. I’m using the Cubes.jar library(plugin) to generate the terrain. The item I am trying to walk over and pick up is created when a block is destroyed.

Can two Spatials with GhostControls collide?

Any help or guidance is appreciated.

You should look into a plugin that does exactly that. It’s called “Bloxel world” or something like that. Even if you don’t plan to build your game on top of it, viewing its source can be inspiring.

Besides, I don’t think you need to do physics collision. I did for my game, then realized that simple non-physics collision were good enough (and less computationally intensive).
Please read http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:collision_and_intersection

1 Like

Thanks!

I finally got it working but not in an optimal way.

I found that the GhostControl attached to my items would collide with the player. But that requires me to loop over all collisions for each item. The more optimal solution would be to loop once with the player GhostControl. I can live with it for now.