Package java.nio

Examples of java.nio.FloatBuffer.capacity()


                dcNorms.clear();
            }
            final FloatBuffer mmNorms = _morphMesh.getMeshData().getNormalBuffer();
            mmNorms.clear();
            if (dcNorms == null || dcNorms.capacity() != mmNorms.capacity()) {
                dcNorms = BufferUtils.createFloatBuffer(mmNorms.capacity());
                dcNorms.clear();
                dataCopy.getMeshData().setNormalBuffer(dcNorms);
            }

            dcNorms.put(mmNorms);
View Full Code Here


            if (dcTexs != null) {
                dcTexs.clear();
            }
            final FloatBuffer mmTexs = _morphMesh.getMeshData().getTextureCoords(0).getBuffer();
            mmTexs.clear();
            if (dcTexs == null || dcTexs.capacity() != mmTexs.capacity()) {
                dcTexs = BufferUtils.createFloatBuffer(mmTexs.capacity());
                dcTexs.clear();
                dataCopy.getMeshData().setTextureCoords(new FloatBufferData(dcTexs, 2), 0);
            }
View Full Code Here

                dcTexs.clear();
            }
            final FloatBuffer mmTexs = _morphMesh.getMeshData().getTextureCoords(0).getBuffer();
            mmTexs.clear();
            if (dcTexs == null || dcTexs.capacity() != mmTexs.capacity()) {
                dcTexs = BufferUtils.createFloatBuffer(mmTexs.capacity());
                dcTexs.clear();
                dataCopy.getMeshData().setTextureCoords(new FloatBufferData(dcTexs, 2), 0);
            }

            dcTexs.put(mmTexs);
View Full Code Here

            }
        });

        final FloatBuffer color1 = torus.getMeshData().getColorBuffer();
        color1.clear();
        for (int i = 0, bLength = color1.capacity(); i < bLength; i += 4) {
            final ReadOnlyColorRGBA c = colorSpread[i % 3];
            color1.put(c.getRed()).put(c.getGreen()).put(c.getBlue()).put(c.getAlpha());
        }
        color1.flip();
        final FloatBuffer color2 = sphere.getMeshData().getColorBuffer();
View Full Code Here

            color1.put(c.getRed()).put(c.getGreen()).put(c.getBlue()).put(c.getAlpha());
        }
        color1.flip();
        final FloatBuffer color2 = sphere.getMeshData().getColorBuffer();
        color2.clear();
        for (int i = 0, bLength = color2.capacity(); i < bLength; i += 4) {
            final ReadOnlyColorRGBA c = colorSpread[i % 3];
            color2.put(c.getRed()).put(c.getGreen()).put(c.getBlue()).put(c.getAlpha());
        }
        color2.flip();
View Full Code Here

        vertexBuffer.put(40).put(10).put(0);
        vertexBuffer.put(30).put(10).put(0);

        meshData.setVertexBuffer(vertexBuffer);

        final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(18, vertexBuffer.capacity() - 1);

        // Strips
        indices.put(0).put(3).put(1).put(2);
        indices.put(4).put(7).put(5).put(6);
View Full Code Here

        vertexBuffer.put(40).put(10).put(0);
        vertexBuffer.put(30).put(10).put(0);

        meshData.setVertexBuffer(vertexBuffer);

        final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(18, vertexBuffer.capacity() - 1);

        // Strips
        indices.put(0).put(3).put(1).put(2);
        indices.put(4).put(7).put(5).put(6);
View Full Code Here

                            }
                            // add joint indices to jointIndexBuffer
                            jointIndexBuffer.put(indices);
                        }

                        final float[] totalWeights = new float[weightBuffer.capacity()];
                        weightBuffer.flip();
                        weightBuffer.get(totalWeights);
                        skMesh.setWeights(totalWeights);

                        final short[] totalIndices = new short[jointIndexBuffer.capacity()];
View Full Code Here

        Node node = new Node("vertIds");
        BitmapText vertId;
        Vector3f pos = new Vector3f();

        FloatBuffer fb = refGeom.getMesh().getFloatBuffer(Type.Position);
        for (int i = 0; i < fb.capacity(); i += 3) {
            pos.set(fb.get(i), fb.get(i + 1), fb.get(i + 2));
            vertId = new BitmapText(DebugMaterials.guiFont);
            vertId.setSize(.1f);
            vertId.setText("v " + (i / 3) + " " + pos);
            vertId.setName("VertID" + (i / 3) + " label - " + pos);
View Full Code Here

    }
   
    if (this.getStrokeWeight() > 0)
      gl.glLineWidth(this.getStrokeWeight());
   
    gl.glDrawArrays(GL.GL_LINE_STRIP, 0, vertBuff.capacity()/3);
    //RESET LINE STIPPLE
    if (lineStipple != 0){
      gl.glDisable(GL.GL_LINE_STIPPLE);
    }
   
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.