public HeightField (boolean isStatic, int width, int height, boolean smooth, int attributes) { this(isStatic, width, height, smooth, MeshBuilder.createAttributes(attributes)); }
/** Begin building a mesh. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public void begin (final long attributes, int primitiveType) { begin(createAttributes(attributes), primitiveType); }
/** Begin building a mesh. Call {@link #part(String, int)} to start a {@link MeshPart}. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public void begin (final long attributes) { begin(createAttributes(attributes), -1); }
/** 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); }
/** Begin building a mesh. Call {@link #part(String, int)} to start a {@link MeshPart}. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public void begin (final long attributes) { begin(createAttributes(attributes), -1); }
/** Begin building a mesh. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public void begin (final long attributes, int primitiveType) { begin(createAttributes(attributes), primitiveType); }
/** Begin building a mesh. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public void begin (final long attributes, int primitiveType) { begin(createAttributes(attributes), primitiveType); }
/** 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); }
/** Begin building a mesh. Call {@link #part(String, int)} to start a {@link MeshPart}. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public void begin (final long attributes) { begin(createAttributes(attributes), -1); }
private Terrain(int vertexResolution) { this.transform = new Matrix4(); this.attribs = MeshBuilder.createAttributes(VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates); this.posPos = attribs.getOffset(VertexAttributes.Usage.Position, -1); this.norPos = attribs.getOffset(VertexAttributes.Usage.Normal, -1); this.uvPos = attribs.getOffset(VertexAttributes.Usage.TextureCoordinates, -1); this.stride = attribs.vertexSize / 4; this.vertexResolution = vertexResolution; this.heightData = new float[vertexResolution * vertexResolution]; this.terrainTexture = new TerrainTexture(); this.terrainTexture.setTerrain(this); material = new Material(); material.set(new TerrainTextureAttribute(TerrainTextureAttribute.ATTRIBUTE_SPLAT0, terrainTexture)); }