congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
BufferUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
BufferUtils
in
org.jbox2d.common

Best Java code snippets using org.jbox2d.common.BufferUtils (Showing top 20 results out of 315)

origin: libgdx/libgdx

static int[] reallocateBuffer(ParticleBufferInt buffer, int oldCapacity, int newCapacity,
  boolean deferred) {
 assert (newCapacity > oldCapacity);
 return BufferUtils.reallocateBuffer(buffer.data, buffer.userSuppliedCapacity, oldCapacity,
   newCapacity, deferred);
}
origin: libgdx/libgdx

newIndices.end = end;
BufferUtils.rotate(m_flagsBuffer.data, start, mid, end);
BufferUtils.rotate(m_positionBuffer.data, start, mid, end);
BufferUtils.rotate(m_velocityBuffer.data, start, mid, end);
BufferUtils.rotate(m_groupBuffer, start, mid, end);
if (m_depthBuffer != null) {
 BufferUtils.rotate(m_depthBuffer, start, mid, end);
 BufferUtils.rotate(m_colorBuffer.data, start, mid, end);
 BufferUtils.rotate(m_userDataBuffer.data, start, mid, end);
origin: libgdx/libgdx

static <T> T[] reallocateBuffer(ParticleBuffer<T> buffer, int oldCapacity, int newCapacity,
  boolean deferred) {
 assert (newCapacity > oldCapacity);
 return BufferUtils.reallocateBuffer(buffer.dataClass, buffer.data, buffer.userSuppliedCapacity,
   oldCapacity, newCapacity, deferred);
}
origin: jbox2d/jbox2d

newIndices.end = end;
BufferUtils.rotate(m_flagsBuffer.data, start, mid, end);
BufferUtils.rotate(m_positionBuffer.data, start, mid, end);
BufferUtils.rotate(m_velocityBuffer.data, start, mid, end);
BufferUtils.rotate(m_groupBuffer, start, mid, end);
if (m_depthBuffer != null) {
 BufferUtils.rotate(m_depthBuffer, start, mid, end);
 BufferUtils.rotate(m_colorBuffer.data, start, mid, end);
 BufferUtils.rotate(m_userDataBuffer.data, start, mid, end);
origin: libgdx/libgdx

/**
 * Reallocate a buffer. A 'deferred' buffer is reallocated only if it is not NULL. If
 * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
 */
public static <T> T[] reallocateBuffer(Class<T> klass, T[] buffer, int userSuppliedCapacity,
  int oldCapacity, int newCapacity, boolean deferred) {
 assert (newCapacity > oldCapacity);
 assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity);
 if ((!deferred || buffer != null) && userSuppliedCapacity == 0) {
  buffer = reallocateBuffer(klass, buffer, oldCapacity, newCapacity);
 }
 return buffer;
}
origin: com.github.almasb/fxgl-physics

newIndices.end = end;
BufferUtils.rotate(m_flagsBuffer.data, start, mid, end);
BufferUtils.rotate(m_positionBuffer.data, start, mid, end);
BufferUtils.rotate(m_velocityBuffer.data, start, mid, end);
BufferUtils.rotate(m_groupBuffer, start, mid, end);
if (m_depthBuffer != null) {
  BufferUtils.rotate(m_depthBuffer, start, mid, end);
  BufferUtils.rotate(m_colorBuffer.data, start, mid, end);
  BufferUtils.rotate(m_userDataBuffer.data, start, mid, end);
origin: libgdx/libgdx

/**
 * Reallocate a float buffer. A 'deferred' buffer is reallocated only if it is not NULL. If
 * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
 */
public static float[] reallocateBuffer(float[] buffer, int userSuppliedCapacity, int oldCapacity,
  int newCapacity, boolean deferred) {
 assert (newCapacity > oldCapacity);
 assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity);
 if ((!deferred || buffer != null) && userSuppliedCapacity == 0) {
  buffer = reallocateBuffer(buffer, oldCapacity, newCapacity);
 }
 return buffer;
}
origin: andmizi/MobikeTags

newIndices.end = end;
BufferUtils.rotate(m_flagsBuffer.data, start, mid, end);
BufferUtils.rotate(m_positionBuffer.data, start, mid, end);
BufferUtils.rotate(m_velocityBuffer.data, start, mid, end);
BufferUtils.rotate(m_groupBuffer, start, mid, end);
if (m_depthBuffer != null) {
 BufferUtils.rotate(m_depthBuffer, start, mid, end);
 BufferUtils.rotate(m_colorBuffer.data, start, mid, end);
 BufferUtils.rotate(m_userDataBuffer.data, start, mid, end);
origin: libgdx/libgdx

/**
 * Reallocate an int buffer. A 'deferred' buffer is reallocated only if it is not NULL. If
 * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
 */
public static int[] reallocateBuffer(int[] buffer, int userSuppliedCapacity, int oldCapacity,
  int newCapacity, boolean deferred) {
 assert (newCapacity > oldCapacity);
 assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity);
 if ((!deferred || buffer != null) && userSuppliedCapacity == 0) {
  buffer = reallocateBuffer(buffer, oldCapacity, newCapacity);
 }
 return buffer;
}
origin: libgdx/libgdx

private void expandBuffers(int oldSize, int newSize) {
 m_aabb = BufferUtils.reallocateBuffer(AABB.class, m_aabb, oldSize, newSize);
 m_userData = BufferUtils.reallocateBuffer(Object.class, m_userData, oldSize, newSize);
 m_parent = BufferUtils.reallocateBuffer(m_parent, oldSize, newSize);
 m_child1 = BufferUtils.reallocateBuffer(m_child1, oldSize, newSize);
 m_child2 = BufferUtils.reallocateBuffer(m_child2, oldSize, newSize);
 m_height = BufferUtils.reallocateBuffer(m_height, oldSize, newSize);
 // Build a linked list for the free list.
 for (int i = oldSize; i < newSize; i++) {
  m_aabb[i] = new AABB();
  m_parent[i] = (i == newSize - 1) ? NULL_NODE : i + 1;
  m_height[i] = -1;
  m_child1[i] = -1;
  m_child2[i] = -1;
 }
 m_freeList = oldSize;
}
origin: libgdx/libgdx

 public void addContact(int a, int b) {
  assert(a != b);
  Vec2 pa = m_positionBuffer.data[a];
  Vec2 pb = m_positionBuffer.data[b];
  float dx = pb.x - pa.x;
  float dy = pb.y - pa.y;
  float d2 = dx * dx + dy * dy;
//    assert(d2 != 0);
  if (d2 < m_squaredDiameter) {
   if (m_contactCount >= m_contactCapacity) {
    int oldCapacity = m_contactCapacity;
    int newCapacity =
      m_contactCount != 0 ? 2 * m_contactCount : Settings.minParticleBufferCapacity;
    m_contactBuffer =
      BufferUtils.reallocateBuffer(ParticleContact.class, m_contactBuffer, oldCapacity,
        newCapacity);
    m_contactCapacity = newCapacity;
   }
   float invD = d2 != 0 ? MathUtils.sqrt(1 / d2) : Float.MAX_VALUE;
   ParticleContact contact = m_contactBuffer[m_contactCount];
   contact.indexA = a;
   contact.indexB = b;
   contact.flags = m_flagsBuffer.data[a] | m_flagsBuffer.data[b];
   contact.weight = 1 - d2 * invD * m_inverseDiameter;
   contact.normal.x = invD * dx;
   contact.normal.y = invD * dy;
   m_contactCount++;
  }
 }

origin: libgdx/libgdx

@Override
public final void query(TreeCallback callback, AABB aabb) {
 nodeStackIndex = 0;
 nodeStack[nodeStackIndex++] = m_root;
 while (nodeStackIndex > 0) {
  int node = nodeStack[--nodeStackIndex];
  if (node == NULL_NODE) {
   continue;
  }
  if (AABB.testOverlap(m_aabb[node], aabb)) {
   int child1 = m_child1[node];
   if (child1 == NULL_NODE) {
    boolean proceed = callback.treeCallback(node);
    if (!proceed) {
     return;
    }
   } else {
    if (nodeStack.length - nodeStackIndex - 2 <= 0) {
     nodeStack =
       BufferUtils.reallocateBuffer(nodeStack, nodeStack.length, nodeStack.length * 2);
    }
    nodeStack[nodeStackIndex++] = child1;
    nodeStack[nodeStackIndex++] = m_child2[node];
   }
  }
 }
}
origin: libgdx/libgdx

    : Settings.minParticleBufferCapacity;
system.m_triadBuffer =
  BufferUtils.reallocateBuffer(Triad.class, system.m_triadBuffer, oldCapacity,
    newCapacity);
system.m_triadCapacity = newCapacity;
origin: libgdx/libgdx

   reallocateBuffer(m_velocityBuffer, m_internalAllocatedCapacity, capacity, false);
 m_accumulationBuffer =
   BufferUtils.reallocateBuffer(m_accumulationBuffer, 0, m_internalAllocatedCapacity,
     capacity, false);
 m_accumulation2Buffer =
   BufferUtils.reallocateBuffer(Vec2.class, m_accumulation2Buffer, 0,
     m_internalAllocatedCapacity, capacity, true);
 m_depthBuffer =
   BufferUtils.reallocateBuffer(m_depthBuffer, 0, m_internalAllocatedCapacity, capacity,
     true);
 m_colorBuffer.data =
   reallocateBuffer(m_colorBuffer, m_internalAllocatedCapacity, capacity, true);
 m_groupBuffer =
   BufferUtils.reallocateBuffer(ParticleGroup.class, m_groupBuffer, 0,
     m_internalAllocatedCapacity, capacity, false);
 m_userDataBuffer.data =
int newCapacity = m_proxyCount != 0 ? 2 * m_proxyCount : Settings.minParticleBufferCapacity;
m_proxyBuffer =
  BufferUtils.reallocateBuffer(Proxy.class, m_proxyBuffer, oldCapacity, newCapacity);
m_proxyCapacity = newCapacity;
origin: libgdx/libgdx

    : Settings.minParticleBufferCapacity;
system.m_triadBuffer =
  BufferUtils.reallocateBuffer(Triad.class, system.m_triadBuffer, oldCapacity,
    newCapacity);
system.m_triadCapacity = newCapacity;
origin: jbox2d/jbox2d

static int[] reallocateBuffer(ParticleBufferInt buffer, int oldCapacity, int newCapacity,
  boolean deferred) {
 assert (newCapacity > oldCapacity);
 return BufferUtils.reallocateBuffer(buffer.data, buffer.userSuppliedCapacity, oldCapacity,
   newCapacity, deferred);
}
origin: jbox2d/jbox2d

static <T> T[] reallocateBuffer(ParticleBuffer<T> buffer, int oldCapacity, int newCapacity,
  boolean deferred) {
 assert (newCapacity > oldCapacity);
 return BufferUtils.reallocateBuffer(buffer.dataClass, buffer.data, buffer.userSuppliedCapacity,
   oldCapacity, newCapacity, deferred);
}
origin: jbox2d/jbox2d

/**
 * Reallocate an int buffer. A 'deferred' buffer is reallocated only if it is not NULL. If
 * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
 */
public static int[] reallocateBuffer(int[] buffer, int userSuppliedCapacity, int oldCapacity,
  int newCapacity, boolean deferred) {
 assert (newCapacity > oldCapacity);
 assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity);
 if ((!deferred || buffer != null) && userSuppliedCapacity == 0) {
  buffer = reallocateBuffer(buffer, oldCapacity, newCapacity);
 }
 return buffer;
}
origin: jbox2d/jbox2d

