@Override protected MeshPart newObject () { return new MeshPart(); } };
/** Construct a new MeshPart and set all its values. * @param id The id of the new part, may be null. * @param mesh The mesh which holds all vertices and (optional) indices of this part. * @param offset The offset within the mesh to this part. * @param size The size (in total number of vertices) of the part. * @param type The primitive type of the part (e.g. GL_TRIANGLES, GL_LINE_STRIP, etc.). */ public MeshPart (final String id, final Mesh mesh, final int offset, final int size, final int type) { set(id, mesh, offset, size, type); }
/** Adds the specified node as the currently last child of this node. If the node is already a child of another node, then it is * removed from its current parent. * @param child The Node to add as child of this Node * @return the zero-based index of the child */ public <T extends Node> int addChild (final T child) { return insertChild(-1, child); }
/** Calculates the local and world transform of this node and optionally all its children. * * @param recursive whether to calculate the local/world transforms for children. */ public void calculateTransforms (boolean recursive) { calculateLocalTransform(); calculateWorldTransform(); if (recursive) { for (Node child : children) { child.calculateTransforms(true); } } }
/** Creates a nested copy of this Node, any child nodes are copied using this method as well. The {@link #parts} are copied * using the {@link NodePart#copy()} method. Note that that method copies the material and nodes (bones) by reference. If you * intend to use the copy in a different node tree (e.g. a different Model or ModelInstance) then you will need to update these * references afterwards. * * Override this method in your custom Node class to instantiate that class, in that case you should override the * {@link #set(Node)} method as well. */ public Node copy () { return new Node().set(this); }
/** Adds this node as child to specified parent Node, synonym for: <code>parent.addChild(this)</code> * @param parent The Node to attach this Node to. */ public <T extends Node> void attachTo (T parent) { parent.addChild(this); }
/** @param recursive false to fetch a root child only, true to search the entire node tree for the specified node. * @return The node with the specified id, or null if not found. */ public Node getChild (final String id, boolean recursive, boolean ignoreCase) { return getNode(children, id, recursive, ignoreCase); }
/** Adds the specified nodes as the currently last child of this node. If the node is already a child of another node, then it * is removed from its current parent. * @param nodes The Node to add as child of this Node * @return the zero-based index of the first added child */ public <T extends Node> int addChildren (final Iterable<T> nodes) { return insertChildren(-1, nodes); }
/** Removes this node from its current parent, if any. Short for: <code>this.getParent().removeChild(this)</code> */ public void detach () { if (parent != null) { parent.removeChild(this); parent = null; } }
@Override public boolean equals (final Object arg0) { if (arg0 == null) return false; if (arg0 == this) return true; if (!(arg0 instanceof MeshPart)) return false; return equals((MeshPart)arg0); }
/** Calculates the local and world transform of this node and optionally all its children. * * @param recursive whether to calculate the local/world transforms for children. */ public void calculateTransforms (boolean recursive) { calculateLocalTransform(); calculateWorldTransform(); if (recursive) { for (Node child : children) { child.calculateTransforms(true); } } }
@Override protected MeshPart newObject () { return new MeshPart(); } };
/** Creates a nested copy of this Node, any child nodes are copied using this method as well. The {@link #parts} are copied * using the {@link NodePart#copy()} method. Note that that method copies the material and nodes (bones) by reference. If you * intend to use the copy in a different node tree (e.g. a different Model or ModelInstance) then you will need to update these * references afterwards. * * Override this method in your custom Node class to instantiate that class, in that case you should override the * {@link #set(Node)} method as well. */ public Node copy () { return new Node().set(this); }
/** Construct a new MeshPart which is an exact copy of the provided MeshPart. * @param copyFrom The MeshPart to copy. */ public MeshPart (final MeshPart copyFrom) { set(copyFrom); }
/** Adds this node as child to specified parent Node, synonym for: <code>parent.addChild(this)</code> * @param parent The Node to attach this Node to. */ public <T extends Node> void attachTo (T parent) { parent.addChild(this); }
/** @param id The ID of the node to fetch. * @param recursive false to fetch a root node only, true to search the entire node tree for the specified node. * @param ignoreCase whether to use case sensitivity when comparing the node id. * @return The {@link Node} with the specified id, or null if not found. */ public Node getNode (final String id, boolean recursive, boolean ignoreCase) { return Node.getNode(nodes, id, recursive, ignoreCase); } }
/** Adds the specified node as the currently last child of this node. If the node is already a child of another node, then it is * removed from its current parent. * @param child The Node to add as child of this Node * @return the zero-based index of the child */ public <T extends Node> int addChild (final T child) { return insertChild(-1, child); }
/** Adds the specified nodes as the currently last child of this node. If the node is already a child of another node, then it * is removed from its current parent. * @param nodes The Node to add as child of this Node * @return the zero-based index of the first added child */ public <T extends Node> int addChildren (final Iterable<T> nodes) { return insertChildren(-1, nodes); }
/** @param recursive false to fetch a root child only, true to search the entire node tree for the specified node. * @return The node with the specified id, or null if not found. */ public Node getChild (final String id, boolean recursive, boolean ignoreCase) { return getNode(children, id, recursive, ignoreCase); }
/** @param id The ID of the node to fetch. * @param recursive false to fetch a root node only, true to search the entire node tree for the specified node. * @param ignoreCase whether to use case sensitivity when comparing the node id. * @return The {@link Node} with the specified id, or null if not found. */ public Node getNode (final String id, boolean recursive, boolean ignoreCase) { return Node.getNode(nodes, id, recursive, ignoreCase); } }