Examples of FloatArray


Examples of com.badlogic.gdx.utils.FloatArray

      offset = 0;
      sort(points, count);
    }

    // Lower hull.
    FloatArray hull = this.hull;
    hull.clear();
    for (int i = offset; i < end; i += 2) {
      float x = points[i];
      float y = points[i + 1];
      while (hull.size >= 4 && ccw(x, y) <= 0)
        hull.size -= 2;
      hull.add(x);
      hull.add(y);
    }

    // Upper hull.
    for (int i = end - 4, t = hull.size + 2; i >= offset; i -= 2) {
      float x = points[i];
      float y = points[i + 1];
      while (hull.size >= t && ccw(x, y) <= 0)
        hull.size -= 2;
      hull.add(x);
      hull.add(y);
    }

    return hull;
  }
View Full Code Here

Examples of com.badlogic.gdx.utils.FloatArray

    return hull;
  }

  /** Returns > 0 if the points are a counterclockwise turn, < 0 if clockwise, and 0 if colinear. */
  private float ccw (float p3x, float p3y) {
    FloatArray hull = this.hull;
    int size = hull.size;
    float p1x = hull.get(size - 4);
    float p1y = hull.get(size - 3);
    float p2x = hull.get(size - 2);
    float p2y = hull.peek();
    return (p2x - p1x) * (p3y - p1y) - (p2y - p1y) * (p3x - p1x);
  }
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.FloatArray

   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(cube.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(cube.getTexCoords()));

    checkErrors();
  }
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.FloatArray

        -2.0f, 1.0f, -1.0f, -2.0f };
    int[] indices = new int[] {0, 1, 2};
   
    // create the vertexBuffer
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER, BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(vertices));
   
    // create the indexBuffer
    indexBuffer = new Buffer(webGLWrapper, BufferTarget.ELEMENT_ARRAY_BUFFER, BufferUsage.STREAM_DRAW);
    indexBuffer.addData(INDICES, new UnsignedByteArray(indices));

    float[] colors = new float[] { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f,
        0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f };
    buffer.addData(COLORS, new FloatArray(colors));
  }
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.FloatArray

   * Initializes the buffers for vertex coordinates, normals and texture
   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER, BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(sphere.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(sphere.getTexCoords()));
    buffer.addData(NORMALS, new FloatArray(sphere.getVertexNormals()));
    indicesBuffer = new Buffer(webGLWrapper, BufferTarget.ELEMENT_ARRAY_BUFFER, BufferUsage.STREAM_DRAW);
    indicesBuffer.addData(INDICES, new UnsignedByteArray(sphere.getIndices()));

    checkErrors();
  }
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.FloatArray

   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(cube.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(cube.getTexCoords()));
    buffer.addData(NORMALS, new FloatArray(cube.getVertexNormals()));

    checkErrors();
  }
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.FloatArray

   * coordinates.
   */
  private void initBuffers() {
    buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    buffer.addData(VERTICES, new FloatArray(cube.getVertices()));
    buffer.addData(TEX_COORDS, new FloatArray(cube.getTexCoords()));

    checkErrors();
  }
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.FloatArray

    float[] vertices = new float[] { 0.0f, 1.0f, -2.0f, -1.0f, -1.0f,
        -2.0f, 1.0f, -1.0f, -2.0f };
    // create the vertexBuffer
    vertexBuffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER,
        BufferUsage.STATIC_DRAW);
    vertexBuffer.addData("vertices", new FloatArray(vertices));
  }
View Full Code Here

Examples of com.linkedin.data.template.FloatArray

    result = test("[2, 3, 4]", LongArray.class);
    Assert.assertEquals(result, new LongArray(Arrays.asList(2L, 3L, 4L)));
    Assert.assertSame(result.getClass(), LongArray.class);

    result = test("[1.1, 2.2, 3.3]", FloatArray.class);
    Assert.assertEquals(result, new FloatArray(Arrays.asList(1.1F, 2.2F, 3.3F)));
    Assert.assertSame(result.getClass(), FloatArray.class);

    result = test("[2.2, 3.3, 4.4]", DoubleArray.class);
    Assert.assertEquals(result, new DoubleArray(Arrays.asList(2.2D, 3.3D, 4.4D)));
    Assert.assertSame(result.getClass(), DoubleArray.class);
View Full Code Here

Examples of de.ailis.jollada.model.FloatArray

     */

    @Test
    public void testConstructor()
    {
        final FloatArray array = new FloatArray(16);
        assertEquals(16, array.getCount());
        assertNull(array.getId());
        assertNull(array.getName());
        assertEquals(38, array.getMagnitude());
        assertEquals(6, array.getDigits());
    }
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.