Model, allows to specify global transform and modify the materials, as it has a copy of the model's
materials. Multiple instances can be created from the same Model, all sharing the meshes and textures of the Model. The Model
owns the meshes and textures, to dispose of these, the Model has to be disposed. Therefor, the Model must outlive all its
ModelInstances
The ModelInstance creates a full copy of all materials, nodes and animations.
| Modifier and Type | Field and Description |
|---|---|
| public final Array | animations
animations of the model, modifying node transformations |
| public static boolean | defaultShareKeyframes
Whether, by default, |
| public final Array | materials
the materials of the model, used by nodes that have a graphical representation FIXME not sure if superfluous, allows modification of materials without having to traverse the nodes |
| public final Model | |
| public final Array | nodes
root nodes of the model |
| public Matrix4 | transform
the world transform |
| public Object |
| Access | Constructor and Description |
|---|---|
| public | ModelInstance(final Model
The model)Model to create an instance of.Constructs a new ModelInstance with all nodes and materials of the given model. |
| public | |
| public | ModelInstance(final Model
The source model, final Matrix4 ModelThe transform, final String nodeId, boolean Matrix4 instance for this ModelInstance to reference or null to create a new matrix.True to apply the source node transform to the instance transform, resetting the node transform. mergeTransform)
|
| public | ModelInstance(final Model
The source model, final String nodeId, boolean ModelTrue to apply the parent's node transform to the instance (only applicable if recursive is true). parentTransform, boolean True to apply the source node transform to the instance transform, resetting the node transform. mergeTransform)Recursively searches the mode for the specified node. |
| public | ModelInstance(final Model
The source model, final Matrix4 ModelThe transform, final String nodeId, boolean Matrix4 instance for this ModelInstance to reference or null to create a new matrix.True to apply the parent's node transform to the instance (only applicable if recursive is true). parentTransform, boolean True to apply the source node transform to the instance transform, resetting the node transform. mergeTransform)Recursively searches the mode for the specified node. |
| public | ModelInstance(final Model
The source model, final String nodeId, boolean ModelTrue to recursively search the Model's node tree, false to only search for a root node recursive, boolean True to apply the parent's node transform to the instance (only applicable if recursive is true). parentTransform, boolean True to apply the source node transform to the instance transform, resetting the node transform. mergeTransform)
|
| public | ModelInstance(final Model
The source model, final Matrix4 ModelThe transform, final String nodeId, boolean Matrix4 instance for this ModelInstance to reference or null to create a new matrix.True to recursively search the Model's node tree, false to only search for a root node recursive, boolean True to apply the parent's node transform to the instance (only applicable if recursive is true). parentTransform, boolean True to apply the source node transform to the instance transform, resetting the node transform. mergeTransform)
|
| public | ModelInstance(final Model
The source model, final Matrix4 ModelThe transform, final String nodeId, boolean Matrix4 instance for this ModelInstance to reference or null to create a new matrix.True to recursively search the Model's node tree, false to only search for a root node recursive, boolean True to apply the parent's node transform to the instance (only applicable if recursive is true). parentTransform, boolean True to apply the source node transform to the instance transform, resetting the node transform. mergeTransform, boolean shareKeyframes)
|
| public | ModelInstance(final Model model, final String... rootNodeIds)
Constructs a new ModelInstance with only the specified nodes and materials of the given model. |
| public | ModelInstance(final Model model, final Matrix4 transform, final String... rootNodeIds)
Constructs a new ModelInstance with only the specified nodes and materials of the given model. |
| public | ModelInstance(final Model model, final Array<String> rootNodeIds)
Constructs a new ModelInstance with only the specified nodes and materials of the given model. |
| public | ModelInstance(final Model model, final Matrix4 transform, final Array<String> rootNodeIds)
Constructs a new ModelInstance with only the specified nodes and materials of the given model. |
| public | ModelInstance(final Model model, final Matrix4 transform, final Array<String> rootNodeIds, boolean shareKeyframes)
Constructs a new ModelInstance with only the specified nodes and materials of the given model. |
| public | ModelInstance(final Model model, Vector3 position)
Constructs a new ModelInstance at the specified position. |
| public | ModelInstance(final Model model, float x, float y, float z)
Constructs a new ModelInstance at the specified position. |
| public | ModelInstance(final Model model, Matrix4 transform)
Constructs a new ModelInstance with the specified transform. |
| public | ModelInstance(ModelInstance copyFrom)
Constructs a new ModelInstance which is an copy of the specified ModelInstance. |
| public | ModelInstance(ModelInstance copyFrom, final Matrix4 transform)
Constructs a new ModelInstance which is an copy of the specified ModelInstance. |
| public | ModelInstance(ModelInstance copyFrom, final Matrix4 transform, boolean shareKeyframes)
Constructs a new ModelInstance which is an copy of the specified ModelInstance. |
| Modifier and Type | Method and Description |
|---|---|
| public BoundingBox | Returns: the out parameter for chainingthe out)BoundingBox that will be set with the bounds.Calculate the bounding box of this model instance. |
| public void | calculateTransforms()
Calculates the local and world transform of all |
| public ModelInstance | |
| public void | copyAnimation(Animation
The source animation sourceAnim)AnimationCopy the source animation to this ModelInstance |
| public void | copyAnimation(Animation
The source animation sourceAnim, boolean AnimationShallow copy of shareKeyframes)NodeKeyframe's if it's true, otherwise make a deep copy.Copy the source animation to this ModelInstance |
| public void | copyAnimations(final Iterable<Animation>
Iterable collection of source animations source)AnimationCopy source animations to this ModelInstance |
| public void | copyAnimations(final Iterable<Animation>
Iterable collection of source animations source, boolean AnimationShallow copy of shareKeyframes)NodeKeyframe's if it's true, otherwise make a deep copy.Copy source animations to this ModelInstance |
| private void | |
| private void | |
| private void | |
| public BoundingBox | Returns: the out parameter for chainingthe out)BoundingBox that will be extended with the bounds.Extends the bounding box with the bounds of this model instance. |
| public Animation | getAnimation(final String
The ID of the animation to fetch (case sensitive). id)Returns: The |
| public Animation | getAnimation(final String
The ID of the animation to fetch. id, boolean whether to use case sensitivity when comparing the animation id. ignoreCase)Returns: The |
| public Material | getMaterial(final String
The ID of the material to fetch. id)Returns: The |
| public Material | getMaterial(final String
The ID of the material to fetch. id, boolean whether to use case sensitivity when comparing the material id. ignoreCase)Returns: The |
| public Node | |
| public Node | |
| public Node | getNode(final String
The ID of the node to fetch. id, boolean false to fetch a root node only, true to search the entire node tree for the specified node. recursive, boolean whether to use case sensitivity when comparing the node id. ignoreCase)Returns: The |
| public Renderable | |
| public Renderable | getRenderable(final Renderable out, final Node node)
Returns: The renderable of the node's first part. |
| public Renderable | |
| public void | getRenderables(Array<Renderable>
the output array renderables, Pool<Renderable> the pool to obtain Renderables from pool)Implements com. Traverses the Node hierarchy and collects |
| protected void | |
| private void | invalidate(Node node)
Makes sure that each |
| private void | invalidate()
Makes sure that each |
| animations | back to summary |
|---|---|
| public final Array<Animation> animations animations of the model, modifying node transformations | |
| defaultShareKeyframes | back to summary |
|---|---|
| public static boolean defaultShareKeyframes Whether, by default, | |
| materials | back to summary |
|---|---|
| public final Array<Material> materials the materials of the model, used by nodes that have a graphical representation FIXME not sure if superfluous, allows modification of materials without having to traverse the nodes | |
| model | back to summary |
|---|---|
| public final Model model the | |
| nodes | back to summary |
|---|---|
| public final Array<Node> nodes root nodes of the model | |
| transform | back to summary |
|---|---|
| public Matrix4 transform the world transform | |
| userData | back to summary |
|---|---|
| public Object userData user definable value, which is passed to the | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model) Constructs a new ModelInstance with all nodes and materials of the given model. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final String nodeId, boolean mergeTransform) | |
| ModelInstance | back to summary |
|---|---|
public ModelInstance(final Model model, final Matrix4 transform, final String nodeId, boolean mergeTransform)
| |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final String nodeId, boolean parentTransform, boolean mergeTransform) Recursively searches the mode for the specified node.
| |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final Matrix4 transform, final String nodeId, boolean parentTransform, boolean mergeTransform) Recursively searches the mode for the specified node.
| |
| ModelInstance | back to summary |
|---|---|
public ModelInstance(final Model model, final String nodeId, boolean recursive, boolean parentTransform, boolean mergeTransform)
| |
| ModelInstance | back to summary |
|---|---|
public ModelInstance(final Model model, final Matrix4 transform, final String nodeId, boolean recursive, boolean parentTransform, boolean mergeTransform)
| |
| ModelInstance | back to summary |
|---|---|
public ModelInstance(final Model model, final Matrix4 transform, final String nodeId, boolean recursive, boolean parentTransform, boolean mergeTransform, boolean shareKeyframes)
| |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final String... rootNodeIds) Constructs a new ModelInstance with only the specified nodes and materials of the given model. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final Matrix4 transform, final String... rootNodeIds) Constructs a new ModelInstance with only the specified nodes and materials of the given model. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final Array<String> rootNodeIds) Constructs a new ModelInstance with only the specified nodes and materials of the given model. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final Matrix4 transform, final Array<String> rootNodeIds) Constructs a new ModelInstance with only the specified nodes and materials of the given model. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, final Matrix4 transform, final Array<String> rootNodeIds, boolean shareKeyframes) Constructs a new ModelInstance with only the specified nodes and materials of the given model. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, Vector3 position) Constructs a new ModelInstance at the specified position. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, float x, float y, float z) Constructs a new ModelInstance at the specified position. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(final Model model, Matrix4 transform) Constructs a new ModelInstance with the specified transform. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(ModelInstance copyFrom) Constructs a new ModelInstance which is an copy of the specified ModelInstance. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(ModelInstance copyFrom, final Matrix4 transform) Constructs a new ModelInstance which is an copy of the specified ModelInstance. | |
| ModelInstance | back to summary |
|---|---|
| public ModelInstance(ModelInstance copyFrom, final Matrix4 transform, boolean shareKeyframes) Constructs a new ModelInstance which is an copy of the specified ModelInstance. | |
| calculateBoundingBox | back to summary |
|---|---|
| public BoundingBox calculateBoundingBox(final BoundingBox out) Calculate the bounding box of this model instance. This is a potential slow operation, it is advised to cache the result.
| |
| calculateTransforms | back to summary |
|---|---|
| public void calculateTransforms() Calculates the local and world transform of all | |
| copy | back to summary |
|---|---|
public ModelInstance copy()
| |
| copyAnimation | back to summary |
|---|---|
| public void copyAnimation(Animation sourceAnim) Copy the source animation to this ModelInstance | |
| copyAnimation | back to summary |
|---|---|
| public void copyAnimation(Animation sourceAnim, boolean shareKeyframes) Copy the source animation to this ModelInstance
| |
| copyAnimations | back to summary |
|---|---|
| public void copyAnimations(final Iterable<Animation> source) Copy source animations to this ModelInstance | |
| copyAnimations | back to summary |
|---|---|
| public void copyAnimations(final Iterable<Animation> source, boolean shareKeyframes) Copy source animations to this ModelInstance
| |
| copyNodes | back to summary |
|---|---|
| private void copyNodes(Array<Node> nodes) | |
| copyNodes | back to summary |
|---|---|
| private void copyNodes(Array<Node> nodes, final String... nodeIds) | |
| copyNodes | back to summary |
|---|---|
| private void copyNodes(Array<Node> nodes, final Array<String> nodeIds) | |
| extendBoundingBox | back to summary |
|---|---|
| public BoundingBox extendBoundingBox(final BoundingBox out) Extends the bounding box with the bounds of this model instance. This is a potential slow operation, it is advised to cache the result.
| |
| getAnimation | back to summary |
|---|---|
| public Animation getAnimation(final String id) | |
| getAnimation | back to summary |
|---|---|
| public Animation getAnimation(final String id, boolean ignoreCase) | |
| getMaterial | back to summary |
|---|---|
| public Material getMaterial(final String id) | |
| getMaterial | back to summary |
|---|---|
| public Material getMaterial(final String id, boolean ignoreCase) | |
| getNode | back to summary |
|---|---|
| public Node getNode(final String id) | |
| getNode | back to summary |
|---|---|
| public Node getNode(final String id, boolean recursive) | |
| getNode | back to summary |
|---|---|
public Node getNode(final String id, boolean recursive, boolean ignoreCase)
| |
| getRenderable | back to summary |
|---|---|
public Renderable getRenderable(final Renderable out)
| |
| getRenderable | back to summary |
|---|---|
public Renderable getRenderable(final Renderable out, final Node node)
| |
| getRenderable | back to summary |
|---|---|
| public Renderable getRenderable(final Renderable out, final Node node, final NodePart nodePart) | |
| getRenderables | back to summary |
|---|---|
| public void getRenderables(Array<Renderable> renderables, Pool<Renderable> pool) Implements com. Traverses the Node hierarchy and collects
| |
| getRenderables | back to summary |
|---|---|
| protected void getRenderables(Node node, Array<Renderable> renderables, Pool<Renderable> pool) | |
| invalidate | back to summary |
|---|---|
| private void invalidate(Node node) Makes sure that each | |
| invalidate | back to summary |
|---|---|
| private void invalidate() Makes sure that each | |