Ghost control always reporting collision with scene

This is my player control i am coding

That is a RigidBody with the small cube a Ghost Control to detect if the player is on the ground or not.

The problem i am having is that the ghost Control reports a collision with the scene, if it is anywhere within the maximum bounds of the scene:

So anywhere in that red cube the ghost reports collision with the scene.

What the code looks like:
[java]
CollisionShape playerShape = new CapsuleCollisionShape(0.7f, 1.6f);
player = new RigidBodyControl(playerShape, 50);
CollisionShape cuboid = new BoxCollisionShape(cuboidSize);
onGroundTest = new GhostControl(cuboid);

    player.setCollisionGroup(RigidBodyControl.COLLISION_GROUP_02);
    player.setCollideWithGroups(RigidBodyControl.COLLISION_GROUP_01);
    onGroundTest.setCollisionGroup(RigidBodyControl.COLLISION_GROUP_02);
    onGroundTest.setCollideWithGroups(RigidBodyControl.COLLISION_GROUP_01);

[/java]
I change collision groups so the ghost wont report collisions with the player RigidBody
These are then added to the scene.

I think the problem lies with how i initialise the scene:
[java] float scale = 10;

    Spatial scene = app.getAssetManager().loadModel("Scenes/test.j3o");
    scene.scale(scale);
    sceneNode.attachChild(scene);
    
    RigidBodyControl sceneCollision = new RigidBodyControl(CollisionShapeFactory.createMeshShape(scene) , 0);
    app.getBullet().getPhysicsSpace().add(sceneCollision);

    sceneNode.addControl(sceneCollision);
    app.getRootNode().attachChild(sceneNode);
    app.getBullet().getPhysicsSpace().enableDebug(app.getAssetManager());[/java]

If this is the case, how could i initialise the scene for correct ghost collision reports?
Thanks.

Ghost controls use the AxisAlignedBoundingBox for overlaps, there is no workaround.

Hey,

i got the same problem. What can i manage this? is there a differen approacht(maybe without ghostcontrol)?
i my case i use the ghostcontrol to detect a bullet(a small box) collition. i need to know when the bullet hit(realy) the level(CompoundCollisionShape).

thx & greatings

stefan

hey stevie instead of GhostControll write a class that extends GhostControll an implements PhysicsCollisionListener.

like this and everything works like expected

[java]
public class MyCustomControl extends GhostControl implements PhysicsCollisionListener {

    MyCustomControl me;

    public MyCustomControl(BoxCollisionShape b) {
        super(b);
        me = this;
    }

    public void collision(PhysicsCollisionEvent event) {
        Object other = null;
        if (event.getObjectA() == this) {
            other = event.getObjectB();
        } else if (event.getObjectB() == this) {
            other = event.getObjectA();
        }
        if(other==null){
            return;
        }
    // PUT IN HERE YOUR COLLITION HANDLING 
    }
}

[/java]