org.jbox2d.dynamics.Body.resetMassData()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.jbox2d.dynamics.Body.resetMassData()方法的一些代码示例,展示了Body.resetMassData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.resetMassData()方法的具体详情如下:
包路径:org.jbox2d.dynamics.Body
类名称:Body
方法名:resetMassData

Body.resetMassData介绍

[英]This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called unless you called setMassData to override the mass and you later want to reset the mass.
[中]这会将质量特性重置为装置的质量特性之和。除非调用setMassData以覆盖体量,并且以后要重置体量,否则通常不需要调用此函数。

代码示例

代码示例来源:origin: libgdx/libgdx

/** This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called
 * unless you called SetMassData to override the mass and you later want to reset the mass. */
public void resetMassData () {
  body.resetMassData();
}

代码示例来源:origin: libgdx/libgdx

/**
 * Set this body to have fixed rotation. This causes the mass to be reset.
 * 
 * @param flag
 */
public void setFixedRotation(boolean flag) {
 if (flag) {
  m_flags |= e_fixedRotationFlag;
 } else {
  m_flags &= ~e_fixedRotationFlag;
 }
 resetMassData();
}

代码示例来源:origin: libgdx/libgdx

resetMassData();

代码示例来源:origin: libgdx/libgdx

resetMassData();

代码示例来源:origin: libgdx/libgdx

resetMassData();

代码示例来源:origin: jbox2d/jbox2d

/**
 * Set this body to have fixed rotation. This causes the mass to be reset.
 * 
 * @param flag
 */
public void setFixedRotation(boolean flag) {
 if (flag) {
  m_flags |= e_fixedRotationFlag;
 } else {
  m_flags &= ~e_fixedRotationFlag;
 }
 resetMassData();
}

代码示例来源:origin: jbox2d/jbox2d

resetMassData();

代码示例来源:origin: com.github.almasb/fxgl-physics

/**
 * Set this body to have fixed rotation. This causes the mass to be reset.
 *
 * @param flag fixed rotation flag
 */
public void setFixedRotation(boolean flag) {
  if (flag) {
    m_flags |= e_fixedRotationFlag;
  } else {
    m_flags &= ~e_fixedRotationFlag;
  }
  resetMassData();
}

代码示例来源:origin: andmizi/MobikeTags

/**
 * Set this body to have fixed rotation. This causes the mass to be reset.
 * 
 * @param flag
 */
public void setFixedRotation(boolean flag) {
 if (flag) {
  m_flags |= e_fixedRotationFlag;
 } else {
  m_flags &= ~e_fixedRotationFlag;
 }
 resetMassData();
}

代码示例来源:origin: org.jbox2d/jbox2d-library

/**
 * Set this body to have fixed rotation. This causes the mass to be reset.
 * 
 * @param flag
 */
public void setFixedRotation(boolean flag) {
 if (flag) {
  m_flags |= e_fixedRotationFlag;
 } else {
  m_flags &= ~e_fixedRotationFlag;
 }
 resetMassData();
}

代码示例来源:origin: jbox2d/jbox2d

resetMassData();

代码示例来源:origin: jbox2d/jbox2d

resetMassData();

代码示例来源:origin: com.github.almasb/fxgl-physics

/**
 * Creates a fixture and attach it to this body. Use this function if you need to set some fixture
 * parameters, like friction. Otherwise you can create the fixture directly from a shape. If the
 * density is non-zero, this function automatically updates the mass of the body. Contacts are not
 * created until the next time step.
 * Note: This function is locked during callbacks.
 *
 * @param def the fixture definition.
 */
public final Fixture createFixture(FixtureDef def) {
  world.assertNotLocked();
  Fixture fixture = new Fixture(this, def);
  if ((m_flags & e_activeFlag) == e_activeFlag) {
    BroadPhase broadPhase = world.m_contactManager.m_broadPhase;
    fixture.createProxies(broadPhase, m_xf);
  }
  fixtures.add(fixture);
  // Adjust mass properties if needed.
  if (fixture.getDensity() > 0.0f) {
    resetMassData();
  }
  // Let the world know we have a new fixture. This will cause new contacts
  // to be created at the beginning of the next time step.
  world.notifyNewFixture();
  return fixture;
}

代码示例来源:origin: com.github.almasb/fxgl-physics

resetMassData();

代码示例来源:origin: org.jbox2d/jbox2d-library

resetMassData();

代码示例来源:origin: andmizi/MobikeTags

resetMassData();

代码示例来源:origin: andmizi/MobikeTags

resetMassData();

代码示例来源:origin: andmizi/MobikeTags

resetMassData();

代码示例来源:origin: com.github.almasb/fxgl-physics

resetMassData();

代码示例来源:origin: org.jbox2d/jbox2d-library

resetMassData();

相关文章