public void attachBones(final GVRPose savepose)
    {
        GVRSceneObject owner = getOwnerObject();

        if (owner == null)
        {
            return;
        }
        GVRSceneObject.SceneVisitor visitor = new GVRSceneObject.SceneVisitor()
        {
            @Override
            public boolean visit(GVRSceneObject newbone)
            {
                String bonename = newbone.getName();

                if (bonename.isEmpty())            // ignore nodes without names
                    return true;
                int boneindex = getBoneIndex(bonename);
                if (boneindex >= 0)                // a bone we recognize?
                {
                    mBones[boneindex] = newbone;
                    if (savepose != null)
                    {
                        savepose.setWorldMatrix(boneindex, newbone.getTransform().getModelMatrix4f());
                    }
                }
                return true;
            }
        };
        owner.forAllDescendants(visitor);
    }
public void attachBones ( final GVRPose savepose ) { GVRSceneObject owner = getOwnerObject ( ) ; if ( owner == null ) { return ; } GVRSceneObject . SceneVisitor visitor = new GVRSceneObject . SceneVisitor ( ) { @ Override public boolean visit ( GVRSceneObject newbone ) { String bonename = newbone . getName ( ) ; if ( bonename . isEmpty ( ) ) return true ; int boneindex = getBoneIndex ( bonename ) ; if ( boneindex >= 0 ) { mBones [ boneindex ] = newbone ; if ( savepose != null ) { savepose . setWorldMatrix ( boneindex , newbone . getTransform ( ) . getModelMatrix4f ( ) ) ; } } return true ; } } ; owner . forAllDescendants ( visitor ) ; }
Links the bones in the skeleton with scene nodes in the owner's hierarchy.
<p>
Examines the descendants of the skeleton owner looking for nodes whose names match the
bones in the skeleton. This function assumes the hierarchy below the owner contains
the nodes to animate to control the skeleton in the scene.
The input pose will have the positions and rotations of the nodes.