Package java.nio

Examples of java.nio.FloatBuffer.rewind()


            bindVerts.rewind();
            if (storeVerts == null || storeVerts.capacity() != bindVerts.capacity()) {
                storeVerts = BufferUtils.createFloatBuffer(bindVerts.capacity());
                _meshData.setVertexBuffer(storeVerts);
            } else {
                storeVerts.rewind();
            }

            // Get a handle to the source and dest normals buffers
            final FloatBuffer bindNorms = _bindPoseData.getNormalBuffer();
            FloatBuffer storeNorms = _meshData.getNormalBuffer();
View Full Code Here


                if (storeNorms == null || storeNorms.capacity() < bindNorms.capacity()) {
                    storeNorms = BufferUtils.createFloatBuffer(bindNorms.capacity());
                    _meshData.setNormalBuffer(storeNorms);
                } else {
                    storeNorms.rewind();
                }
            }

            Matrix4 jntMat;
            double bindVX, bindVY, bindVZ;
View Full Code Here

      byteBuffer.rewind();
      readonlyBuffer = byteBuffer;
      break;
  case FLOAT:
      FloatBuffer floatBuffer = ((FloatBuffer)buffer).asReadOnlyBuffer();
      floatBuffer.rewind();
      readonlyBuffer = floatBuffer;
      break;
  case DOUBLE:
      DoubleBuffer doubleBuffer = ((DoubleBuffer)buffer).asReadOnlyBuffer();
      doubleBuffer.rewind();
View Full Code Here

        FloatBuffer buf = threadLocal.get();
        if (buf == null) {
      buf = Buffers.newDirectFloatBuffer(array.length);
            threadLocal.set(buf);
        } else {
            buf.rewind();
            if (buf.remaining() < array.length) {
                int newSize = Math.max(2 * buf.remaining(), array.length);
        buf = Buffers.newDirectFloatBuffer(newSize);
                threadLocal.set(buf);
            }
View Full Code Here

                threadLocal.set(buf);
            }
        }
        if (copyData) {
            buf.put(array);
            buf.rewind();
        }
        return buf;
    }

    private static DoubleBuffer getNIOBuffer(double[] array, ThreadLocal<DoubleBuffer> threadLocal, boolean copyData) {
View Full Code Here

            FloatBuffer buf = bufs[i];
            if (buf == null) {
        buf = Buffers.newDirectFloatBuffer(cur.length);
                bufs[i] = buf;
            } else {
                buf.rewind();
                if (buf.remaining() < cur.length) {
                    int newSize = Math.max(2 * buf.remaining(), cur.length);
          buf = Buffers.newDirectFloatBuffer(newSize);
                    bufs[i] = buf;
                }
View Full Code Here

          buf = Buffers.newDirectFloatBuffer(newSize);
                    bufs[i] = buf;
                }
            }
            buf.put(cur);
            buf.rewind();
        }

        return bufs;
    }
}
View Full Code Here

        tempQuat.lookAt(extent, Vector3f.UNIT_Y);
        tempQuat.normalizeLocal();

        VertexBuffer pvb = getBuffer(Type.Position);
        FloatBuffer buffer = (FloatBuffer)pvb.getData();
        buffer.rewind();
        for (int i = 0; i < positions.length; i += 3) {
            Vector3f vec = tempVec.set(positions[i],
                    positions[i + 1],
                    positions[i + 2]);
            vec.multLocal(len);
View Full Code Here

        }

        FloatBuffer b = BufferUtils.createFloatBuffer(points);
        FloatBuffer a = (FloatBuffer) vb.getData();
        b.rewind();
        a.rewind();
        a.put(b);
        a.rewind();

        vb.updateData(a);
       
View Full Code Here

        FloatBuffer b = BufferUtils.createFloatBuffer(points);
        FloatBuffer a = (FloatBuffer) vb.getData();
        b.rewind();
        a.rewind();
        a.put(b);
        a.rewind();

        vb.updateData(a);
       
        updateBound();
    }
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.