MinieLibrary/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java
/**
     * Serialize this object to the specified exporter, for example when saving
     * to a J3O file.
     *
     * @param exporter (not null)
     * @throws IOException from the exporter
     */
Serialize this object to the specified exporter, for example when saving
to a J3O file.

@param exporter (not null)
@throws IOException from the exporter
Serialize this object to the specified exporter for example when saving to a J3O file . @param exporter ( not null ) @throws IOException from the exporter
@Override
    public void write(JmeExporter exporter) throws IOException {
        OutputCapsule capsule = exporter.getCapsule(this);
        capsule.write(collisionGroup, tagCollisionGroup, COLLISION_GROUP_01);
        capsule.write(collideWithGroups, tagCollisionGroupsMask,
                COLLISION_GROUP_01);
        capsule.write(debugMeshNormals, tagDebugMeshNormals,
                DebugMeshNormals.None);
        capsule.write(debugMeshResolution, tagDebugMeshResolution, 0);
        capsule.write(debugMaterial, tagDebugMaterial, null);
        capsule.write(collisionShape, tagCollisionShape, null);
        if (applicationData instanceof Savable) {
            capsule.write((Savable) applicationData, tagApplicationData, null);
        }
        if (userObject instanceof Savable) {
            capsule.write((Savable) userObject, tagUserObject, null);
        }
        capsule.write(getCcdMotionThreshold(), tagCcdMotionThreshold, 0f);
        capsule.write(getCcdSweptSphereRadius(), tagCcdSweptSphereRadius, 0f);
        capsule.write(getContactDamping(), tagContactDamping, 0.1f);
        capsule.write(getContactProcessingThreshold(),
                tagContactProcessingThreshold, 0f);
        capsule.write(getContactStiffness(), tagContactStiffness, 1e30f);
        capsule.write(getDeactivationTime(), tagDeactivationTime, 0f);
        capsule.write(getFriction(), tagFriction, 0.5f);
        capsule.write(getRestitution(), tagRestitution, 0f);
        capsule.write(getRollingFriction(), tagRollingFriction, 0f);
        capsule.write(getSpinningFriction(), tagSpinningFriction, 0f);
        int mode = AfMode.none;
        if (hasAnisotropicFriction(AfMode.basic)) {
            mode = AfMode.basic;
        } else if (hasAnisotropicFriction(AfMode.rolling)) {
            mode = AfMode.rolling;
        }
        capsule.write(mode, tagAnisotropicFrictionMode, AfMode.none);
        if (mode != AfMode.none) {
            Vector3f components = getAnisotropicFriction(null);
            capsule.write(components, tagAnisotropicFrictionComponents, null);
        }
        long[] ignoredIds = listIgnoredIds();
        int numIgnored = ignoredIds.length;
        Savable[] ignoreList = new Savable[numIgnored];
        for (int index = 0; index < numIgnored; ++index) {
            long pcoId = ignoredIds[index];
            ignoreList[index] = PhysicsCollisionObject.findInstance(pcoId);
        }
        capsule.write(ignoreList, tagIgnoreList, null);
    }
@ Override public void write ( JmeExporter exporter ) throws IOException { OutputCapsule capsule = exporter . getCapsule ( this ) ; capsule . write ( collisionGroup , tagCollisionGroup , COLLISION_GROUP_01 ) ; capsule . write ( collideWithGroups , tagCollisionGroupsMask , COLLISION_GROUP_01 ) ; capsule . write ( debugMeshNormals , tagDebugMeshNormals , DebugMeshNormals . None ) ; capsule . write ( debugMeshResolution , tagDebugMeshResolution , 0 ) ; capsule . write ( debugMaterial , tagDebugMaterial , null ) ; capsule . write ( collisionShape , tagCollisionShape , null ) ; if ( applicationData instanceof Savable ) { capsule . write ( ( Savable ) applicationData , tagApplicationData , null ) ; } if ( userObject instanceof Savable ) { capsule . write ( ( Savable ) userObject , tagUserObject , null ) ; } capsule . write ( getCcdMotionThreshold ( ) , tagCcdMotionThreshold , 0f ) ; capsule . write ( getCcdSweptSphereRadius ( ) , tagCcdSweptSphereRadius , 0f ) ; capsule . write ( getContactDamping ( ) , tagContactDamping , 0.1f ) ; capsule . write ( getContactProcessingThreshold ( ) , tagContactProcessingThreshold , 0f ) ; capsule . write ( getContactStiffness ( ) , tagContactStiffness , 1e30f ) ; capsule . write ( getDeactivationTime ( ) , tagDeactivationTime , 0f ) ; capsule . write ( getFriction ( ) , tagFriction , 0.5f ) ; capsule . write ( getRestitution ( ) , tagRestitution , 0f ) ; capsule . write ( getRollingFriction ( ) , tagRollingFriction , 0f ) ; capsule . write ( getSpinningFriction ( ) , tagSpinningFriction , 0f ) ; int mode = AfMode . none ; if ( hasAnisotropicFriction ( AfMode . basic ) ) { mode = AfMode . basic ; } else if ( hasAnisotropicFriction ( AfMode . rolling ) ) { mode = AfMode . rolling ; } capsule . write ( mode , tagAnisotropicFrictionMode , AfMode . none ) ; if ( mode != AfMode . none ) { Vector3f components = getAnisotropicFriction ( null ) ; capsule . write ( components , tagAnisotropicFrictionComponents , null ) ; } long [ ] ignoredIds = listIgnoredIds ( ) ; int numIgnored = ignoredIds . length ; Savable [ ] ignoreList = new Savable [ numIgnored ] ; for ( int index = 0 ; index < numIgnored ; ++ index ) { long pcoId = ignoredIds [ index ] ; ignoreList [ index ] = PhysicsCollisionObject . findInstance ( pcoId ) ; } capsule . write ( ignoreList , tagIgnoreList , null ) ; }
Serialize this object to the specified exporter, for example when saving
 to a J3O file.
Serialize this object to the specified exporter for example when saving to a J3O file .
// common properties