How to create a 0 bounceness floor?

im trying to make my player not bounce at all. so i set the player's bounceness to 0. but it still bounces a little.



so i try to add a material with 0 bounceness to the floor in lessen 8, but it throws me NPEs…



code i added in createBox():


        Material m = new Material("New");
        m.setDensity(1);
        MutableContactInfo contactDetails = new MutableContactInfo();
        contactDetails.setBounce(0);
        contactDetails.setMu(1000f);
        m.putContactHandlingDetails(Material.DEFAULT, contactDetails);
        DynamicPhysicsNode dynamicNode = getPhysicsSpace().createDynamicNode();
        dynamicNode.setMaterial(m);



The code i added in createFloor():


        Material m = new Material("f");
        m.setDensity(1);
        MutableContactInfo contactDetails = new MutableContactInfo();
        contactDetails.setBounce(0);
        contactDetails.setMu(1000f);
        m.putContactHandlingDetails(Material.DEFAULT, contactDetails);
        floor.setMaterial(m);



Exception:


java.lang.NullPointerException
   at com.jmex.physics.material.Material.getContactHandlingDetails(Material.java:318)
   at com.jmex.physics.material.MaterialContactCallback.adjustContact(MaterialContactCallback.java:67)
   at com.jmex.physics.PhysicsSpace.adjustContact(PhysicsSpace.java:125)
   at com.jmex.physics.impl.ode.OdePhysicsSpace.iterateContacts(OdePhysicsSpace.java:829)
   at com.jmex.physics.impl.ode.OdePhysicsSpace.computeTimeStep(OdePhysicsSpace.java:756)
   at com.jmex.physics.impl.ode.OdePhysicsSpace.update(OdePhysicsSpace.java:589)
   at com.jmex.physics.util.SimplePhysicsGame.update(SimplePhysicsGame.java:141)
   at com.jme.app.BaseGame.start(BaseGame.java:79)
   at theSightOfChaos.test.physics.Lesson8.main(Lesson8.java:284)

NPE should be fixed in CVS.



You need to define the bounciness for a material pair. So bounciness for player vs. floor must be 0. The player itself does not have a bounciness.