Tabnine Logo
TIntList.size
Code IndexAdd Tabnine to your IDE (free)

How to use
size
method
in
gnu.trove.list.TIntList

Best Java code snippets using gnu.trove.list.TIntList.size (Showing top 20 results out of 315)

origin: MovingBlocks/Terasology

  public int blockCount() {
    return positions.size();
  }
}
origin: MovingBlocks/Terasology

public int getActivePoolSize() {
  return totalPoolSize - pool.size();
}
origin: MovingBlocks/Terasology

public int getVertexCount() {
  return vertexStartWeights.size();
}
origin: alibaba/mdrill

@Override
public int size() {
  return list.size();
}
origin: MovingBlocks/Terasology

/**
 * @param boneNames    The names of the bones this animation expects
 * @param boneParents  The indices of the parent of each bone in the boneNames list, NO_PARENT for no parent.
 * @param aabb A bounding box that contains the object in all animation stops.
 * @param frames
 * @param timePerFrame
 */
public MeshAnimationData(List<String> boneNames, TIntList boneParents, List<MeshAnimationFrame> frames,
             float timePerFrame, AABB aabb) {
  if (boneNames.size() != boneParents.size()) {
    throw new IllegalArgumentException("Bone names and boneParent indices must align");
  }
  this.boneNames = ImmutableList.copyOf(boneNames);
  this.boneParent = new TIntArrayList(boneParents);
  this.frames = ImmutableList.copyOf(frames);
  this.timePerFrame = timePerFrame;
  this.aabb = aabb;
}
origin: MovingBlocks/Terasology

private void deactivateBlocks() {
  List<TShortObjectMap<TIntList>> deactivatedBlockSets = Lists.newArrayListWithExpectedSize(deactivateBlocksQueue.size());
  deactivateBlocksQueue.drainTo(deactivatedBlockSets);
  for (TShortObjectMap<TIntList> deactivatedBlockSet : deactivatedBlockSets) {
    deactivatedBlockSet.forEachEntry((id, positions) -> {
      if (positions.size() > 0) {
        blockManager.getBlock(id).getEntity().send(new BeforeDeactivateBlocks(positions, registry));
      }
      return true;
    });
  }
}
origin: MovingBlocks/Terasology

sb.append("\tnumtris ").append(indices.size() / 3).append("\n");
for (int i = 0; i < indices.size() / 3; i++) {
  int i1 = indices.get(i * 3);
  int i2 = indices.get(i * 3 + 1);
origin: MovingBlocks/Terasology

public void doRender(List<Vector3f> verts, List<Vector3f> normals) {
  FloatBuffer vertBuffer = BufferUtils.createFloatBuffer(verts.size() * 6);
  for (int i = 0; i < verts.size(); ++i) {
    Vector3f vert = verts.get(i);
    vertBuffer.put(vert.x * scale.x + translate.x);
    vertBuffer.put(vert.y * scale.y + translate.y);
    vertBuffer.put(vert.z * scale.z + translate.z);
    Vector3f norm = normals.get(i);
    vertBuffer.put(norm.x);
    vertBuffer.put(norm.y);
    vertBuffer.put(norm.z);
  }
  vertBuffer.flip();
  VertexBufferObjectUtil.bufferVboData(disposalAction.vboPosNormBuffer, vertBuffer, GL15.GL_DYNAMIC_DRAW);
  GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, disposalAction.vboPosNormBuffer);
  glVertexPointer(VECTOR3_SIZE, GL_FLOAT, STRIDE, 0);
  glNormalPointer(GL_FLOAT, STRIDE, NORMAL_OFFSET);
  GL11.glDrawElements(GL11.GL_TRIANGLES, data.getIndices().size(), GL_UNSIGNED_INT, 0);
  GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
}
origin: MovingBlocks/Terasology

private void iterate() {
  while (i < positionList.size() - 2) {
    nextResult.x = positionList.get(i++);
    nextResult.y = positionList.get(i++);
    nextResult.z = positionList.get(i++);
    if (!registry.hasPermanentBlockEntity(nextResult)) {
      return;
    }
  }
  nextResult = null;
}
origin: MovingBlocks/Terasology

