Package java.nio

Examples of java.nio.FloatBuffer.rewind()


        fA *= _sideLength;
        fB *= _sideLength;
        fC *= _sideLength;

        final FloatBuffer vbuf = _meshData.getVertexBuffer();
        vbuf.rewind();
        vbuf.put((float) fA).put((float) fA).put((float) fA);
        vbuf.put((float) fA).put((float) fA).put((float) -fA);
        vbuf.put((float) fA).put((float) -fA).put((float) fA);
        vbuf.put((float) fA).put((float) -fA).put((float) -fA);
        vbuf.put((float) -fA).put((float) fA).put((float) fA);
View Full Code Here


        final int numVertices = path.size() * shapeBuffer.limit();

        FloatBuffer vertices;
        if (_meshData.getVertexBuffer() != null && _meshData.getVertexBuffer().limit() == numVertices) {
            vertices = _meshData.getVertexBuffer();
            vertices.rewind();
        } else {
            vertices = BufferUtils.createFloatBuffer(numVertices);
        }

        FloatBuffer normals = null;
View Full Code Here

        FloatBuffer normals = null;
        if (shapeNormalBuffer != null) {
            if (_meshData.getNormalBuffer() != null && _meshData.getNormalBuffer().limit() == numVertices) {
                normals = _meshData.getNormalBuffer();
                normals.rewind();
            } else {
                normals = BufferUtils.createFloatBuffer(numVertices);
            }
        }
View Full Code Here

            // create little endian store
            final ByteBuffer buf = ByteBuffer.allocate(array.length).order(ByteOrder.LITTLE_ENDIAN);

            // place buffer into store.
            value.rewind();
            buf.asFloatBuffer().put(value);
            buf.rewind();

            // Pull out store as array
            buf.get(array);
View Full Code Here

                // Normals
                if (useNormals) {
                    final FloatBuffer nb = md.getNormalBuffer();
                    if (nb != null) {
                        nb.rewind();
                        normals.getBuffer().put(mesh.getWorldNormals(null));
                    } else {
                        for (int i = 0; i < md.getVertexCount(); i++) {
                            normals.getBuffer().put(DEFAULT_NORMAL);
                        }
View Full Code Here

                // Colors
                if (useColors) {
                    final FloatBuffer cb = md.getColorBuffer();
                    if (cb != null) {
                        cb.rewind();
                        colors.getBuffer().put(cb);
                    } else {
                        for (int i = 0; i < md.getVertexCount(); i++) {
                            colors.getBuffer().put(DEFAULT_COLOR);
                        }
View Full Code Here

                if (useTextures) {
                    for (int i = 0; i < maxTextures; i++) {
                        final FloatBuffer dest = texCoordsList.get(i).getBuffer();
                        final FloatBuffer tb = md.getTextureBuffer(i);
                        if (tb != null) {
                            tb.rewind();
                            dest.put(tb);
                        } else {
                            for (int j = 0; j < md.getVertexCount() * texCoords; j++) {
                                dest.put(DEFAULT_TEXCOORD);
                            }
View Full Code Here

            final double scaleWidth = texWidth / (StatCollector.getMaxSamples() - 1.0);
            final double scaleHeight = texHeight / (entry.max * 1.02);
            entry.point.setScale(new Vector3(scaleWidth, scaleHeight, 1));
            entry.line.getMeshData().setVertexBuffer(fb);
            entry.line.setScale(new Vector3(scaleWidth, scaleHeight, 1));
            fb.rewind();

            // - attach point/line to root as needed
            if (!_graphRoot.equals(entry.line.getParent())) {
                _graphRoot.attachChild(entry.line);
            }
View Full Code Here

    public Line updateLineKey(final StatType type, Line lineKey) {
        if (lineKey == null) {
            lineKey = new Line("lk", BufferUtils.createVector3Buffer(2), null, null, null);
            final FloatBuffer fb = BufferUtils.createFloatBuffer(new Vector3[] { new Vector3(0, 0, 0),
                    new Vector3(30, 0, 0) });
            fb.rewind();
            lineKey.getMeshData().setVertexBuffer(fb);
        }

        lineKey.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        lineKey.getMeshData().setIndexMode(IndexMode.LineStrip);
View Full Code Here

        tbuf.clear();
        tbuf.put(0).put(0);
        tbuf.put(0).put(maxV);
        tbuf.put(maxU).put(maxV);
        tbuf.put(maxU).put(0);
        tbuf.rewind();

        final TextureState texState = new TextureState();
        texState.setTexture(graphTexture);
        quad.setRenderState(texState);
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.