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

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

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

Body.getNext介绍

[英]Get the next body in the world's body list.
[中]获取世界尸体列表中的下一个尸体。

代码示例

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

/**
 * Call this after you are done with time steps to clear the forces. You normally call this after
 * each call to Step, unless you are performing sub-steps. By default, forces will be
 * automatically cleared, so you don't need to call this function.
 * 
 * @see setAutoClearForces
 */
public void clearForces() {
 for (Body body = m_bodyList; body != null; body = body.getNext()) {
  body.m_force.setZero();
  body.m_torque = 0.0f;
 }
}

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

for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 for (Fixture f = b.getFixtureList(); f != null; f = f.getNext()) {
color.set(0.9f, 0.3f, 0.9f);
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 if (b.isActive() == false) {
  continue;
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 xf.p.set(b.getWorldCenter());

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

/**
 * Call this after you are done with time steps to clear the forces. You normally call this after
 * each call to Step, unless you are performing sub-steps. By default, forces will be
 * automatically cleared, so you don't need to call this function.
 * 
 * @see setAutoClearForces
 */
public void clearForces() {
 for (Body body = m_bodyList; body != null; body = body.getNext()) {
  body.m_force.setZero();
  body.m_torque = 0.0f;
 }
}

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

for (Body b = m_bodyList; b != null; b = b.getNext()) {

代码示例来源:origin: konsoletyper/teavm

context.scale(100, 100);
context.setLineWidth(0.01);
for (Body body = scene.getWorld().getBodyList(); body != null; body = body.getNext()) {
  Vec2 center = body.getPosition();
  context.save();

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

@Override
public void step(TestbedSettings settings) {
  super.step(settings);
  for (Body b = getWorld().getBodyList(); b != null; b = b.getNext())
  {
    if (b.getType() != BodyType.DYNAMIC)
    {
      continue;
    }
    Vec2 p = b.getPosition();
    if (p.x <= -10.0f || 10.0f <= p.x || p.y <= 0.0f || 20.0f <= p.y)
    {
      p.x += 0.0;
    }
  }
  addTextLine("Press 'c' to create a circle");
}

代码示例来源:origin: stackoverflow.com

for ( Body b = world.getBodyList(); b!=null; b = b.getNext() )
{
  // do something
}

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

/**
 * Call this after you are done with time steps to clear the forces. You normally call this after
 * each call to Step, unless you are performing sub-steps. By default, forces will be
 * automatically cleared, so you don't need to call this function.
 * 
 * @see setAutoClearForces
 */
public void clearForces() {
 for (Body body = m_bodyList; body != null; body = body.getNext()) {
  body.m_force.setZero();
  body.m_torque = 0.0f;
 }
}

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

/**
 * Call this after you are done with time steps to clear the forces. You normally call this after
 * each call to Step, unless you are performing sub-steps. By default, forces will be
 * automatically cleared, so you don't need to call this function.
 *
 * @see #setAutoClearForces(boolean)
 */
public void clearForces() {
  for (Body body = m_bodyList; body != null; body = body.getNext()) {
    body.m_force.setZero();
    body.m_torque = 0.0f;
  }
}

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

/**
 * Call this after you are done with time steps to clear the forces. You normally call this after
 * each call to Step, unless you are performing sub-steps. By default, forces will be
 * automatically cleared, so you don't need to call this function.
 * 
 * @see setAutoClearForces
 */
public void clearForces() {
 for (Body body = m_bodyList; body != null; body = body.getNext()) {
  body.m_force.setZero();
  body.m_torque = 0.0f;
 }
}

代码示例来源:origin: stackoverflow.com

for ( Body b = world.getBodyList(); b!=null; b = b.getNext() )
{
  Log.e("xy", String.valueOf(b.getPosition().x)+ " " + String.valueOf(b.getPosition().y));
}

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

for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 for (Fixture f = b.getFixtureList(); f != null; f = f.getNext()) {
color.set(0.9f, 0.3f, 0.9f);
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 if (b.isActive() == false) {
  continue;
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 xf.p.set(b.getWorldCenter());

代码示例来源:origin: stackoverflow.com

for (Body b = world.getBodyList(); b != null; b = b.getNext()) {
  CCSprite sprite = (CCSprite)b.getUserData();
  if(sprite != null) {
    sprite.setPosition(worldToScreen(b.getPosition())));     
    sprite.setRotation(-1.0f * (float)Math.toDegrees((b.getAngle()))); 
  }           
}

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

for (Body b = m_bodyList; b != null; b = b.getNext()) {

代码示例来源:origin: stackoverflow.com

public void draw(Canvas canvas){
  Body body = world.getBodyList();
  while(body != null){
    Fixture fixture = body.getFixtureList();
    while(fixture != null){
      ShapeType type = fixture.getType();
      if(type == ShapeType.POLYGON){
        PolygonShape shape = (PolygonShape)fixture.getShape();
        // draw shape
      }else if(type == ShapeType.CIRCLE){
        CircleShape shape = (CircleShape)fixture.getShape();
        // draw shape
      }
      fixture = fixture.getNext();
    }
    body = body.getNext();
  }       
}

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

@Override
public void step(TestbedSettings settings) {
  super.step(settings);
  for (Body b = getWorld().getBodyList(); b != null; b = b.getNext())
  {
    if (b.getType() != BodyType.DYNAMIC)
    {
      continue;
    }
    Vec2 p = b.getPosition();
    if (p.x <= -10.0f || 10.0f <= p.x || p.y <= 0.0f || 20.0f <= p.y)
    {
      p.x += 0.0;
    }
  }
  addTextLine("Press 'c' to create a circle");
}

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

for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 for (Fixture f = b.getFixtureList(); f != null; f = f.getNext()) {
color.set(0.9f, 0.3f, 0.9f);
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 if (b.isActive() == false) {
  continue;
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 xf.p.set(b.getWorldCenter());

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

for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 for (Fixture f = b.getFixtureList(); f != null; f = f.getNext()) {
color.set(0.9f, 0.3f, 0.9f);
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 if (b.isActive() == false) {
  continue;
for (Body b = m_bodyList; b != null; b = b.getNext()) {
 xf.set(b.getTransform());
 xf.p.set(b.getWorldCenter());

代码示例来源:origin: mirkosertic/GameComposer

theBody = theBody.getNext();

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

for (Body b = world.getBodyList(); b != null; b = b.getNext()) {
  xf.set(b.getTransform());
  for (Fixture f : b.getFixtures()) {
color = Color.color(0.9f, 0.3f, 0.9f);
for (Body b = world.getBodyList(); b != null; b = b.getNext()) {
  if (!b.isActive()) {
    continue;
for (Body b = world.getBodyList(); b != null; b = b.getNext()) {
  xf.set(b.getTransform());
  xf.p.set(b.getWorldCenter());

相关文章