Package java.nio

Examples of java.nio.FloatBuffer.rewind()


        VertexBuffer position = mesh.getBuffer(VertexBuffer.Type.BindPosePosition);
        if (position == null) {
            position = mesh.getBuffer(VertexBuffer.Type.Position);
        }
        FloatBuffer pos = (FloatBuffer) position.getDataReadOnly();
        pos.rewind();
       
        while (pos.remaining() != 0) {
            Vertex v = new Vertex();
            v.position.setX(pos.get());
            v.position.setY(pos.get());
View Full Code Here


            } else {
                vertexList.add(v);
            }
            vertexLookup.add(v);
        }
        pos.rewind();
    }
   
    private Vertex findSimilar(Vertex v) {
        for (Vertex vertex : vertexList) {
            if (vertex.position.equals(v.position)) {
View Full Code Here

        fpb.rewind();
        fpb = BufferUtils.ensureLargeEnough(fpb, vertCount * 3);
        fpb.limit(vertCount * 3);
        pb.updateData(fpb);

        ftb.rewind();
        ftb = BufferUtils.ensureLargeEnough(ftb, vertCount * 2);
        ftb.limit(vertCount * 2);
        tb.updateData(ftb);

        bcb.rewind();
View Full Code Here

                fq.appendColors(bcb);
            }
        }

        fpb.rewind();
        ftb.rewind();
        sib.rewind();
        bcb.rewind();

        updateModelBound();
    }
View Full Code Here

        }else{
            FloatBuffer value = BufferUtils.createFloatBuffer(length);
            for (int x = 0; x < length; x++) {
                value.put(readFloatForBuffer(content));
            }
            value.rewind();
            return value;
        }
    }

    // int buffer
View Full Code Here

        // NOTE: This code assumes the vertex buffer is in bind pose
        // resetToBind() has been called this frame
        VertexBuffer vb = mesh.getBuffer(Type.Position);
        FloatBuffer fvb = (FloatBuffer) vb.getData();
        fvb.rewind();

        VertexBuffer nb = mesh.getBuffer(Type.Normal);
        FloatBuffer fnb = (FloatBuffer) nb.getData();
        fnb.rewind();
View Full Code Here

        FloatBuffer fvb = (FloatBuffer) vb.getData();
        fvb.rewind();

        VertexBuffer nb = mesh.getBuffer(Type.Normal);
        FloatBuffer fnb = (FloatBuffer) nb.getData();
        fnb.rewind();

        // get boneIndexes and weights for mesh
        ByteBuffer ib = (ByteBuffer) mesh.getBuffer(Type.BoneIndex).getData();
        FloatBuffer wb = (FloatBuffer) mesh.getBuffer(Type.BoneWeight).getData();
View Full Code Here

        // get boneIndexes and weights for mesh
        ByteBuffer ib = (ByteBuffer) mesh.getBuffer(Type.BoneIndex).getData();
        FloatBuffer wb = (FloatBuffer) mesh.getBuffer(Type.BoneWeight).getData();

        ib.rewind();
        wb.rewind();

        float[] weights = wb.array();
        byte[] indices = ib.array();
        int idxWeights = 0;
View Full Code Here

        // NOTE: This code assumes the vertex buffer is in bind pose
        // resetToBind() has been called this frame
        VertexBuffer vb = mesh.getBuffer(Type.Position);
        FloatBuffer fvb = (FloatBuffer) vb.getData();
        fvb.rewind();

        VertexBuffer nb = mesh.getBuffer(Type.Normal);

        FloatBuffer fnb = (FloatBuffer) nb.getData();
        fnb.rewind();
View Full Code Here

        // update data in vertex buffers
        positions.rewind();
        colors.rewind();
        sizes.rewind();
        texcoords.rewind();
        for (int i = 0; i < particles.length; i++){
            Particle p = particles[i];
           
            positions.put(p.position.x)
                     .put(p.position.y)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.