/** 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 {@link #manage(Disposable)} to add those to the * model. * @return The added MeshPart. */ public MeshPart part (final String id, final Mesh mesh, int primitiveType, final Material material) { return part(id, mesh, primitiveType, 0, mesh.getNumIndices(), 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 {@link #manage(Disposable)} to add those to the * model. * @return The added MeshPart. */ public MeshPart part (final String id, final Mesh mesh, int primitiveType, final Material material) { return part(id, mesh, primitiveType, 0, mesh.getNumIndices(), material); }
/** Creates a new MeshPart within the current Node and returns a {@link MeshPartBuilder} which can be used to build the shape of * the part. If possible a previously used {@link MeshPartBuilder} 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 * {@link #manage(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. * @return The {@link MeshPartBuilder} you can use to build the MeshPart. */ public MeshPartBuilder part (final String id, int primitiveType, final long attributes, final Material material) { return part(id, primitiveType, MeshBuilder.createAttributes(attributes), material); }
/** Creates a new MeshPart within the current Node and returns a {@link MeshPartBuilder} which can be used to build the shape of * the part. If possible a previously used {@link MeshPartBuilder} 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 * {@link #manage(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. * @return The {@link MeshPartBuilder} you can use to build the MeshPart. */ public MeshPartBuilder part (final String id, int primitiveType, final long attributes, final Material material) { return part(id, primitiveType, MeshBuilder.createAttributes(attributes), material); }
/** Creates a new MeshPart within the current Node and returns a {@link MeshPartBuilder} which can be used to build the shape of * the part. If possible a previously used {@link MeshPartBuilder} 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 * {@link #manage(Disposable)} to add those to the model. * @return The {@link MeshPartBuilder} you can use to build the MeshPart. */ public MeshPartBuilder part (final String id, int primitiveType, final VertexAttributes attributes, final Material material) { final MeshBuilder builder = getBuilder(attributes); part(builder.part(id, primitiveType), material); return builder; }
/** Creates a new MeshPart within the current Node and returns a {@link MeshPartBuilder} which can be used to build the shape of * the part. If possible a previously used {@link MeshPartBuilder} 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 * {@link #manage(Disposable)} to add those to the model. * @return The {@link MeshPartBuilder} you can use to build the MeshPart. */ public MeshPartBuilder part (final String id, int primitiveType, final VertexAttributes attributes, final Material material) { final MeshBuilder builder = getBuilder(attributes); part(builder.part(id, primitiveType), material); return builder; }
/** Convenience method to create a model with a single node containing a rectangle shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model 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, final Material material, final long attributes) { begin(); part("rect", primitiveType, attributes, material).rect(x00, y00, z00, x10, y10, z10, x11, y11, z11, x01, y01, z01, normalX, normalY, normalZ); return end(); }
/** Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCone (float width, float height, float depth, int divisions, int primitiveType, final Material material, final long attributes, float angleFrom, float angleTo) { begin(); part("cone", primitiveType, attributes, material).cone(width, height, depth, divisions, angleFrom, angleTo); return end(); }
/** Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createSphere (float width, float height, float depth, int divisionsU, int divisionsV, int primitiveType, final Material material, final long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo) { begin(); part("cylinder", primitiveType, attributes, material).sphere(width, height, depth, divisionsU, divisionsV, angleUFrom, angleUTo, angleVFrom, angleVTo); return end(); }
/** Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCapsule (float radius, float height, int divisions, int primitiveType, final Material material, final long attributes) { begin(); part("capsule", primitiveType, attributes, material).capsule(radius, height, divisions); return end(); }
/** Convenience method to create a model with a single node containing a box shape. The resources the Material might contain are * not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createBox (float width, float height, float depth, int primitiveType, final Material material, final long attributes) { begin(); part("box", primitiveType, attributes, material).box(width, height, depth); return end(); }
/** Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCylinder (float width, float height, float depth, int divisions, int primitiveType, final Material material, final long attributes, float angleFrom, float angleTo) { begin(); part("cylinder", primitiveType, attributes, material).cylinder(width, height, depth, divisions, angleFrom, angleTo); return end(); }
/** Convenience method to create a model with an arrow. The resources the Material might contain are not managed, use * {@link Model#manageDisposable(Disposable)} to add those to the model. * @param material * @param capLength is the height of the cap in percentage, must be in (0,1) * @param stemThickness is the percentage of stem diameter compared to cap diameter, must be in (0,1] * @param divisions the amount of vertices used to generate the cap and stem ellipsoidal bases */ public Model createArrow (float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions, int primitiveType, Material material, long attributes) { begin(); part("arrow", primitiveType, attributes, material).arrow(x1, y1, z1, x2, y2, z2, capLength, stemThickness, divisions); return end(); }
/** Convenience method to create a model with a single node containing a cylinder shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCylinder (float width, float height, float depth, int divisions, int primitiveType, final Material material, final long attributes, float angleFrom, float angleTo) { begin(); part("cylinder", primitiveType, attributes, material).cylinder(width, height, depth, divisions, angleFrom, angleTo); return end(); }
/** Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCapsule (float radius, float height, int divisions, int primitiveType, final Material material, final long attributes) { begin(); part("capsule", primitiveType, attributes, material).capsule(radius, height, divisions); return end(); }
/** Convenience method to create a model with a single node containing a rectangle shape. The resources the Material might * contain are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model 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, final Material material, final long attributes) { begin(); part("rect", primitiveType, attributes, material).rect(x00, y00, z00, x10, y10, z10, x11, y11, z11, x01, y01, z01, normalX, normalY, normalZ); return end(); }
/** Convenience method to create a model with a single node containing a cone shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCone (float width, float height, float depth, int divisions, int primitiveType, final Material material, final long attributes, float angleFrom, float angleTo) { begin(); part("cone", primitiveType, attributes, material).cone(width, height, depth, divisions, angleFrom, angleTo); return end(); }
/** Convenience method to create a model with a single node containing a sphere shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createSphere (float width, float height, float depth, int divisionsU, int divisionsV, int primitiveType, final Material material, final long attributes, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo) { begin(); part("cylinder", primitiveType, attributes, material).sphere(width, height, depth, divisionsU, divisionsV, angleUFrom, angleUTo, angleVFrom, angleVTo); return end(); }
/** Convenience method to create a model with an arrow. The resources the Material might contain are not managed, use * {@link Model#manageDisposable(Disposable)} to add those to the model. * @param material * @param capLength is the height of the cap in percentage, must be in (0,1) * @param stemThickness is the percentage of stem diameter compared to cap diameter, must be in (0,1] * @param divisions the amount of vertices used to generate the cap and stem ellipsoidal bases */ public Model createArrow (float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions, int primitiveType, Material material, long attributes) { begin(); part("arrow", primitiveType, attributes, material).arrow(x1, y1, z1, x2, y2, z2, capLength, stemThickness, divisions); return end(); }
/** Convenience method to create a model with a single node containing a box shape. The resources the Material might contain are * not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createBox (float width, float height, float depth, int primitiveType, final Material material, final long attributes) { begin(); part("box", primitiveType, attributes, material).box(width, height, depth); return end(); }