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

How to use
ParticleSystem
in
org.jbox2d.particle

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

origin: libgdx/libgdx

public World(Vec2 gravity, IWorldPool pool, BroadPhase broadPhase) {
 this.pool = pool;
 m_destructionListener = null;
 m_debugDraw = null;
 m_bodyList = null;
 m_jointList = null;
 m_bodyCount = 0;
 m_jointCount = 0;
 m_warmStarting = true;
 m_continuousPhysics = true;
 m_subStepping = false;
 m_stepComplete = true;
 m_allowSleep = true;
 m_gravity.set(gravity);
 m_flags = CLEAR_FORCES;
 m_inv_dt0 = 0f;
 m_contactManager = new ContactManager(this, broadPhase);
 m_profile = new Profile();
 m_particleSystem = new ParticleSystem(this);
 initializeRegisters();
}
origin: libgdx/libgdx

public void joinParticleGroups(ParticleGroup groupA, ParticleGroup groupB) {
 assert (groupA != groupB);
 RotateBuffer(groupB.m_firstIndex, groupB.m_lastIndex, m_count);
 assert (groupB.m_lastIndex == m_count);
 RotateBuffer(groupA.m_firstIndex, groupA.m_lastIndex, groupB.m_firstIndex);
 assert (groupA.m_lastIndex == groupB.m_firstIndex);
 updateContacts(true);
 if ((particleFlags & k_pairFlags) != 0) {
  for (int k = 0; k < m_contactCount; k++) {
  diagram.generate(getParticleStride() / 2);
  JoinParticleGroupsCallback callback = new JoinParticleGroupsCallback();
  callback.system = this;
 groupA.m_lastIndex = groupB.m_lastIndex;
 groupB.m_firstIndex = groupB.m_lastIndex;
 destroyParticleGroup(groupB);
  computeDepthForGroup(groupA);
origin: libgdx/libgdx

 int i = proxy.index;
 Vec2 pos = m_positionBuffer.data[i];
 proxy.tag = computeTag(m_inverseDiameter * pos.x, m_inverseDiameter * pos.y);
for (int i = 0; i < m_proxyCount; i++) {
 Proxy a = m_proxyBuffer[i];
 long rightTag = computeRelativeTag(a.tag, 1, 0);
 for (int j = i + 1; j < m_proxyCount; j++) {
  Proxy b = m_proxyBuffer[j];
   break;
  addContact(a.index, b.index);
 long bottomLeftTag = computeRelativeTag(a.tag, -1, 1);
 for (; c_index < m_proxyCount; c_index++) {
  Proxy c = m_proxyBuffer[c_index];
 long bottomRightTag = computeRelativeTag(a.tag, 1, 1);
   break;
  addContact(a.index, b.index);
origin: libgdx/libgdx

public void queryAABB(ParticleQueryCallback callback, final AABB aabb) {
 if (m_proxyCount == 0) {
  return;
 }
 final float lowerBoundX = aabb.lowerBound.x;
 final float lowerBoundY = aabb.lowerBound.y;
 final float upperBoundX = aabb.upperBound.x;
 final float upperBoundY = aabb.upperBound.y;
 int firstProxy =
   lowerBound(m_proxyBuffer, m_proxyCount,
     computeTag(m_inverseDiameter * lowerBoundX, m_inverseDiameter * lowerBoundY));
 int lastProxy =
   upperBound(m_proxyBuffer, m_proxyCount,
     computeTag(m_inverseDiameter * upperBoundX, m_inverseDiameter * upperBoundY));
 for (int proxy = firstProxy; proxy < lastProxy; ++proxy) {
  int i = m_proxyBuffer[proxy].index;
  final Vec2 p = m_positionBuffer.data[i];
  if (lowerBoundX < p.x && p.x < upperBoundX && lowerBoundY < p.y && p.y < upperBoundY) {
   if (!callback.reportParticle(i)) {
    break;
   }
  }
 }
}
origin: libgdx/libgdx

public ParticleGroup createParticleGroup(ParticleGroupDef groupDef) {
 float stride = getParticleStride();
 final Transform identity = tempTransform;
 identity.setIdentity();
     Vec2.crossToOutUnsafe(groupDef.angularVelocity, p, particleDef.velocity);
     particleDef.velocity.addLocal(groupDef.linearVelocity);
     createParticle(particleDef);
 updateContacts(true);
 if ((groupDef.flags & k_pairFlags) != 0) {
  for (int k = 0; k < m_contactCount; k++) {
  computeDepthForGroup(group);
origin: libgdx/libgdx

 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabblowerBoundx, system.m_inverseDiameter
 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabbupperBoundx, system.m_inverseDiameter
av.x = vx;
av.y = vy;
final float particleMass = system.getParticleMass();
final float ax = particleMass * (av.x - vx);
final float ay = particleMass * (av.y - vy);
origin: libgdx/libgdx

 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabblowerBoundx, system.m_inverseDiameter
 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabbupperBoundx, system.m_inverseDiameter
float invAm =
  (system.m_flagsBuffer.data[a] & ParticleType.b2_wallParticle) != 0 ? 0 : system
    .getParticleInvMass();
final float rpx = ap.x - bp.x;
final float rpy = ap.y - bp.y;
origin: libgdx/libgdx

public void destroyParticlesInGroup(ParticleGroup group, boolean callDestructionListener) {
 for (int i = group.m_firstIndex; i < group.m_lastIndex; i++) {
  destroyParticle(i, callDestructionListener);
 }
}
origin: libgdx/libgdx

 /**
  * Compute the kinetic energy that can be lost by damping force
  * 
  * @return
  */
 public float computeParticleCollisionEnergy() {
  return m_particleSystem.computeParticleCollisionEnergy();
 }
}
origin: libgdx/libgdx

/**
 * Create a particle group whose properties have been defined. No reference to the definition is
 * retained.
 * 
 * @warning This function is locked during callbacks.
 */
public ParticleGroup createParticleGroup(ParticleGroupDef def) {
 assert (isLocked() == false);
 if (isLocked()) {
  return null;
 }
 ParticleGroup g = m_particleSystem.createParticleGroup(def);
 return g;
}
origin: libgdx/libgdx

/**
 * Create a particle whose properties have been defined. No reference to the definition is
 * retained. A simulation step must occur before it's possible to interact with a newly created
 * particle. For example, DestroyParticleInShape() will not destroy a particle until Step() has
 * been called.
 * 
 * @warning This function is locked during callbacks.
 * @return the index of the particle.
 */
public int createParticle(ParticleDef def) {
 assert (isLocked() == false);
 if (isLocked()) {
  return 0;
 }
 int p = m_particleSystem.createParticle(def);
 return p;
}
origin: libgdx/libgdx

  lowerBound(
    m_proxyBuffer,
    m_proxyCount,
    computeTag(m_inverseDiameter * MathUtils.min(point1.x, point2.x) - 1, m_inverseDiameter
      * MathUtils.min(point1.y, point2.y) - 1));
int lastProxy =
  upperBound(
    m_proxyBuffer,
    m_proxyCount,
    computeTag(m_inverseDiameter * MathUtils.max(point1.x, point2.x) + 1, m_inverseDiameter
      * MathUtils.max(point1.y, point2.y) + 1));
float fraction = 1;
origin: jbox2d/jbox2d

public ParticleGroup createParticleGroup(ParticleGroupDef groupDef) {
 float stride = getParticleStride();
 final Transform identity = tempTransform;
 identity.setIdentity();
     Vec2.crossToOutUnsafe(groupDef.angularVelocity, p, particleDef.velocity);
     particleDef.velocity.addLocal(groupDef.linearVelocity);
     createParticle(particleDef);
 updateContacts(true);
 if ((groupDef.flags & k_pairFlags) != 0) {
  for (int k = 0; k < m_contactCount; k++) {
  computeDepthForGroup(group);
origin: jbox2d/jbox2d

 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabblowerBoundx, system.m_inverseDiameter
 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabbupperBoundx, system.m_inverseDiameter
av.x = vx;
av.y = vy;
final float particleMass = system.getParticleMass();
final float ax = particleMass * (av.x - vx);
final float ay = particleMass * (av.y - vy);
origin: jbox2d/jbox2d

 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabblowerBoundx, system.m_inverseDiameter
 system.m_proxyBuffer,
 system.m_proxyCount,
 computeTag(system.m_inverseDiameter * aabbupperBoundx, system.m_inverseDiameter
float invAm =
  (system.m_flagsBuffer.data[a] & ParticleType.b2_wallParticle) != 0 ? 0 : system
    .getParticleInvMass();
final float rpx = ap.x - bp.x;
final float rpy = ap.y - bp.y;
origin: libgdx/libgdx

/**
 * Destroy a particle. The particle is removed after the next step.
 * 
 * @param Index of the particle to destroy.
 * @param Whether to call the destruction listener just before the particle is destroyed.
 */
public void destroyParticle(int index, boolean callDestructionListener) {
 m_particleSystem.destroyParticle(index, callDestructionListener);
}
origin: jbox2d/jbox2d

 /**
  * Compute the kinetic energy that can be lost by damping force
  * 
  * @return
  */
 public float computeParticleCollisionEnergy() {
  return m_particleSystem.computeParticleCollisionEnergy();
 }
}
origin: jbox2d/jbox2d

/**
 * Create a particle group whose properties have been defined. No reference to the definition is
 * retained.
 * 
 * @warning This function is locked during callbacks.
 */
public ParticleGroup createParticleGroup(ParticleGroupDef def) {
 assert (isLocked() == false);
 if (isLocked()) {
  return null;
 }
 ParticleGroup g = m_particleSystem.createParticleGroup(def);
 return g;
}
origin: jbox2d/jbox2d

/**
 * Create a particle whose properties have been defined. No reference to the definition is
 * retained. A simulation step must occur before it's possible to interact with a newly created
 * particle. For example, DestroyParticleInShape() will not destroy a particle until Step() has
 * been called.
 * 
 * @warning This function is locked during callbacks.
 * @return the index of the particle.
 */
public int createParticle(ParticleDef def) {
 assert (isLocked() == false);
 if (isLocked()) {
  return 0;
 }
 int p = m_particleSystem.createParticle(def);
 return p;
}
origin: jbox2d/jbox2d

public void joinParticleGroups(ParticleGroup groupA, ParticleGroup groupB) {
 assert (groupA != groupB);
 RotateBuffer(groupB.m_firstIndex, groupB.m_lastIndex, m_count);
 assert (groupB.m_lastIndex == m_count);
 RotateBuffer(groupA.m_firstIndex, groupA.m_lastIndex, groupB.m_firstIndex);
 assert (groupA.m_lastIndex == groupB.m_firstIndex);
 updateContacts(true);
 if ((particleFlags & k_pairFlags) != 0) {
  for (int k = 0; k < m_contactCount; k++) {
  diagram.generate(getParticleStride() / 2);
  JoinParticleGroupsCallback callback = new JoinParticleGroupsCallback();
  callback.system = this;
 groupA.m_lastIndex = groupB.m_lastIndex;
 groupB.m_firstIndex = groupB.m_lastIndex;
 destroyParticleGroup(groupB);
  computeDepthForGroup(groupA);
org.jbox2d.particleParticleSystem

Most used methods

  • <init>
  • RotateBuffer
  • addContact
  • computeDepthForGroup
  • computeParticleCollisionEnergy
  • computeRelativeTag
  • computeTag
  • createParticle
  • createParticleGroup
  • destroyParticle
  • destroyParticleGroup
  • destroyParticlesInGroup
  • destroyParticleGroup,
  • destroyParticlesInGroup,
  • destroyParticlesInShape,
  • getCriticalPressure,
  • getCriticalVelocity,
  • getCriticalVelocitySquared,
  • getParticleColorBuffer,
  • getParticleCount,
  • getParticleDamping,
  • getParticleDensity

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 15 Vim Plugins
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