/**
 * Reallocate a float buffer. A 'deferred' buffer is reallocated only if it is not NULL. If
 * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
 */
public static float[] reallocateBuffer(float[] buffer, int userSuppliedCapacity, int oldCapacity,
  int newCapacity, boolean deferred) {
 assert (newCapacity > oldCapacity);
 assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity);
 if ((!deferred || buffer != null) && userSuppliedCapacity == 0) {
  buffer = reallocateBuffer(buffer, oldCapacity, newCapacity);
 }
 return buffer;
}
origin: jbox2d/jbox2d

/**
 * Reallocate a buffer. A 'deferred' buffer is reallocated only if it is not NULL. If
 * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept.
 */
public static <T> T[] reallocateBuffer(Class<T> klass, T[] buffer, int userSuppliedCapacity,
  int oldCapacity, int newCapacity, boolean deferred) {
 assert (newCapacity > oldCapacity);
 assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity);
 if ((!deferred || buffer != null) && userSuppliedCapacity == 0) {
  buffer = reallocateBuffer(klass, buffer, oldCapacity, newCapacity);
 }
 return buffer;
}
org.jbox2d.commonBufferUtils

Most used methods

  • reallocateBuffer
    Reallocate an int buffer. A 'deferred' buffer is reallocated only if it is not NULL. If 'userSupplie
  • rotate
    Rotate an array, see std::rotate

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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