MinieExamples/src/main/java/jme3utilities/minie/test/TestDac.java
/**
     * Update the animation pose and apply it to all bones except the main root
     * bone.
     */
Update the animation pose and apply it to all bones except the main root
bone.
Update the animation pose and apply it to all bones except the main root bone .
private void matchAnimPose() {
        assert animPose != null;
        /*
         * Update the animation pose.
         */
        Spatial controlledSpatial = sc.getSpatial();
        AnimComposer composer
                = controlledSpatial.getControl(AnimComposer.class);
        AnimClip clip = composer.getAnimClip(animationName);
        double time = composer.getTime(AnimComposer.DEFAULT_LAYER);
        animPose.setToClip(clip, time);
        Vector3f acceleration = Vector3f.ZERO;
        /*
         * Ensure that all attachment links are dynamic.
         */
        for (AttachmentLink link : dac.listLinks(AttachmentLink.class)) {
            link.setDynamic(acceleration);
        }
        Transform tmpTransform = new Transform();
        /*
         * Apply the animation pose to the torso's managed bones.
         */
        TorsoLink torsoLink = dac.getTorsoLink();
        int numManagedBones = torsoLink.countManaged();
        for (int mbIndex = 1; mbIndex < numManagedBones; ++mbIndex) {
            int boneIndex = torsoLink.boneIndex(mbIndex);
            animPose.localTransform(boneIndex, tmpTransform);
            torsoLink.setLocalTransform(mbIndex, tmpTransform);
        }
        /*
         * Apply the animation pose to all bone links and their managed bones.
         */
        for (BoneLink boneLink : dac.listLinks(BoneLink.class)) {
            int boneIndex = boneLink.boneIndex(0); 
            Quaternion userRotation = tmpTransform.getRotation();
            animPose.userRotation(boneIndex, userRotation);
            boneLink.setDynamic(acceleration, userRotation);
            numManagedBones = boneLink.countManaged();
            for (int mbIndex = 1; mbIndex < numManagedBones; ++mbIndex) {
                boneIndex = boneLink.boneIndex(mbIndex);
                animPose.localTransform(boneIndex, tmpTransform);
                boneLink.setLocalTransform(mbIndex, tmpTransform);
            }
        }
    }
private void matchAnimPose ( ) { assert animPose != null ; /*
         * Update the animation pose.
         */ Spatial controlledSpatial = sc . getSpatial ( ) ; AnimComposer composer = controlledSpatial . getControl ( AnimComposer . class ) ; AnimClip clip = composer . getAnimClip ( animationName ) ; double time = composer . getTime ( AnimComposer . DEFAULT_LAYER ) ; animPose . setToClip ( clip , time ) ; Vector3f acceleration = Vector3f . ZERO ; /*
         * Ensure that all attachment links are dynamic.
         */ for ( AttachmentLink link : dac . listLinks ( AttachmentLink . class ) ) { link . setDynamic ( acceleration ) ; } Transform tmpTransform = new Transform ( ) ; /*
         * Apply the animation pose to the torso's managed bones.
         */ TorsoLink torsoLink = dac . getTorsoLink ( ) ; int numManagedBones = torsoLink . countManaged ( ) ; for ( int mbIndex = 1 ; mbIndex < numManagedBones ; ++ mbIndex ) { int boneIndex = torsoLink . boneIndex ( mbIndex ) ; animPose . localTransform ( boneIndex , tmpTransform ) ; torsoLink . setLocalTransform ( mbIndex , tmpTransform ) ; } /*
         * Apply the animation pose to all bone links and their managed bones.
         */ for ( BoneLink boneLink : dac . listLinks ( BoneLink . class ) ) { int boneIndex = boneLink . boneIndex ( 0 ) ; Quaternion userRotation = tmpTransform . getRotation ( ) ; animPose . userRotation ( boneIndex , userRotation ) ; boneLink . setDynamic ( acceleration , userRotation ) ; numManagedBones = boneLink . countManaged ( ) ; for ( int mbIndex = 1 ; mbIndex < numManagedBones ; ++ mbIndex ) { boneIndex = boneLink . boneIndex ( mbIndex ) ; animPose . localTransform ( boneIndex , tmpTransform ) ; boneLink . setLocalTransform ( mbIndex , tmpTransform ) ; } } }
Update the animation pose and apply it to all bones except the main root
 bone.
Update the animation pose and apply it to all bones except the main root bone .
// the linked bone
