congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ShortArray.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
com.badlogic.gdx.utils.ShortArray

Best Java code snippets using com.badlogic.gdx.utils.ShortArray.get (Showing top 11 results out of 315)

origin: libgdx/libgdx

/** Removes from this array all of elements contained in the specified array.
 * @return true if this array was modified. */
public boolean removeAll (ShortArray array) {
  int size = this.size;
  int startSize = size;
  short[] items = this.items;
  for (int i = 0, n = array.size; i < n; i++) {
    short item = array.get(i);
    for (int ii = 0; ii < size; ii++) {
      if (item == items[ii]) {
        removeIndex(ii);
        size--;
        break;
      }
    }
  }
  return size != startSize;
}
origin: libgdx/libgdx

/** Removes from this array all of elements contained in the specified array.
 * @return true if this array was modified. */
public boolean removeAll (ShortArray array) {
  int size = this.size;
  int startSize = size;
  short[] items = this.items;
  for (int i = 0, n = array.size; i < n; i++) {
    short item = array.get(i);
    for (int ii = 0; ii < size; ii++) {
      if (item == items[ii]) {
        removeIndex(ii);
        size--;
        break;
      }
    }
  }
  return size != startSize;
}
origin: libgdx/libgdx

public void render () {
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  renderer.setColor(Color.RED);
  renderer.begin(ShapeType.Filled);
  for (int i = 0; i < points.size; i += 2)
    renderer.circle(points.get(i), points.get(i + 1), 4, 12);
  renderer.end();
  renderer.setColor(Color.WHITE);
  renderer.begin(ShapeType.Line);
  for (int i = 0; i < triangles.size; i += 3) {
    int p1 = triangles.get(i) * 2;
    int p2 = triangles.get(i + 1) * 2;
    int p3 = triangles.get(i + 2) * 2;
    renderer.triangle( //
      points.get(p1), points.get(p1 + 1), //
      points.get(p2), points.get(p2 + 1), //
      points.get(p3), points.get(p3 + 1));
  }
  renderer.end();
}
origin: libgdx/libgdx

final int o = tempOffset + s;
if ((iv > 0) && (iu > 0)) // FIXME don't duplicate lines and points
  builder.rect(tmpIndices.get(tempOffset), tmpIndices.get((o - 1) % s), tmpIndices.get((o - (divisionsU + 2)) % s),
    tmpIndices.get((o - (divisionsU + 1)) % s));
tempOffset = (tempOffset + 1) % tmpIndices.size;
origin: libgdx/libgdx

final int o = tempOffset + s;
if ((iv > 0) && (iu > 0)) // FIXME don't duplicate lines and points
  builder.rect(tmpIndices.get(tempOffset), tmpIndices.get((o - 1) % s), tmpIndices.get((o - (divisionsU + 2)) % s),
    tmpIndices.get((o - (divisionsU + 1)) % s));
tempOffset = (tempOffset + 1) % tmpIndices.size;
origin: com.badlogicgames.gdx/gdx

/** Removes from this array all of elements contained in the specified array.
 * @return true if this array was modified. */
public boolean removeAll (ShortArray array) {
  int size = this.size;
  int startSize = size;
  short[] items = this.items;
  for (int i = 0, n = array.size; i < n; i++) {
    short item = array.get(i);
    for (int ii = 0; ii < size; ii++) {
      if (item == items[ii]) {
        removeIndex(ii);
        size--;
        break;
      }
    }
  }
  return size != startSize;
}
origin: lycying/c2d-engine

public static void splitPolygon(PolygonFixtureDefModel object) {
  object.vertices.clear();
  final FloatArray vertices = new FloatArray();
  for (Vector2 v : object.polygon) {
    vertices.add(v.x);
    vertices.add(v.y);
  }
  ShortArray temp = earClippingTriangulator.computeTriangles(vertices);
  for (int i = 0; i < temp.size; i += 3) {
    Vector2[] vv = new Vector2[3];
    vv[0] = new Vector2(vertices.get(2 * temp.get(i)), vertices.get(2 * temp.get(i) + 1));
    vv[1] = new Vector2(vertices.get(2 * temp.get(i + 1)), vertices.get(2 * temp.get(i + 1) + 1));
    vv[2] = new Vector2(vertices.get(2 * temp.get(i + 2)), vertices.get(2 * temp.get(i + 2) + 1));
    if (Mathutils.isClockwise(vv[0], vv[1], vv[2])) {
      Vector2 vt = vv[0];
      vv[0] = vv[2];
      vv[2] = vt;
    }
    object.vertices.add(vv);
  }
}
origin: langurmonkey/gaiasky

if ((iv > 0) && (iu > 0)) // FIXME don't duplicate lines and points
  if (!flipNormals) {
    rect(tmpIndices.get(tempOffset), tmpIndices.get((o - 1) % s), tmpIndices.get((o - (divisionsU + 2)) % s), tmpIndices.get((o - (divisionsU + 1)) % s));
  } else {
    rect(tmpIndices.get(tempOffset), tmpIndices.get((o - (divisionsU + 1)) % s), tmpIndices.get((o - (divisionsU + 2)) % s), tmpIndices.get((o - 1) % s));
origin: lycying/c2d-engine

render.setColor(focus ? FocusColor : POLYGON);
render.begin(ShapeType.Filled);
render.triangle(vertices.get(2 * temp.get(i)), vertices.get(2 * temp.get(i) + 1), vertices.get(2 * temp.get(i + 1)), vertices.get(2 * temp.get(i + 1) + 1), vertices.get(2 * temp.get(i + 2)), vertices.get(2 * temp.get(i + 2) + 1));
render.end();
render.setColor(Color.CYAN);
render.begin(ShapeType.Line);
render.triangle(vertices.get(2 * temp.get(i)), vertices.get(2 * temp.get(i) + 1), vertices.get(2 * temp.get(i + 1)), vertices.get(2 * temp.get(i + 1) + 1), vertices.get(2 * temp.get(i + 2)), vertices.get(2 * temp.get(i + 2) + 1));
render.end();
origin: com.badlogicgames.gdx/gdx

final int o = tempOffset + s;
if ((iv > 0) && (iu > 0)) // FIXME don't duplicate lines and points
  builder.rect(tmpIndices.get(tempOffset), tmpIndices.get((o - 1) % s), tmpIndices.get((o - (divisionsU + 2)) % s),
    tmpIndices.get((o - (divisionsU + 1)) % s));
tempOffset = (tempOffset + 1) % tmpIndices.size;
origin: langurmonkey/gaiasky

final int o = tempOffset + s;
if ((iv > 0) && (iu > 0)) // FIXME don't duplicate lines and points
  rect(tmpIndices.get(tempOffset), tmpIndices.get((o - 1) % s), tmpIndices.get((o - (divisionsU + 2)) % s), tmpIndices.get((o - (divisionsU + 1)) % s));
tempOffset = (tempOffset + 1) % tmpIndices.size;
com.badlogic.gdx.utilsShortArrayget

Popular methods of ShortArray

  • <init>
    Creates a new ordered array containing the elements in the specified array. The capacity is set to t
  • add
  • clear
  • ensureCapacity
    Increases the size of the backing array to accommodate the specified number of additional items. Use
  • set
  • addAll
  • removeIndex
    Removes and returns the item at the specified index.
  • resize
  • toArray
  • pop
    Removes and returns the last item.

Popular in Java

  • Making http post requests using okhttp
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Runner (org.openjdk.jmh.runner)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now