MinieLibrary/src/test/java/jme3utilities/minie/test/TestDefaults.java
/**
     * Test the defaults that are common to all newly-created collision objects.
     *
     * @param pco the object to test (not null, unaffected)
     */
Test the defaults that are common to all newly-created collision objects.
@param pco the object to test (not null, unaffected)
Test the defaults that are common to all newly - created collision objects . @param pco the object to test ( not null unaffected )
private void testPco(PhysicsCollisionObject pco) {
        long id = pco.nativeId();
        Assert.assertNotEquals(0L, id);
        Assert.assertEquals(pco, PhysicsCollisionObject.findInstance(id));
        Assert.assertEquals(0, pco.countIgnored());
        Assert.assertTrue(pco.isActive());
        Assert.assertFalse(pco.isInWorld());
        MinieTest.assertEquals(1f, 1f, 1f,
                pco.getAnisotropicFriction(null), 0f);
        Assert.assertFalse(pco.hasAnisotropicFriction(1));
        Assert.assertFalse(pco.hasAnisotropicFriction(2));
        Assert.assertNull(pco.getApplicationData());
        Assert.assertEquals(0f, pco.getCcdMotionThreshold(), 0f);
        Assert.assertEquals(0f, pco.getCcdSquareMotionThreshold(), 0f);
        Assert.assertEquals(0f, pco.getCcdSweptSphereRadius(), 0f);
        Assert.assertEquals(PhysicsCollisionObject.COLLISION_GROUP_01,
                pco.getCollideWithGroups());
        Assert.assertEquals(PhysicsCollisionObject.COLLISION_GROUP_01,
                pco.getCollisionGroup());
        Assert.assertNull(pco.getCollisionSpace());
        Assert.assertEquals(0.1f, pco.getContactDamping(), 0f);
        float largeFloat = NativeLibrary.isDoublePrecision() ? 1e30f : 1e18f;
        Assert.assertEquals(largeFloat,
                pco.getContactProcessingThreshold(), 0f);
        Assert.assertEquals(largeFloat, pco.getContactStiffness(), 0f);
        Assert.assertEquals(0f, pco.getDeactivationTime(), 0f);
        Assert.assertNull(pco.getDebugMaterial());
        Assert.assertNull(pco.debugMeshInitListener());
        Assert.assertSame(DebugMeshNormals.None, pco.debugMeshNormals());
        Assert.assertEquals(DebugShapeFactory.lowResolution,
                pco.debugMeshResolution());
        Assert.assertEquals(1, pco.debugNumSides());
        Assert.assertEquals(0.5f, pco.getFriction(), 0f);
        MinieTest.assertEquals(0f, 0f, 0f, pco.getPhysicsLocation(null), 0f);
        MinieTest.assertEquals(0f, 0f, 0f, 1f,
                pco.getPhysicsRotation(null), 0f);
        Assert.assertNull(pco.proxyGroup());
        Assert.assertNull(pco.proxyMask());
        Assert.assertEquals(0f, pco.getRestitution(), 0f);
        Assert.assertEquals(0f, pco.getRollingFriction(), 0f);
        Assert.assertEquals(0f, pco.getSpinningFriction(), 0f);
        Assert.assertNull(pco.getUserObject());
    }
private void testPco ( PhysicsCollisionObject pco ) { long id = pco . nativeId ( ) ; Assert . assertNotEquals ( 0L , id ) ; Assert . assertEquals ( pco , PhysicsCollisionObject . findInstance ( id ) ) ; Assert . assertEquals ( 0 , pco . countIgnored ( ) ) ; Assert . assertTrue ( pco . isActive ( ) ) ; Assert . assertFalse ( pco . isInWorld ( ) ) ; MinieTest . assertEquals ( 1f , 1f , 1f , pco . getAnisotropicFriction ( null ) , 0f ) ; Assert . assertFalse ( pco . hasAnisotropicFriction ( 1 ) ) ; Assert . assertFalse ( pco . hasAnisotropicFriction ( 2 ) ) ; Assert . assertNull ( pco . getApplicationData ( ) ) ; Assert . assertEquals ( 0f , pco . getCcdMotionThreshold ( ) , 0f ) ; Assert . assertEquals ( 0f , pco . getCcdSquareMotionThreshold ( ) , 0f ) ; Assert . assertEquals ( 0f , pco . getCcdSweptSphereRadius ( ) , 0f ) ; Assert . assertEquals ( PhysicsCollisionObject . COLLISION_GROUP_01 , pco . getCollideWithGroups ( ) ) ; Assert . assertEquals ( PhysicsCollisionObject . COLLISION_GROUP_01 , pco . getCollisionGroup ( ) ) ; Assert . assertNull ( pco . getCollisionSpace ( ) ) ; Assert . assertEquals ( 0.1f , pco . getContactDamping ( ) , 0f ) ; float largeFloat = NativeLibrary . isDoublePrecision ( ) ? 1e30f : 1e18f ; Assert . assertEquals ( largeFloat , pco . getContactProcessingThreshold ( ) , 0f ) ; Assert . assertEquals ( largeFloat , pco . getContactStiffness ( ) , 0f ) ; Assert . assertEquals ( 0f , pco . getDeactivationTime ( ) , 0f ) ; Assert . assertNull ( pco . getDebugMaterial ( ) ) ; Assert . assertNull ( pco . debugMeshInitListener ( ) ) ; Assert . assertSame ( DebugMeshNormals . None , pco . debugMeshNormals ( ) ) ; Assert . assertEquals ( DebugShapeFactory . lowResolution , pco . debugMeshResolution ( ) ) ; Assert . assertEquals ( 1 , pco . debugNumSides ( ) ) ; Assert . assertEquals ( 0.5f , pco . getFriction ( ) , 0f ) ; MinieTest . assertEquals ( 0f , 0f , 0f , pco . getPhysicsLocation ( null ) , 0f ) ; MinieTest . assertEquals ( 0f , 0f , 0f , 1f , pco . getPhysicsRotation ( null ) , 0f ) ; Assert . assertNull ( pco . proxyGroup ( ) ) ; Assert . assertNull ( pco . proxyMask ( ) ) ; Assert . assertEquals ( 0f , pco . getRestitution ( ) , 0f ) ; Assert . assertEquals ( 0f , pco . getRollingFriction ( ) , 0f ) ; Assert . assertEquals ( 0f , pco . getSpinningFriction ( ) , 0f ) ; Assert . assertNull ( pco . getUserObject ( ) ) ; }
Test the defaults that are common to all newly-created collision objects.
Test the defaults that are common to all newly - created collision objects .