public List<Vector3f> getVertexNormals(List<Vector3f> bonePositions, List<Quat4f> boneRotations) {
  List<Vector3f> results = Lists.newArrayListWithCapacity(getVertexCount());
  for (int i = 0; i < vertexStartWeights.size(); ++i) {
    Vector3f vertexNorm = new Vector3f();
    for (int weightIndexOffset = 0; weightIndexOffset < vertexWeightCounts.get(i); ++weightIndexOffset) {
      int weightIndex = vertexStartWeights.get(i) + weightIndexOffset;
      BoneWeight weight = weights.get(weightIndex);
      Vector3f current = boneRotations.get(weight.getBoneIndex()).rotate(weight.getNormal(), new Vector3f());
      current.scale(weight.getBias());
      vertexNorm.add(current);
    }
    results.add(vertexNorm);
  }
  return results;
}
origin: MovingBlocks/Terasology

public int get(String forUseBy) {
  if (pool.isEmpty()) {
    IntBuffer buffer = BufferUtils.createIntBuffer(BUFFER_FETCH_SIZE);
    GL15.glGenBuffers(buffer);
    for (int i = 0; i < BUFFER_FETCH_SIZE; ++i) {
      pool.add(buffer.get(i));
    }
    totalPoolSize += BUFFER_FETCH_SIZE;
  }
  int result = pool.removeAt(pool.size() - 1);
  if (traceBufferUsage) {
    usageTracker.put(result, forUseBy);
  }
  return result;
}
origin: MovingBlocks/Terasology

public List<Vector3f> getVertexPositions(List<Vector3f> bonePositions, List<Quat4f> boneRotations) {
  List<Vector3f> results = Lists.newArrayListWithCapacity(getVertexCount());
  for (int i = 0; i < vertexStartWeights.size(); ++i) {
    Vector3f vertexPos = new Vector3f();
    for (int weightIndexOffset = 0; weightIndexOffset < vertexWeightCounts.get(i); ++weightIndexOffset) {
      int weightIndex = vertexStartWeights.get(i) + weightIndexOffset;
      BoneWeight weight = weights.get(weightIndex);
      Vector3f current = boneRotations.get(weight.getBoneIndex()).rotate(weight.getPosition(), new Vector3f());
      current.add(bonePositions.get(weight.getBoneIndex()));
      current.scale(weight.getBias());
      vertexPos.add(current);
    }
    results.add(vertexPos);
  }
  return results;
}
origin: MovingBlocks/Terasology

