Bug in PhysicsNode (Jme-physics)

Hi jme developers,the method of com.jmex.physics.PhysicsNode  is wrong. if the physicsnode have a empty node child, the load method fail in Importer.


  private void reassignMaterials( Node root ) {
        if ( getChildren() != null ) {   <<-- PROBLEM is root.getChildren() for recursive use
                for ( Spatial child : root.getChildren() ) {  
                        if ( child instanceof PhysicsCollisionGeometry ) {
                                        PhysicsCollisionGeometry physicsCollisionGeometry = ( PhysicsCollisionGeometry ) child;
                                        physicsCollisionGeometry.setMaterial( physicsCollisionGeometry.getMaterial() );  <-- PROBLEM is getMaterial() only, physicsCollisionGeometry.getMaterial() is null
                                }
                        if ( child instanceof Node ) {
                                reassignMaterials( ( Node ) child );
                                }
                }
        }
        }



Well, as it is now there is nobody maintaining jmePhysics anymore. So if you want this fixed you will have to do so yourself :frowning:



Cheers,

Normen