public static Spatial loadSpatial(String path, ModelFormat modelFormat) {
ByteArrayOutputStream BO = new ByteArrayOutputStream();
Object model = null;
try {
modelFormat.converter().convert(getResource(path), BO);
model = new BinaryImporter().load(new ByteArrayInputStream(BO.toByteArray()));
} catch (IOException e) {
throw new RuntimeException(e);
}
return (Spatial) model;