public static CollisionShape createBoxShape(Spatial spatial) {
        if (spatial instanceof Geometry) {
            return createSingleBoxShape(spatial, spatial);
        } else if (spatial instanceof Node) {
            return createBoxCompoundShape((Node) spatial);
        } else {
            throw new IllegalArgumentException("Supplied spatial must either be Node or Geometry!");
        }
    }
Create a box shape for the given Spatial.

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