Class IntModel

java.lang.Object
gaiasky.util.gdx.model.IntModel
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class IntModel extends Object implements com.badlogic.gdx.utils.Disposable
  • Field Details Link icon

    • materials Link icon

      public final com.badlogic.gdx.utils.Array<Material> materials
      the materials of the model, used by nodes that have a graphical representation
    • nodes Link icon

      public final com.badlogic.gdx.utils.Array<IntNode> nodes
      root nodes of the model
    • animations Link icon

      public final com.badlogic.gdx.utils.Array<IntAnimation> animations
      animations of the model, modifying node transformations
    • meshes Link icon

      public final com.badlogic.gdx.utils.Array<IntMesh> meshes
      the meshes of the model
    • meshParts Link icon

      public final com.badlogic.gdx.utils.Array<IntMeshPart> meshParts
      parts of meshes, used by nodes that have a graphical representation
    • disposables Link icon

      protected final com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Disposable> disposables
      Array of disposable resources like textures or meshes the Model is responsible for disposing
  • Constructor Details Link icon

    • IntModel Link icon

      public IntModel()
      Constructs an empty model. Manual created models do not manage their resources by default. Use manageDisposable(Disposable) to add resources to be managed by this model.
    • IntModel Link icon

      public IntModel(IntModelData modelData)
      Constructs a new Model based on the IntModelData. Texture files will be loaded from the internal file storage via an TextureProvider.FileTextureProvider.
      Parameters:
      modelData - the IntModelData got from e.g. ModelLoader
    • IntModel Link icon

      public IntModel(IntModelData modelData, com.badlogic.gdx.graphics.g3d.utils.TextureProvider textureProvider)
      Constructs a new Model based on the IntModelData.
      Parameters:
      modelData - the IntModelData got from e.g. ModelLoader
      textureProvider - the TextureProvider to use for loading the textures
  • Method Details Link icon

    • load Link icon

      protected void load(IntModelData modelData, com.badlogic.gdx.graphics.g3d.utils.TextureProvider textureProvider)
    • loadAnimations Link icon

      protected void loadAnimations(Iterable<com.badlogic.gdx.graphics.g3d.model.data.ModelAnimation> modelAnimations)
    • loadNodes Link icon

      protected void loadNodes(Iterable<IntModelNode> modelNodes)
    • loadNode Link icon

      protected IntNode loadNode(IntModelNode modelNode)
    • loadMeshes Link icon

      protected void loadMeshes(Iterable<IntModelMesh> meshes)
    • convertMesh Link icon

      protected void convertMesh(IntModelMesh modelMesh)
    • loadMaterials Link icon

      protected void loadMaterials(Iterable<OwnModelMaterial> modelMaterials, com.badlogic.gdx.graphics.g3d.utils.TextureProvider textureProvider)
    • convertMaterial Link icon

      protected Material convertMaterial(OwnModelMaterial mtl, com.badlogic.gdx.graphics.g3d.utils.TextureProvider textureProvider)
    • manageDisposable Link icon

      public void manageDisposable(com.badlogic.gdx.utils.Disposable disposable)
      Adds a Disposable to be managed and disposed by this Model. Can be used to keep track of manually loaded textures for IntModelInstance.
      Parameters:
      disposable - the Disposable
    • getManagedDisposables Link icon

      public Iterable<com.badlogic.gdx.utils.Disposable> getManagedDisposables()
      Returns:
      the Disposable objects that will be disposed when the dispose() method is called.
    • dispose Link icon

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
    • calculateTransforms Link icon

      public void calculateTransforms()
      Calculates the local and world transform of all Node instances in this model, recursively. First each Node.localTransform transform is calculated based on the translation, rotation and scale of each Node. Then each Node.calculateWorldTransform() is calculated, based on the parent's world transform and the local transform of each Node. Finally, the animation bone matrices are updated accordingly.

      This method can be used to recalculate all transforms if any of the Node's local properties (translation, rotation, scale) was modified.

    • calculateBoundingBox Link icon

      public com.badlogic.gdx.math.collision.BoundingBox calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox out)
      Calculate the bounding box of this model instance. This is a potential slow operation, it is advised to cache the result.
      Parameters:
      out - the BoundingBox that will be set with the bounds.
      Returns:
      the out parameter for chaining
    • extendBoundingBox Link icon

      public com.badlogic.gdx.math.collision.BoundingBox extendBoundingBox(com.badlogic.gdx.math.collision.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.
      Parameters:
      out - the BoundingBox that will be extended with the bounds.
      Returns:
      the out parameter for chaining
    • getAnimation Link icon

      public IntAnimation getAnimation(String id)
      Parameters:
      id - The ID of the animation to fetch (case sensitive).
      Returns:
      The Animation with the specified id, or null if not available.
    • getAnimation Link icon

      public IntAnimation getAnimation(String id, boolean ignoreCase)
      Parameters:
      id - The ID of the animation to fetch.
      ignoreCase - whether to use case sensitivity when comparing the animation id.
      Returns:
      The Animation with the specified id, or null if not available.
    • getMaterial Link icon

      public Material getMaterial(String id)
      Parameters:
      id - The ID of the material to fetch.
      Returns:
      The Material with the specified id, or null if not available.
    • getMaterial Link icon

      public Material getMaterial(String id, boolean ignoreCase)
      Parameters:
      id - The ID of the material to fetch.
      ignoreCase - whether to use case sensitivity when comparing the material id.
      Returns:
      The Material with the specified id, or null if not available.
    • getNode Link icon

      public IntNode getNode(String id)
      Parameters:
      id - The ID of the node to fetch.
      Returns:
      The IntNode with the specified id, or null if not found.
    • getNode Link icon

      public IntNode getNode(String id, boolean recursive)
      Parameters:
      id - The ID of the node to fetch.
      recursive - false to fetch a root node only, true to search the entire node tree for the specified node.
      Returns:
      The IntNode with the specified id, or null if not found.
    • getNode Link icon

      public IntNode getNode(String id, boolean recursive, boolean ignoreCase)
      Parameters:
      id - The ID of the node to fetch.
      recursive - false to fetch a root node only, true to search the entire node tree for the specified node.
      ignoreCase - whether to use case sensitivity when comparing the node id.
      Returns:
      The IntNode with the specified id, or null if not found.