MeshPart and Material. Mesh parts reference subsets of vertices in one of the meshes of the model.
Animations can be applied to nodes, to modify their transform (translation, rotation, scale) over time.
A model can be rendered by creating a ModelInstance from it. That instance has an additional transform to position the
model in the world, and allows modification of materials and nodes without destroying the original model. The original model is
the owner of any meshes and textures, all instances created from the model share these resources. Disposing the model will
automatically make all instances invalid!
A model is created from ModelData, which in turn is loaded by a ModelLoader.
| Modifier and Type | Field and Description |
|---|---|
| public final Array | animations
animations of the model, modifying node transformations |
| protected final Array | disposables
Array of disposable resources like textures or meshes the Model is responsible for disposing |
| 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 Array | meshes
the meshes of the model |
| public final Array | meshParts
parts of meshes, used by nodes that have a graphical representation FIXME not sure if superfluous, stored in Nodes as well, could be useful to create bullet meshes |
| private ObjectMap | |
| public final Array | nodes
root nodes of the model |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Model(ModelData
the modelData)ModelData got from e.g. ModelLoaderConstructs a new Model based on the |
| public | Model(ModelData
the modelData, TextureProvider ModelData got from e.g. ModelLoaderthe textureProvider)TextureProvider to use for loading the texturesConstructs a new Model based on the |
| 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 |
| protected Material | |
| protected void | |
| public void | dispose()
Implements com. Releases all resources of this object. |
| 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 Iterable | getManagedDisposables()
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 |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected Node | |
| protected void | |
| public void | manageDisposable(Disposable
the Disposable disposable)Adds a |
| animations | back to summary |
|---|---|
| public final Array<Animation> animations animations of the model, modifying node transformations | |
| disposables | back to summary |
|---|---|
| protected final Array<Disposable> disposables Array of disposable resources like textures or meshes the Model is responsible for disposing | |
| 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 | |
| meshes | back to summary |
|---|---|
| public final Array<Mesh> meshes the meshes of the model | |
| meshParts | back to summary |
|---|---|
| public final Array<MeshPart> meshParts parts of meshes, used by nodes that have a graphical representation FIXME not sure if superfluous, stored in Nodes as well, could be useful to create bullet meshes | |
| nodePartBones | back to summary |
|---|---|
| private ObjectMap<NodePart, ArrayMap<String, Matrix4>> nodePartBones | |
| nodes | back to summary |
|---|---|
| public final Array<Node> nodes root nodes of the model | |
| Model | back to summary |
|---|---|
| public Model() Constructs an empty model. Manual created models do not manage their resources by default. Use
| |
| Model | back to summary |
|---|---|
| public Model(ModelData modelData) Constructs a new Model based on the
| |
| Model | back to summary |
|---|---|
| public Model(ModelData modelData, TextureProvider textureProvider) Constructs a new Model based on the
| |
| 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 | |
| convertMaterial | back to summary |
|---|---|
| protected Material convertMaterial(ModelMaterial mtl, TextureProvider textureProvider) | |
| convertMesh | back to summary |
|---|---|
| protected void convertMesh(ModelMesh modelMesh) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Doc from com. Releases all resources of this object.
| |
| 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) | |
| getManagedDisposables | back to summary |
|---|---|
public Iterable
| |
| 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)
| |
| load | back to summary |
|---|---|
| protected void load(ModelData modelData, TextureProvider textureProvider) | |
| loadAnimations | back to summary |
|---|---|
| protected void loadAnimations(Iterable<ModelAnimation> modelAnimations) | |
| loadMaterials | back to summary |
|---|---|
| protected void loadMaterials(Iterable<ModelMaterial> modelMaterials, TextureProvider textureProvider) | |
| loadMeshes | back to summary |
|---|---|
| protected void loadMeshes(Iterable<ModelMesh> meshes) | |
| loadNode | back to summary |
|---|---|
| protected Node loadNode(ModelNode modelNode) | |
| loadNodes | back to summary |
|---|---|
| protected void loadNodes(Iterable<ModelNode> modelNodes) | |
| manageDisposable | back to summary |
|---|---|
| public void manageDisposable(Disposable disposable) Adds a
| |