MinieLibrary/src/main/java/com/jme3/bullet/MultiBody.java
/**
     * De-serialize this object from the specified importer, for example when
     * loading from a J3O file.
     *
     * @param importer (not null)
     * @throws IOException from the importer
     */
De-serialize this object from the specified importer, for example when
loading from a J3O file.

@param importer (not null)
@throws IOException from the importer
De - serialize this object from the specified importer for example when loading from a J3O file . @param importer ( not null ) @throws IOException from the importer
@Override
    public void read(JmeImporter importer) throws IOException {
        InputCapsule capsule = importer.getCapsule(this);
        Vector3f baseInertia
                = (Vector3f) capsule.readSavable(tagBaseInertia, null);
        float baseMass = capsule.readFloat(tagBaseMass, 1f);
        boolean canSleep = capsule.readBoolean(tagCanSleep, true);
        boolean fixedBase = capsule.readBoolean(tagFixedBase, false);
        int numLinks = capsule.readInt(tagNumLinks, 0);
        long multiBodyId
                = create(numLinks, baseMass, baseInertia, fixedBase, canSleep);
        setNativeId(multiBodyId);
        if (baseCollider != null) {
            CollisionShape baseShape = baseCollider.getCollisionShape();
            baseCollider = null;
            addBaseCollider(baseShape);
        }
        MultiBodyLink[] originalLinks = links;
        links = new MultiBodyLink[numLinks];
        numConfigured = capsule.readInt(tagNumConfigured, 0);
        for (int i = 0; i < numConfigured; ++i) {
            configureClonedLink(originalLinks[i]);
        }
        finalizeMultiDof(multiBodyId);
        int collisionGroup = capsule.readInt(tagCollisionGroup,
                PhysicsCollisionObject.COLLISION_GROUP_01);
        setCollisionGroup(collisionGroup);
        int collideWithGroups = capsule.readInt(tagCollisionGroupsMask,
                PhysicsCollisionObject.COLLISION_GROUP_01);
        setCollideWithGroups(collideWithGroups);
        Vector3f angularVelocity
                = (Vector3f) capsule.readSavable(tagBaseAngularVelocity, null);
        setBaseAngularVelocity(angularVelocity);
        Vector3f location
                = (Vector3f) capsule.readSavable(tagBaseLocation, null);
        setBaseLocation(location);
        Vector3f velocity
                = (Vector3f) capsule.readSavable(tagBaseVelocity, null);
        setBaseVelocity(velocity);
    }
@ Override public void read ( JmeImporter importer ) throws IOException { InputCapsule capsule = importer . getCapsule ( this ) ; Vector3f baseInertia = ( Vector3f ) capsule . readSavable ( tagBaseInertia , null ) ; float baseMass = capsule . readFloat ( tagBaseMass , 1f ) ; boolean canSleep = capsule . readBoolean ( tagCanSleep , true ) ; boolean fixedBase = capsule . readBoolean ( tagFixedBase , false ) ; int numLinks = capsule . readInt ( tagNumLinks , 0 ) ; long multiBodyId = create ( numLinks , baseMass , baseInertia , fixedBase , canSleep ) ; setNativeId ( multiBodyId ) ; if ( baseCollider != null ) { CollisionShape baseShape = baseCollider . getCollisionShape ( ) ; baseCollider = null ; addBaseCollider ( baseShape ) ; } MultiBodyLink [ ] originalLinks = links ; links = new MultiBodyLink [ numLinks ] ; numConfigured = capsule . readInt ( tagNumConfigured , 0 ) ; for ( int i = 0 ; i < numConfigured ; ++ i ) { configureClonedLink ( originalLinks [ i ] ) ; } finalizeMultiDof ( multiBodyId ) ; int collisionGroup = capsule . readInt ( tagCollisionGroup , PhysicsCollisionObject . COLLISION_GROUP_01 ) ; setCollisionGroup ( collisionGroup ) ; int collideWithGroups = capsule . readInt ( tagCollisionGroupsMask , PhysicsCollisionObject . COLLISION_GROUP_01 ) ; setCollideWithGroups ( collideWithGroups ) ; Vector3f angularVelocity = ( Vector3f ) capsule . readSavable ( tagBaseAngularVelocity , null ) ; setBaseAngularVelocity ( angularVelocity ) ; Vector3f location = ( Vector3f ) capsule . readSavable ( tagBaseLocation , null ) ; setBaseLocation ( location ) ; Vector3f velocity = ( Vector3f ) capsule . readSavable ( tagBaseVelocity , null ) ; setBaseVelocity ( velocity ) ; }
De-serialize this object from the specified importer, for example when
 loading from a J3O file.
De - serialize this object from the specified importer for example when loading from a J3O file .