/** Starts a new MeshPart. The mesh part is not usable until end() is called. This will reset the current color and vertex * transformation. * @see #part(String, int, MeshPart) */ public MeshPart part (final String id, int primitiveType) { return part(id, primitiveType, new MeshPart()); }
/** Starts a new MeshPart. The mesh part is not usable until end() is called. This will reset the current color and vertex * transformation. * @see #part(String, int, MeshPart) */ public MeshPart part (final String id, int primitiveType) { return part(id, primitiveType, new MeshPart()); }
/** 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; }
/** Initialize ShapeCache for mesh generation * @param primitiveType OpenGL primitive type */ public MeshPartBuilder begin (int primitiveType) { if (building) throw new GdxRuntimeException("Call end() after calling begin()"); building = true; builder.begin(mesh.getVertexAttributes()); builder.part(id, primitiveType, renderable.meshPart); return builder; }
/** Initialize ShapeCache for mesh generation * @param primitiveType OpenGL primitive type */ public MeshPartBuilder begin (int primitiveType) { if (building) throw new GdxRuntimeException("Call end() after calling begin()"); building = true; builder.begin(mesh.getVertexAttributes()); builder.part(id, primitiveType, renderable.meshPart); return builder; }
MeshPart part = meshBuilder.part("", primitiveType, meshPartPool.obtain()); renderables.add(obtainRenderable(material, primitiveType)); final MeshPart newPart = meshBuilder.part("", pt, meshPartPool.obtain()); final Renderable previous = renderables.get(renderables.size - 1); previous.meshPart.offset = part.offset;
MeshPart part = meshBuilder.part("", primitiveType, meshPartPool.obtain()); renderables.add(obtainRenderable(material, primitiveType)); final MeshPart newPart = meshBuilder.part("", pt, meshPartPool.obtain()); final Renderable previous = renderables.get(renderables.size - 1); previous.meshPart.offset = part.offset;
/** Starts a new MeshPart. The mesh part is not usable until end() is called. This will reset the current color and vertex * transformation. * @see #part(String, int, MeshPart) */ public MeshPart part (final String id, int primitiveType) { return part(id, primitiveType, new MeshPart()); }
/** 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; }
/** Initialize ShapeCache for mesh generation * @param primitiveType OpenGL primitive type */ public MeshPartBuilder begin (int primitiveType) { if (building) throw new GdxRuntimeException("Call end() after calling begin()"); building = true; builder.begin(mesh.getVertexAttributes()); builder.part(id, primitiveType, renderable.meshPart); return builder; }
MeshBuilder meshBuilder = new MeshBuilder(); meshBuilder.begin(VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal); meshBuilder.part("id1", GL20.GL_TRIANGLES); meshBuilder.box(1f, 1f, 1f); Mesh mesh1 = meshBuilder.end(); meshBuilder.begin(VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal); meshBuilder.part("id2", GL20.GL_TRIANGLES); meshBuilder.cylinder(1f, 1f, 1f, 16); Mesh mesh2 = meshBuilder.end(); ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin(); modelBuilder.part("part1", mesh1, GL20.GL_TRIANGLES, new Material(ColorAttribute.createDiffuse(Color.RED))); modelBuilder.part("part2", mesh2, GL20.GL_TRIANGLES, new Material(ColorAttribute.createDiffuse(Color.RED))) .mesh.transform(new Matrix4().translate(1, 0, 0f));
MeshPart part = meshBuilder.part("", primitiveType, meshPartPool.obtain()); renderables.add(obtainRenderable(material, primitiveType)); final MeshPart newPart = meshBuilder.part("", pt, meshPartPool.obtain()); final Renderable previous = renderables.get(renderables.size - 1); previous.meshPart.offset = part.offset;