MinieLibrary/src/main/java/com/jme3/bullet/animation/DacLinks.java
/**
     * Create a jointless BoneLink for the named bone/joint, and add it to the
     * boneLinks map.
     *
     * @param boneName the name of the bone/joint to be linked (not null)
     * @param vertexLocations the set of vertex locations (not null, not empty)
     */
Create a jointless BoneLink for the named bone/joint, and add it to the
boneLinks map.

@param boneName the name of the bone/joint to be linked (not null)
@param vertexLocations the set of vertex locations (not null, not empty)
Create a jointless BoneLink for the named bone / joint and add it to the boneLinks map . @param boneName the name of the bone / joint to be linked ( not null ) @param vertexLocations the set of vertex locations ( not null not empty )
private void createBoneLink(String boneName, VectorSet vertexLocations) {
        if (vertexLocations == null || vertexLocations.numVectors() == 0) {
            String msg = String.format("No mesh vertices for linked bone %s.",
                    MyString.quote(boneName));
            throw new IllegalArgumentException(msg);
        }
        Bone bone = null;
        Joint joint = null;
        Transform boneToMesh;
        if (skeleton != null) {
            bone = findBone(boneName);
            boneToMesh = MySkeleton.copyMeshTransform(bone, null);
        } else {
            joint = findArmatureJoint(boneName);
            boneToMesh = joint.getModelTransform();
        }
        Transform meshToBone = boneToMesh.invert();
        LinkConfig linkConfig = config(boneName);
        /*
         * Create the CollisionShape and locate the center of mass.
         */
        Vector3f center;
        CenterHeuristic centerHeuristic = linkConfig.centerHeuristic();
        if (centerHeuristic == CenterHeuristic.Joint) {
            center = translateIdentity;
        } else {
            center = centerHeuristic.center(vertexLocations, null);
            center.subtractLocal(boneToMesh.getTranslation());
        }
        CollisionShape shape;
        shape = linkConfig.createShape(meshToBone, center, vertexLocations);
        meshToBone.getTranslation().zero();
        Vector3f offset = meshToBone.transformVector(center, null);
        BoneLink link;
        if (skeleton != null) {
            link = new BoneLink(this, bone, shape, linkConfig, offset);
        } else {
            link = new BoneLink(this, joint, shape, linkConfig, offset);
        }
        boneLinks.put(boneName, link);
    }
private void createBoneLink ( String boneName , VectorSet vertexLocations ) { if ( vertexLocations == null || vertexLocations . numVectors ( ) == 0 ) { String msg = String . format ( "No mesh vertices for linked bone %s." , MyString . quote ( boneName ) ) ; throw new IllegalArgumentException ( msg ) ; } Bone bone = null ; Joint joint = null ; Transform boneToMesh ; if ( skeleton != null ) { bone = findBone ( boneName ) ; boneToMesh = MySkeleton . copyMeshTransform ( bone , null ) ; } else { joint = findArmatureJoint ( boneName ) ; boneToMesh = joint . getModelTransform ( ) ; } Transform meshToBone = boneToMesh . invert ( ) ; LinkConfig linkConfig = config ( boneName ) ; /*
         * Create the CollisionShape and locate the center of mass.
         */ Vector3f center ; CenterHeuristic centerHeuristic = linkConfig . centerHeuristic ( ) ; if ( centerHeuristic == CenterHeuristic . Joint ) { center = translateIdentity ; } else { center = centerHeuristic . center ( vertexLocations , null ) ; center . subtractLocal ( boneToMesh . getTranslation ( ) ) ; } CollisionShape shape ; shape = linkConfig . createShape ( meshToBone , center , vertexLocations ) ; meshToBone . getTranslation ( ) . zero ( ) ; Vector3f offset = meshToBone . transformVector ( center , null ) ; BoneLink link ; if ( skeleton != null ) { link = new BoneLink ( this , bone , shape , linkConfig , offset ) ; } else { link = new BoneLink ( this , joint , shape , linkConfig , offset ) ; } boneLinks . put ( boneName , link ) ; }
Create a jointless BoneLink for the named bone/joint, and add it to the
 boneLinks map.
Create a jointless BoneLink for the named bone / joint and add it to the boneLinks map .