Tabnine Logo
ParticleSystem.getParticleMass
Code IndexAdd Tabnine to your IDE (free)

How to use
getParticleMass
method
in
org.jbox2d.particle.ParticleSystem

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

origin: libgdx/libgdx

public float computeParticleCollisionEnergy() {
 float sum_v2 = 0;
 for (int k = 0; k < m_contactCount; k++) {
  final ParticleContact contact = m_contactBuffer[k];
  int a = contact.indexA;
  int b = contact.indexB;
  Vec2 n = contact.normal;
  final Vec2 va = m_velocityBuffer.data[a];
  final Vec2 vb = m_velocityBuffer.data[b];
  final float vx = vb.x - va.x;
  final float vy = vb.y - va.y;
  float vn = vx * n.x + vy * n.y;
  if (vn < 0) {
   sum_v2 += vn * vn;
  }
 }
 return 0.5f * getParticleMass() * sum_v2;
}
origin: libgdx/libgdx

public void updateStatistics() {
 if (m_timestamp != m_system.m_timestamp) {
  float m = m_system.getParticleMass();
  m_mass = 0;
  m_center.setZero();
origin: jbox2d/jbox2d

public float computeParticleCollisionEnergy() {
 float sum_v2 = 0;
 for (int k = 0; k < m_contactCount; k++) {
  final ParticleContact contact = m_contactBuffer[k];
  int a = contact.indexA;
  int b = contact.indexB;
  Vec2 n = contact.normal;
  final Vec2 va = m_velocityBuffer.data[a];
  final Vec2 vb = m_velocityBuffer.data[b];
  final float vx = vb.x - va.x;
  final float vy = vb.y - va.y;
  float vn = vx * n.x + vy * n.y;
  if (vn < 0) {
   sum_v2 += vn * vn;
  }
 }
 return 0.5f * getParticleMass() * sum_v2;
}
origin: libgdx/libgdx

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

public void updateStatistics() {
 if (m_timestamp != m_system.m_timestamp) {
  float m = m_system.getParticleMass();
  m_mass = 0;
  m_center.setZero();
origin: andmizi/MobikeTags

public float computeParticleCollisionEnergy() {
 float sum_v2 = 0;
 for (int k = 0; k < m_contactCount; k++) {
  final ParticleContact contact = m_contactBuffer[k];
  int a = contact.indexA;
  int b = contact.indexB;
  Vec2 n = contact.normal;
  final Vec2 va = m_velocityBuffer.data[a];
  final Vec2 vb = m_velocityBuffer.data[b];
  final float vx = vb.x - va.x;
  final float vy = vb.y - va.y;
  float vn = vx * n.x + vy * n.y;
  if (vn < 0) {
   sum_v2 += vn * vn;
  }
 }
 return 0.5f * getParticleMass() * sum_v2;
}
origin: com.github.almasb/fxgl-physics

public float computeParticleCollisionEnergy() {
  float sum_v2 = 0;
  for (int k = 0; k < m_contactCount; k++) {
    final ParticleContact contact = m_contactBuffer[k];
    int a = contact.indexA;
    int b = contact.indexB;
    Vec2 n = contact.normal;
    final Vec2 va = m_velocityBuffer.data[a];
    final Vec2 vb = m_velocityBuffer.data[b];
    final float vx = vb.x - va.x;
    final float vy = vb.y - va.y;
    float vn = vx * n.x + vy * n.y;
    if (vn < 0) {
      sum_v2 += vn * vn;
    }
  }
  return 0.5f * getParticleMass() * sum_v2;
}
origin: jbox2d/jbox2d

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: com.github.almasb/fxgl-physics

public void updateStatistics() {
  if (m_timestamp != m_system.m_timestamp) {
    float m = m_system.getParticleMass();
    m_mass = 0;
    m_center.setZero();
origin: andmizi/MobikeTags

public void updateStatistics() {
 if (m_timestamp != m_system.m_timestamp) {
  float m = m_system.getParticleMass();
  m_mass = 0;
  m_center.setZero();
origin: com.github.almasb/fxgl-physics

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: andmizi/MobikeTags

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);
org.jbox2d.particleParticleSystemgetParticleMass

Popular methods of ParticleSystem

  • <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
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ImageIO (javax.imageio)
  • Option (scala)
  • Top plugins for WebStorm
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