Problem with CollisionShapeFactory.createCompoundShape

I have a problem with a CompoundCollisionShape:



if i use this code

[java]

Spatial robotGeom = assetManager.loadModel(“main.scene”);

robotTempNode.attachChild(robotGeom);

robotTempNode.updateGeometricState();

robotTempNode.updateModelBound();



Spatial robotNodes = robotTempNode.getChild(0);

Node n = (Node)robotNodes;

Spatial robotPart = n.getChild(name+"-node");

robotPart.removeFromParent();



robotPart.setLocalScale(0.001f);

robotPart.setLocalTranslation( robotPart.getLocalTranslation().x/1000,

robotPart.getLocalTranslation().y/1000, robotPart.getLocalTranslation().z/1000);



CompoundCollisionShape shape = new CompoundCollisionShape();

CollisionShapeFactory.createCompoundShape((Node)robotPart, shape, false);

PhysicsNode actualPhysNode = new PhysicsNode(robotPart, shape, 50);



actualPhysNode.attachDebugShape(assetManager);

actualPhysNode.updateGeometricState();

actualPhysNode.updatePhysicsState();

actualPhysNode.updateModelBound();

[/java]



the result is this:







But when use

[java] CompoundCollisionShape shape = new CompoundCollisionShape();

CollisionShapeFactory.createCompoundShape((Node)robotPart, shape, true);

PhysicsNode actualPhysNode = new PhysicsNode(robotPart, shape, 50);[/java]



the result is correct:







But the use of CompoundCollisionShape with meshAccurate at true is not the best option for movile objects.There is any problem with CollisionShapeFactory in jM3 (My libraries are updated to the latest version)? Any Idea?



Thanks for your time.

Just create the shape “by hand”, combining multiple basic collision shapes in a CompoundCollisionShape, it will yield better results than automatic generation anyway.



Cheers,

Normen