public static HullCollisionShape makeShapeFromVerticeWeights(Spatial model,
            List<Integer> boneIndices, Vector3f initialScale,
            Vector3f initialPosition, float weightThreshold) {
        List<Float> points = new ArrayList<>(100);

        SkeletonControl skeletonCtrl = model.getControl(SkeletonControl.class);
        Mesh[] targetMeshes = skeletonCtrl.getTargets();
        for (Mesh mesh : targetMeshes) {
            for (Integer index : boneIndices) {
                List<Float> bonePoints = getPoints(mesh, index, initialScale,
                        initialPosition, weightThreshold);
                points.addAll(bonePoints);
            }
        }

        assert !points.isEmpty();
        float[] p = new float[points.size()];
        for (int i = 0; i < points.size(); i++) {
            p[i] = points.get(i);
        }

        return new HullCollisionShape(p);
    }
Create a hull collision shape from linked vertices to this bone.

@param model the model on which to base the shape
@param boneIndices indices of relevant bones (not null, unaffected)
@param initialScale scale factors
@param initialPosition location
@param weightThreshold minimum weight for inclusion
@return a new shape
jme3-jbullet/src/main/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java