Package java.nio

Examples of java.nio.FloatBuffer.limit()


        if (texBuffer.limit() < 2 * (initialTexCoordIndex+ validVertexCount) ) {
      throw new ArrayIndexOutOfBoundsException(
                 J3dI18N.getString("GeometryArray113"));
        }
    } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
        if (texBuffer.limit() < 3 * (initialTexCoordIndex + validVertexCount) ) {
      throw new ArrayIndexOutOfBoundsException(
                 J3dI18N.getString("GeometryArray113"));
        }
    } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
        if (texBuffer.limit() < 4 * (initialTexCoordIndex + validVertexCount)) {
View Full Code Here


        if (texBuffer.limit() < 3 * (initialTexCoordIndex + validVertexCount) ) {
      throw new ArrayIndexOutOfBoundsException(
                 J3dI18N.getString("GeometryArray113"));
        }
    } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
        if (texBuffer.limit() < 4 * (initialTexCoordIndex + validVertexCount)) {
      throw new ArrayIndexOutOfBoundsException(
                 J3dI18N.getString("GeometryArray113"));
        }
    }
      }
View Full Code Here

      else { // nio buffer
    if ((vertexFormat & GeometryArray.INTERLEAVED) == 0){
        if ((vertexType & TEXCOORD_DEFINED) == TF) {
      FloatBuffer texBuffer = (FloatBuffer)refTexCoordsBuffer[i].getROBuffer();
      if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_2) != 0) {
          count = texBuffer.limit()/2;
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
          count = texBuffer.limit()/3;
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
          count = texBuffer.limit()/4;
      }
View Full Code Here

        if ((vertexType & TEXCOORD_DEFINED) == TF) {
      FloatBuffer texBuffer = (FloatBuffer)refTexCoordsBuffer[i].getROBuffer();
      if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_2) != 0) {
          count = texBuffer.limit()/2;
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
          count = texBuffer.limit()/3;
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
          count = texBuffer.limit()/4;
      }
        }
    }
View Full Code Here

      if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_2) != 0) {
          count = texBuffer.limit()/2;
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
          count = texBuffer.limit()/3;
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
          count = texBuffer.limit()/4;
      }
        }
    }
    else {
        count = interleavedFloatBufferImpl.limit()/stride;
View Full Code Here

    IndexedGeometryArrayRetained idx = (IndexedGeometryArrayRetained)this;
    if (idx.maxNormalIndex * 3 >=
        ((FloatBuffer)normals.getROBuffer()).limit()) {
        throw new ArrayIndexOutOfBoundsException(J3dI18N.getString("IndexedGeometryArray26"));
    }
      } else if (bufferImpl.limit() < 3 * (initialNormalIndex + validVertexCount )) {
    throw new ArrayIndexOutOfBoundsException(J3dI18N.getString("GeometryArray111"));
      }
  }
  boolean isLive = source!=null && source.isLive();
  if(isLive){
View Full Code Here

  if (texCoords != null) {
      if(texCoords.bufferType != J3DBuffer.Type.FLOAT)
    throw new IllegalArgumentException(J3dI18N.getString("GeometryArray116"));

      bufferImpl = (FloatBuffer)texCoords.getROBuffer();
      int bufferSize = bufferImpl.limit();

      assert bufferImpl.isDirect();

      int ts = getTexStride();
View Full Code Here

  if (vertexAttrs != null) {
      if(vertexAttrs.bufferType != J3DBuffer.Type.FLOAT)
    throw new IllegalArgumentException(J3dI18N.getString("GeometryArray116"));

      bufferImpl = (FloatBuffer)vertexAttrs.getROBuffer();
      int bufferSize = bufferImpl.limit();

      assert bufferImpl.isDirect();

      int sz = vertexAttrSizes[vertexAttrNum];
View Full Code Here

                  public ResourceHolder<FloatBuffer> next()
                  {
                    final FloatBuffer retVal = myBuffer.asReadOnlyBuffer();

                    if (chunkFactor < myBuffer.remaining()) {
                      retVal.limit(retVal.position() + chunkFactor);
                    }
                    myBuffer.position(myBuffer.position() + retVal.remaining());

                    return StupidResourceHolder.create(retVal);
                  }
View Full Code Here

        }
        FloatBuffer buf = BufferUtils.createFloatBuffer(points.limit());
        points.rewind();
        buf.put(points);
        buf.flip();
        recurseMini(buf, buf.limit() / 3, 0, 0);
    }

    /**
     * Used from calcWelzl. This function recurses to calculate a minimum
     * bounding sphere a few points at a time.
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.