Class IntModelBuilder

java.lang.Object
gaiasky.util.gdx.IntModelBuilder

public class IntModelBuilder
extends java.lang.Object
Helper class to create IntModels from code. To start building use the begin() method, when finished building use the end() method. The end method returns the model just build. Building cannot be nested, only one model (per ModelBuilder) can be build at the time. The same ModelBuilder can be used to build multiple models sequential. Use the node() method to start a new node. Use one of the #part(...) methods to add a part within a node. The part(String, int, VertexAttributes, Material) method will return a IntMeshPartBuilder which can be used to build the node part.
  • Constructor Summary

    Constructors
    Constructor Description
    IntModelBuilder()  
  • Method Summary

    Modifier and Type Method Description
    void begin()
    Begin building a new model
    IntModel createArrow​(float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with an arrow.
    IntModel createArrow​(com.badlogic.gdx.math.Vector3 from, com.badlogic.gdx.math.Vector3 to, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with an arrow.
    IntModel createBox​(float width, float height, float depth, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a box shape.
    IntModel createBox​(float width, float height, float depth, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a box shape.
    IntModel createCapsule​(float radius, float height, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a capsule shape.
    IntModel createCapsule​(float radius, float height, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a capsule shape.
    IntModel createCone​(float width, float height, float depth, int divisions, int hdivisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cone shape.
    IntModel createCone​(float width, float height, float depth, int divisions, int hdivisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
    Convenience method to create a model with a single node containing a cone shape.
    IntModel createCone​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cone shape.
    IntModel createCone​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
    Convenience method to create a model with a single node containing a cone shape.
    IntModel createCone​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cone shape.
    IntModel createCone​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
    Convenience method to create a model with a single node containing a cone shape.
    IntModel createCylinder​(float width, float height, float depth, int divisions, boolean flipNormals, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cylinder shape.
    IntModel createCylinder​(float width, float height, float depth, int divisions, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cylinder shape.
    IntModel createCylinder​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cylinder shape.
    IntModel createCylinder​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
    Convenience method to create a model with a single node containing a cylinder shape.
    IntModel createCylinder​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a cylinder shape.
    IntModel createCylinder​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
    Convenience method to create a model with a single node containing a cylinder shape.
    static IntModel createFromMesh​(float[] vertices, com.badlogic.gdx.graphics.VertexAttribute[] attributes, int[] indices, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
    Deprecated.
    static IntModel createFromMesh​(IntMesh mesh, int indexOffset, int vertexCount, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
    Deprecated.
    static IntModel createFromMesh​(IntMesh mesh, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
    Deprecated.
    IntModel createIcoSphere​(float radius, int recursion, boolean flipNormals, boolean hardEdges, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)  
    IntModel createIcoSphere​(float radius, int recursion, boolean flipNormals, boolean hardEdges, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing an ico-sphere shape.
    IntModel createLineGrid​(int xDivisions, int zDivisions, float xSize, float zSize, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model which represents a grid of lines on the XZ plane.
    IntModel createOctahedronSphere​(float radius, int divisions, boolean flipNormals, boolean hardEdges, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Creates an octahedron-sphere
    IntModel createOctahedronSphere​(float radius, int divisions, boolean flipNormals, boolean hardEdges, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing an octahedron-sphere shape.
    IntModel createRect​(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a rectangle shape.
    IntModel createRect​(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a rectangle shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float diameter, int divisionsU, int divisionsV, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphere​(float diameter, int divisionsU, int divisionsV, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with a single node containing a sphere shape.
    IntModel createSphereRing​(float sphereDiameter, int divisionsU, int divisionsV, float innerRingRadius, float outerRingRadius, int ringDivisions, com.badlogic.gdx.graphics.g3d.Material materialShpere, com.badlogic.gdx.graphics.g3d.Material materialRing, long attributes)
    Convenience method to create a sphere with a ring.
    IntModel createXYZCoordinates​(float axisLength, float capLength, float stemThickness, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    Convenience method to create a model with three orthonormal vectors shapes.
    IntModel createXYZCoordinates​(float axisLength, com.badlogic.gdx.graphics.g3d.Material material, long attributes)  
    IntModel end()
    End building the model.
    void manage​(com.badlogic.gdx.utils.Disposable disposable)
    Add the Disposable object to the model, causing it to be disposed when the model is disposed.
    IntNode node()
    Add a node to the model.
    protected IntNode node​(IntNode node)
    Adds the Node to the model and sets it active for building.
    IntNode node​(java.lang.String id, IntModel model)
    Adds the nodes of the specified model to a new node of the model being build.
    void part​(IntMeshPart meshpart, com.badlogic.gdx.graphics.g3d.Material material)
    Adds the specified IntMeshPart to the current Node.
    IntMeshPartBuilder part​(java.lang.String id, int primitiveType, long attributes, com.badlogic.gdx.graphics.g3d.Material material)
    Creates a new IntMeshPart within the current Node and returns a IntMeshPartBuilder which can be used to build the shape of the part.
    IntMeshPartBuilder part​(java.lang.String id, int primitiveType, com.badlogic.gdx.graphics.VertexAttributes attributes, com.badlogic.gdx.graphics.g3d.Material material)
    Creates a new IntMeshPart within the current Node and returns a IntMeshPartBuilder which can be used to build the shape of the part.
    IntMeshPart part​(java.lang.String id, IntMesh mesh, int primitiveType, int offset, int size, com.badlogic.gdx.graphics.g3d.Material material)
    Adds the specified mesh part to the current node.
    IntMeshPart part​(java.lang.String id, IntMesh mesh, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
    Adds the specified mesh part to the current node.
    static void rebuildReferences​(IntModel model)
    Resets the references to Materials, IntMeshes and IntMeshParts within the model to the ones used within it's nodes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IntModelBuilder

      public IntModelBuilder()
  • Method Details

    • begin

      public void begin()
      Begin building a new model
    • end

      public IntModel end()
      End building the model.
      Returns:
      The newly created model. Call the IntModel.dispose() method when no longer used.
    • node

      protected IntNode node​(IntNode node)
      Adds the Node to the model and sets it active for building. Use any of the part(...) method to add a NodePart.
    • node

      public IntNode node()
      Add a node to the model. Use any of the part(...) method to add a NodePart.
      Returns:
      The node being created.
    • node

      public IntNode node​(java.lang.String id, IntModel model)
      Adds the nodes of the specified model to a new node of the model being build. After this method the given model can no longer be used. Do not call the IntModel.dispose() method on that model.
      Returns:
      The newly created node containing the nodes of the given model.
    • manage

      public void manage​(com.badlogic.gdx.utils.Disposable disposable)
      Add the Disposable object to the model, causing it to be disposed when the model is disposed.
    • part

      public void part​(IntMeshPart meshpart, com.badlogic.gdx.graphics.g3d.Material material)
      Adds the specified IntMeshPart to the current Node. The Mesh will be managed by the model and disposed when the model is disposed. The resources the Material might contain are not managed, use manage(Disposable) to add those to the model.
    • part

      public IntMeshPart part​(java.lang.String id, IntMesh mesh, int primitiveType, int offset, int size, com.badlogic.gdx.graphics.g3d.Material material)
      Adds the specified mesh part to the current node. The Mesh will be managed by the model and disposed when the model is disposed. The resources the Material might contain are not managed, use manage(Disposable) to add those to the model.
      Returns:
      The added IntMeshPart.
    • part

      public IntMeshPart part​(java.lang.String id, IntMesh mesh, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
      Adds the specified mesh part to the current node. The Mesh will be managed by the model and disposed when the model is disposed. The resources the Material might contain are not managed, use manage(Disposable) to add those to the model.
      Returns:
      The added IntMeshPart.
    • part

      public IntMeshPartBuilder part​(java.lang.String id, int primitiveType, com.badlogic.gdx.graphics.VertexAttributes attributes, com.badlogic.gdx.graphics.g3d.Material material)
      Creates a new IntMeshPart within the current Node and returns a IntMeshPartBuilder which can be used to build the shape of the part. If possible a previously used IntMeshPartBuilder will be reused, to reduce the number of mesh binds. Therefore you can only build one part at a time. The resources the Material might contain are not managed, use manage(Disposable) to add those to the model.
      Returns:
      The IntMeshPartBuilder you can use to build the IntMeshPart.
    • part

      public IntMeshPartBuilder part​(java.lang.String id, int primitiveType, long attributes, com.badlogic.gdx.graphics.g3d.Material material)
      Creates a new IntMeshPart within the current Node and returns a IntMeshPartBuilder which can be used to build the shape of the part. If possible a previously used IntMeshPartBuilder will be reused, to reduce the number of mesh binds. Therefore you can only build one part at a time. The resources the Material might contain are not managed, use manage(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
      Returns:
      The IntMeshPartBuilder you can use to build the IntMeshPart.
    • createBox

      public IntModel createBox​(float width, float height, float depth, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a box shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createBox

      public IntModel createBox​(float width, float height, float depth, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a box shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createRect

      public IntModel createRect​(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a rectangle shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createRect

      public IntModel createRect​(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a rectangle shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCylinder

      public IntModel createCylinder​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCylinder

      public IntModel createCylinder​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCylinder

      public IntModel createCylinder​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
      Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCylinder

      public IntModel createCylinder​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
      Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCone

      public IntModel createCone​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCone

      public IntModel createCone​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCone

      public IntModel createCone​(float width, float height, float depth, int divisions, int hdivisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCone

      public IntModel createCone​(float width, float height, float depth, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
      Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCone

      public IntModel createCone​(float width, float height, float depth, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
      Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCone

      public IntModel createCone​(float width, float height, float depth, int divisions, int hdivisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleFrom, float angleTo)
      Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCapsule

      public IntModel createCapsule​(float radius, float height, int divisions, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCapsule

      public IntModel createCapsule​(float radius, float height, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • rebuildReferences

      public static void rebuildReferences​(IntModel model)
      Resets the references to Materials, IntMeshes and IntMeshParts within the model to the ones used within it's nodes. This will make the model responsible for disposing all referenced meshes.
    • createFromMesh

      @Deprecated public static IntModel createFromMesh​(IntMesh mesh, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
      Deprecated.
    • createFromMesh

      @Deprecated public static IntModel createFromMesh​(IntMesh mesh, int indexOffset, int vertexCount, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
      Deprecated.
    • createFromMesh

      @Deprecated public static IntModel createFromMesh​(float[] vertices, com.badlogic.gdx.graphics.VertexAttribute[] attributes, int[] indices, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material)
      Deprecated.
    • createXYZCoordinates

      public IntModel createXYZCoordinates​(float axisLength, float capLength, float stemThickness, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with three orthonormal vectors shapes. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      axisLength - Length of each axis.
      capLength - is the height of the cap in percentage, must be in (0,1)
      stemThickness - is the percentage of stem diameter compared to cap diameter, must be in (0,1]
      divisions - the amount of vertices used to generate the cap and stem ellipsoidal bases
    • createXYZCoordinates

      public IntModel createXYZCoordinates​(float axisLength, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    • createArrow

      public IntModel createArrow​(float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with an arrow. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      material -
      capLength - is the height of the cap in percentage, must be in (0,1)
      stemThickness - is the percentage of stem diameter compared to cap diameter, must be in (0,1]
      divisions - the amount of vertices used to generate the cap and stem ellipsoidal bases
    • createArrow

      public IntModel createArrow​(com.badlogic.gdx.math.Vector3 from, com.badlogic.gdx.math.Vector3 to, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with an arrow. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
    • createLineGrid

      public IntModel createLineGrid​(int xDivisions, int zDivisions, float xSize, float zSize, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model which represents a grid of lines on the XZ plane. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      xDivisions - row count along x axis.
      zDivisions - row count along z axis.
      xSize - Length of a single row on x.
      zSize - Length of a single row on z.
    • createCylinder

      public IntModel createCylinder​(float width, float height, float depth, int divisions, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createCylinder

      public IntModel createCylinder​(float width, float height, float depth, int divisions, boolean flipNormals, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createIcoSphere

      public IntModel createIcoSphere​(float radius, int recursion, boolean flipNormals, boolean hardEdges, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing an ico-sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createIcoSphere

      public IntModel createIcoSphere​(float radius, int recursion, boolean flipNormals, boolean hardEdges, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
    • createOctahedronSphere

      public IntModel createOctahedronSphere​(float radius, int divisions, boolean flipNormals, boolean hardEdges, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing an octahedron-sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createOctahedronSphere

      public IntModel createOctahedronSphere​(float radius, int divisions, boolean flipNormals, boolean hardEdges, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Creates an octahedron-sphere
      Parameters:
      radius -
      divisions -
      flipNormals -
      hardEdges -
      primitiveType -
      material -
      attributes -
      Returns:
      The model
    • createSphereRing

      public IntModel createSphereRing​(float sphereDiameter, int divisionsU, int divisionsV, float innerRingRadius, float outerRingRadius, int ringDivisions, com.badlogic.gdx.graphics.g3d.Material materialShpere, com.badlogic.gdx.graphics.g3d.Material materialRing, long attributes)
      Convenience method to create a sphere with a ring. Useful for ringed planets such as Saturn. The resources the Materials might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float diameter, int divisionsU, int divisionsV, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float diameter, int divisionsU, int divisionsV, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.
    • createSphere

      public IntModel createSphere​(float width, float height, float depth, int divisionsU, int divisionsV, boolean flipNormals, int primitiveType, com.badlogic.gdx.graphics.g3d.Material material, long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
      Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain are not managed, use IntModel.manageDisposable(Disposable) to add those to the model.
      Parameters:
      attributes - bitwise mask of the VertexAttributes.Usage, only Position, Color, Normal and TextureCoordinates is supported.