MinieLibrary/src/main/java/com/jme3/bullet/animation/DacLinks.java
/**
     * Remove spatial-dependent data. Invoked each time this control is rebuilt
     * or removed from a Spatial.
     *
     * @param spatial the Spatial to which this Control was added (unused)
     */
Remove spatial-dependent data. Invoked each time this control is rebuilt
or removed from a Spatial.

@param spatial the Spatial to which this Control was added (unused)
Remove spatial - dependent data . Invoked each time this control is rebuilt or removed from a Spatial . @param spatial the Spatial to which this Control was added ( unused )
@Override
    protected void removeSpatialData(Spatial spatial) {
        if (added) {
            removePhysics();
        }
        for (AttachmentLink attachmentLink : attachmentLinks.values()) {
            Node node;
            Joint armatureJoint = attachmentLink.getArmatureJoint();
            if (armatureJoint == null) {
                Bone bone = attachmentLink.getBone();
                node = MySkeleton.getAttachments(bone);
                MySkeleton.cancelAttachments(bone);
            } else {
                node = MySkeleton.getAttachments(armatureJoint);
                MySkeleton.cancelAttachments(armatureJoint);
            }
            node.removeFromParent();
        }
        attachmentLinks.clear();
        armature = null;
        if (skeleton != null) {
            MySkeleton.setUserControl(skeleton, false);
            skeleton = null;
        }
        boneLinks.clear();
        boneLinkList = null;
        torsoLink = null;
        transformer = null;
    }
@ Override protected void removeSpatialData ( Spatial spatial ) { if ( added ) { removePhysics ( ) ; } for ( AttachmentLink attachmentLink : attachmentLinks . values ( ) ) { Node node ; Joint armatureJoint = attachmentLink . getArmatureJoint ( ) ; if ( armatureJoint == null ) { Bone bone = attachmentLink . getBone ( ) ; node = MySkeleton . getAttachments ( bone ) ; MySkeleton . cancelAttachments ( bone ) ; } else { node = MySkeleton . getAttachments ( armatureJoint ) ; MySkeleton . cancelAttachments ( armatureJoint ) ; } node . removeFromParent ( ) ; } attachmentLinks . clear ( ) ; armature = null ; if ( skeleton != null ) { MySkeleton . setUserControl ( skeleton , false ) ; skeleton = null ; } boneLinks . clear ( ) ; boneLinkList = null ; torsoLink = null ; transformer = null ; }
Remove spatial-dependent data.
Remove spatial - dependent data .