public static CollisionShape createDynamicMeshShape(Spatial spatial) {
        if (spatial instanceof Geometry) {
            return createSingleDynamicMeshShape((Geometry) spatial, spatial);
        } else if (spatial instanceof Node) {
            return createCompoundShape((Node) spatial, (Node) spatial, new CompoundCollisionShape(), true, true);
        } else {
            throw new IllegalArgumentException("Supplied spatial must either be Node or Geometry!");
        }

    }
Create a hull shape for the given Spatial.
<p>
For mesh-accurate animated meshes (CPU intense!) use GImpact shapes.

@param spatial the spatial on which to base the shape (not null)
@return a HullCollisionShape (if spatial is a Geometry) or a
CompoundCollisionShape with HullCollisionShapes as children (if spatial
is a Node)
jme3-jbullet/src/main/java/com/jme3/bullet/util/CollisionShapeFactory.java