Vector3f v2 = new Vector3f();
Vector3f norm = new Vector3f();
for (int i = 0; i < indices.size() / 3; ++i) {
  Vector3f baseVert = vertices.get(indices.get(i * 3));
  v1.sub(vertices.get(indices.get(i * 3 + 1)), baseVert);
origin: MovingBlocks/Terasology

for (int i = 0; i < results.size(); ++i) {
  if (results.get(i) == 0) {
    RowLayoutHint hint = hints.get(contents.get(i));
for (int i = 0; i < results.size(); ++i) {
  if (results.get(i) == 0) {
    results.set(i, remainingWidthPerElement);
origin: MovingBlocks/Terasology

private void createIndexBuffer(TIntList indexList) {
  IntBuffer indexBuffer = BufferUtils.createIntBuffer(indexList.size());
  TIntIterator iterator = indexList.iterator();
  while (iterator.hasNext()) {
    indexBuffer.put(iterator.next());
  }
  indexBuffer.flip();
  if (disposalAction.vboIndexBuffer == 0) {
    disposalAction.vboIndexBuffer = disposalAction.bufferPool.get(getUrn().toString());
  }
  VertexBufferObjectUtil.bufferVboElementData(disposalAction.vboIndexBuffer, indexBuffer, GL15.GL_STATIC_DRAW);
  indexBuffer.flip();
}
origin: MovingBlocks/Terasology

private void sendOnAddedBlocks(final ReadyChunkInfo readyChunkInfo) {
  PerformanceMonitor.startActivity("Sending OnAddedBlocks");
  readyChunkInfo.getBlockPositionMapppings().forEachEntry((id, positions) -> {
    if (positions.size() > 0) {
      blockManager.getBlock(id).getEntity().send(new OnAddedBlocks(positions, registry));
    }
    return true;
  });
  PerformanceMonitor.endActivity();
}
origin: MovingBlocks/Terasology

private void sendOnActivatedBlocks(final ReadyChunkInfo readyChunkInfo) {
  PerformanceMonitor.startActivity("Sending OnActivateBlocks");
  readyChunkInfo.getBlockPositionMapppings().forEachEntry((id, positions) -> {
    if (positions.size() > 0) {
      blockManager.getBlock(id).getEntity().send(new OnActivatedBlocks(positions, registry));
    }
    return true;
  });
  PerformanceMonitor.endActivity();
}
origin: MovingBlocks/Terasology

@Override
protected void doReload(SkeletalMeshData newData) {
  try {
    GameThread.synch(() -> {
      this.data = newData;
      if (disposalAction.vboPosNormBuffer == 0) {
        disposalAction.vboPosNormBuffer = disposalAction.bufferPool.get(getUrn().toString());
      }
      IntBuffer indexBuffer = BufferUtils.createIntBuffer(newData.getIndices().size());
      indexBuffer.put(newData.getIndices().toArray());
      indexBuffer.flip();
      if (disposalAction.vboIndexBuffer == 0) {
        disposalAction.vboIndexBuffer = disposalAction.bufferPool.get(getUrn().toString());
      }
      VertexBufferObjectUtil.bufferVboElementData(disposalAction.vboIndexBuffer, indexBuffer, GL15.GL_STATIC_DRAW);
      FloatBuffer uvBuffer = BufferUtils.createFloatBuffer(newData.getUVs().size() * 2);
      for (Vector2f uv : newData.getUVs()) {
        uvBuffer.put(uv.x);
        uvBuffer.put(uv.y);
      }
      uvBuffer.flip();
      if (disposalAction.vboUVBuffer == 0) {
        disposalAction.vboUVBuffer = disposalAction.bufferPool.get(getUrn().toString());
      }
      VertexBufferObjectUtil.bufferVboData(disposalAction.vboUVBuffer, uvBuffer, GL15.GL_STATIC_DRAW);
    });
  } catch (InterruptedException e) {
    logger.error("Failed to reload {}", getUrn(), e);
  }
}
origin: MovingBlocks/Terasology

public SkeletalMeshDataBuilder addMesh(Bone bone, MeshData data) {
  TFloatList meshVertices = data.getVertices();
  TIntList meshIndices = data.getIndices();
  TFloatList texCoord0 = data.getTexCoord0();
  int weightsStart = weights.size();
  addBone(bone);
  for (int i = 0; i < meshVertices.size() / 3; i++) {
    float x = meshVertices.get(i * 3);
    float y = meshVertices.get(i * 3 + 1);
    float z = meshVertices.get(i * 3 + 2);
    Vector3f pos = new Vector3f(x, y, z);
    BoneWeight weight = new BoneWeight(pos, 1, bone.getIndex());
    // TODO Meshes may contain normal vectors and we may copy them to the weight here
    //   - but they are recalculated later on in either case. needs some rework
    addWeight(weight);
    vertexStartWeights.add(weightsStart + i);
    vertexWeightCounts.add(1);
    uvs.add(new Vector2f(texCoord0.get(i * 2), texCoord0.get(i * 2 + 1)));
  }
  for (int i = 0; i < meshIndices.size(); i++) {
    indices.add(meshIndices.get(i) + weightsStart);
  }
  return this;
}
origin: MovingBlocks/Terasology

indexCount = newData.getIndices().size();
gnu.trove.listTIntListsize

Javadoc

Returns the number of values in the list.

Popular methods of TIntList

  • add
    Adds a subset of the values in the array vals to the end of the list, in order.
  • toArray
    Copies a slice of the list into a native array.
  • get
    Returns the value at the specified offset.
  • sort
    Sort a slice of the list (ascending) using the Sun quicksort implementation.
  • iterator
  • set
    Replace the values in the list starting at offset withlength values from the values array, starting
  • clear
    Flushes the internal state of the list, resetting the capacity to the default.
  • remove
    Removes length values from the list, starting atoffset
  • reverse
    Reverse the order of the elements in the range of the list.
  • max
    Finds the maximum value in the list.
  • min
    Finds the minimum value in the list.
  • isEmpty
    Tests whether this list contains any values.
  • min,
  • isEmpty,
  • fill,
  • removeAt,
  • replace,
  • shuffle,
  • subList,
  • sum,
  • binarySearch

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
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