public static HullCollisionShape makeShapeFromPointMap(Map<Integer, List<Float>> pointsMap, List<Integer> boneIndices, Vector3f initialScale, Vector3f initialPosition) {

        ArrayList<Float> points = new ArrayList<>();
        for (Integer index : boneIndices) {
            List<Float> l = pointsMap.get(index);
            if (l != null) {

                for (int i = 0; i < l.size(); i += 3) {
                    Vector3f pos = new Vector3f();
                    pos.x = l.get(i);
                    pos.y = l.get(i + 1);
                    pos.z = l.get(i + 2);
                    pos.subtractLocal(initialPosition).multLocal(initialScale);
                    points.add(pos.x);
                    points.add(pos.y);
                    points.add(pos.z);
                }
            }
        }

        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. Vertices
must have previously been gathered using buildPointMap().

@param pointsMap map from bone indices to coordinates (not null,
unaffected)
@param boneIndices (not null, unaffected)
@param initialScale scale factors (not null, unaffected)
@param initialPosition location (not null, unaffected)
@return a new shape (not null)
jme3-jbullet/src/main/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java