Package gnu.trove.list.array

Examples of gnu.trove.list.array.TFloatArrayList


    int posize = postags.size();
    float[][] nweights = new float[posize][];
    TFloatArrayList[] ww = new TFloatArrayList[posize];
    for (int i = 0; i < posize; i++) {
      nweights[i] = models[i].getWeights();
      ww[i] = new TFloatArrayList();
    }
    int length = nweights[0].length;

    StringFeatureAlphabet features = (StringFeatureAlphabet) factory.DefaultFeatureAlphabet(Type.String);
    TIntObjectHashMap<String> index = new TIntObjectHashMap<String>();
View Full Code Here


import org.spout.vanilla.world.lighting.VanillaLighting;

public class LightBufferEffect implements BufferEffect {
  @Override
  public void post(ChunkSnapshotModel chunkModel, BufferContainer container) {
    TFloatArrayList vertexBuffer = (TFloatArrayList) container.getBuffers().get(0);

    /*
     * Use a shader light (2) and skylight (4)
     *
     * WE NEED TO USE 2 BECAUSE WE DON'T USE COLOR
     * OPENGL 2 NEED TO USE LAYOUT IN THE ORDER
     * WE CAN'T USE 3 IF 2 ISN'T USED
     *
     * One float per vertice
     * file://Vanilla/shaders/terrain.120.vert
     * file://Vanilla/shaders/terrain.330.vert
     */

    TFloatArrayList lightBuffer = (TFloatArrayList) container.getBuffers().get(1);
    TFloatArrayList skylightBuffer = (TFloatArrayList) container.getBuffers().get(4);

    if (lightBuffer == null) {
      lightBuffer = new TFloatArrayList(vertexBuffer.size() / 4);
      container.setBuffers(1, lightBuffer);
    }

    if (skylightBuffer == null) {
      skylightBuffer = new TFloatArrayList(vertexBuffer.size() / 4);
      container.setBuffers(4, skylightBuffer);
    }

    for (int i = 0; i < vertexBuffer.size(); ) {
      float x = vertexBuffer.get(i++);
View Full Code Here

    final Map<Integer, Object> buffers = value.getBuffers();
    final TFloatList vertices = (TFloatList) buffers.get(0);
    final int vertexCount = vertices.size();
    final TFloatList biomeColors;
    if (!buffers.containsKey(5)) {
      biomeColors = new TFloatArrayList(vertexCount);
      buffers.put(5, biomeColors);
    } else {
      biomeColors = (TFloatList) buffers.get(5);
    }
    // This colors whole block faces at once. Doing it for each vertex is too expensive.
View Full Code Here

        return translationVectorArray;
    }

    protected void parseMeshData(Element rootElement) throws ColladaParseException {

        vertices = new TFloatArrayList();
        texCoord0 = new TFloatArrayList();
        texCoord1 = new TFloatArrayList();
        normals = new TFloatArrayList();
        colors = new TFloatArrayList();
        indices = new TIntArrayList();
        int vertCount = 0;

        ElementSet upAxisSet = rootElement.find("asset", "up_axis");
        if (1 != upAxisSet.size()) {
View Full Code Here

        public IntBuffer finalVertices;
        public IntBuffer finalIndices;

        public VertexElements() {
            vertexCount = 0;
            normals = new TFloatArrayList();
            vertices = new TFloatArrayList();
            tex = new TFloatArrayList();
            color = new TFloatArrayList();
            indices = new TIntArrayList();
            flags = new TIntArrayList();
        }
View Full Code Here

        return result;
    }

    @Override
    public TFloatList getAsFloatArray() {
        TFloatList result = new TFloatArrayList(size());
        for (JsonElement element : array) {
            result.add(element.getAsFloat());
        }
        return result;
    }
View Full Code Here

        return result;
    }

    @Override
    public TFloatList getAsFloatArray() {
        TFloatList result = new TFloatArrayList(data.getFloatCount());
        for (int i = 0; i < data.getFloatCount(); ++i) {
            result.add(data.getFloat(i));
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of gnu.trove.list.array.TFloatArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.