/** Resets the references to {@link Material}s, {@link Mesh}es and {@link MeshPart}s within the model to the ones used within * it's nodes. This will make the model responsible for disposing all referenced meshes. */ public static void rebuildReferences (final Model model) { model.materials.clear(); model.meshes.clear(); model.meshParts.clear(); for (final Node node : model.nodes) rebuildReferences(model, node); }
/** Resets the references to {@link Material}s, {@link Mesh}es and {@link MeshPart}s within the model to the ones used within * it's nodes. This will make the model responsible for disposing all referenced meshes. */ public static void rebuildReferences (final Model model) { model.materials.clear(); model.meshes.clear(); model.meshParts.clear(); for (final Node node : model.nodes) rebuildReferences(model, node); }
/** End building the model. * @return The newly created model. Call the {@link Model#dispose()} method when no longer used. */ public Model end () { if (model == null) throw new GdxRuntimeException("Call begin() first"); final Model result = model; endnode(); model = null; for (final MeshBuilder mb : builders) mb.end(); builders.clear(); rebuildReferences(result); return result; }
/** End building the model. * @return The newly created model. Call the {@link Model#dispose()} method when no longer used. */ public Model end () { if (model == null) throw new GdxRuntimeException("Call begin() first"); final Model result = model; endnode(); model = null; for (final MeshBuilder mb : builders) mb.end(); builders.clear(); rebuildReferences(result); return result; }
private static void rebuildReferences (final Model model, final Node node) { for (final NodePart mpm : node.parts) { if (!model.materials.contains(mpm.material, true)) model.materials.add(mpm.material); if (!model.meshParts.contains(mpm.meshPart, true)) { model.meshParts.add(mpm.meshPart); if (!model.meshes.contains(mpm.meshPart.mesh, true)) model.meshes.add(mpm.meshPart.mesh); model.manageDisposable(mpm.meshPart.mesh); } } for (final Node child : node.getChildren()) rebuildReferences(model, child); }
private static void rebuildReferences (final Model model, final Node node) { for (final NodePart mpm : node.parts) { if (!model.materials.contains(mpm.material, true)) model.materials.add(mpm.material); if (!model.meshParts.contains(mpm.meshPart, true)) { model.meshParts.add(mpm.meshPart); if (!model.meshes.contains(mpm.meshPart.mesh, true)) model.meshes.add(mpm.meshPart.mesh); model.manageDisposable(mpm.meshPart.mesh); } } for (final Node child : node.getChildren()) rebuildReferences(model, child); }
/** Resets the references to {@link Material}s, {@link Mesh}es and {@link MeshPart}s within the model to the ones used within * it's nodes. This will make the model responsible for disposing all referenced meshes. */ public static void rebuildReferences (final Model model) { model.materials.clear(); model.meshes.clear(); model.meshParts.clear(); for (final Node node : model.nodes) rebuildReferences(model, node); }
/** End building the model. * @return The newly created model. Call the {@link Model#dispose()} method when no longer used. */ public Model end () { if (model == null) throw new GdxRuntimeException("Call begin() first"); final Model result = model; endnode(); model = null; for (final MeshBuilder mb : builders) mb.end(); builders.clear(); rebuildReferences(result); return result; }
private static void rebuildReferences (final Model model, final Node node) { for (final NodePart mpm : node.parts) { if (!model.materials.contains(mpm.material, true)) model.materials.add(mpm.material); if (!model.meshParts.contains(mpm.meshPart, true)) { model.meshParts.add(mpm.meshPart); if (!model.meshes.contains(mpm.meshPart.mesh, true)) model.meshes.add(mpm.meshPart.mesh); model.manageDisposable(mpm.meshPart.mesh); } } for (final Node child : node.getChildren()) rebuildReferences(model, child); }