Problem with collisions

i have a problem whit collisions, when my character collides with a big object all is fine, but when my character collides with a small object the fps descrease drastically, and my game run very slow.

some screenshots:

an big object like atree.

an samll object like a mushroom.

and my code for my static models:
[java]
public void cargarModelosEscenario(String idEscenario){

     controladorBaseDatos controladorBD= new controladorBaseDatos();
     Modelo[] modelos=controladorBD.obtenerDatosAmbientePorEscenarioBD(idEscenario);
      for(int modeloActual=0;modeloActual<modelos.length;modeloActual++){
            Spatial modelo=assetManager.loadModel(modelos[modeloActual].getModeloXML());
            CollisionShape sceneShape = CollisionShapeFactory.createMeshShape((Node) modelo);
            RigidBodyControl landscape = new RigidBodyControl(sceneShape, 0);
             modelo.addControl(landscape);  
             bulletAppState.getPhysicsSpace().add(landscape);
         }

nodoPadre.attachChild(modelo);
}
[/java]

my code for my character:
[java]
private CharacterControl controlNPC;
private Node nodoPrincipal= new Node();
private Spatial npc ;

public void simpleInitApp() {   

bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
stateManager.attach(bulletAppState);
                ....
                ....

}
private void cargarNPC(){
npc = assetManager.loadModel("Models/otromesh/Cube.002.mesh.xml");
Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
material.setTexture("ColorMap", assetManager.loadTexture("Textures/madera.jpg"));
npc.setMaterial(material);
npc.setLocalTranslation(-100f, 5f, 10f);
npc.scale(.15f);
nodoPrincipal.attachChild(npc);

npc.addControl(controlNPC);
  bulletAppState.getPhysicsSpace().add(controlNPC);

}

 private void crearFisicaNPC(){              //agregando  fisica al bicho------------------------------
CapsuleCollisionShape capsuleShape2 = new CapsuleCollisionShape(1f, 0f, 1);

controlNPC = new CharacterControl(capsuleShape2, 1f);
controlNPC.setJumpSpeed(20);
controlNPC.setFallSpeed(30);
controlNPC.setGravity(30);
npc.addControl(controlNPC);
bulletAppState.getPhysicsSpace().add(controlNPC);
}
[/java]

if i resize my mushroom to make it biger, it work fine.
if many objects collide with my character i have the same problem.

i hope somebody help me, and sorry for my bad english.

[java]CapsuleCollisionShape capsuleShape2 = new CapsuleCollisionShape(1f, 0f, 1);[/java]

your character has 0 height :-/

I also suggest you use:

[java]bulletAppState.getPhysicsSpace().enableDebug (assetManager);[/java] so that you can see your collisionshapes in more detail.

Bullet has a hard time with collisions involving very small triangles

a low performance is normal?

a screenshot:

is your first issue solved?

It depends on your hardware, you have 375 objects, try lower that by batching

i need increase the perfomance when my character cillide with small objects,
Is there any way to increase the size of the triangles?

That’s only really an issue for your original post (in physical collisions), but using simpler collision shapes would help regardless

Also:

@wezrule said: you have 375 objects, try lower that by batching
@eypidemik said: i need increase the perfomance when my character cillide with small objects, Is there any way to increase the size of the triangles?
Just don't wrap them with a mesh. Mark them with UserData or something and then make them boxes or hulls or something similar.

Mark them with UserData? i don’t understand that.

thanks i used boxshape for small objects