com.badlogic.gdx.physics.box2d.Body.isAwake()方法的使用及代码示例

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

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

Body.isAwake介绍

[英]Get the sleeping state of this body.
[中]得到这个身体的睡眠状态。

代码示例

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

private Color getColorByBody (Body body) {
  if (body.isActive() == false)
    return SHAPE_NOT_ACTIVE;
  else if (body.getType() == BodyType.StaticBody)
    return SHAPE_STATIC;
  else if (body.getType() == BodyType.KinematicBody)
    return SHAPE_KINEMATIC;
  else if (body.isAwake() == false)
    return SHAPE_NOT_AWAKE;
  else
    return SHAPE_AWAKE;
}

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

protected void renderBody (Body body) {
  Transform transform = body.getTransform();
  int len = body.getFixtureList().size;
  Array<Fixture> fixtures = body.getFixtureList();
  for (int i = 0; i < len; i++) {
    Fixture fixture = fixtures.get(i);
    if (drawBodies) {
      if (body.isActive() == false && drawInactiveBodies)
        drawShape(fixture, transform, SHAPE_NOT_ACTIVE);
      else if (body.getType() == BodyType.StaticBody)
        drawShape(fixture, transform, SHAPE_STATIC);
      else if (body.getType() == BodyType.KinematicBody)
        drawShape(fixture, transform, SHAPE_KINEMATIC);
      else if (body.isAwake() == false)
        drawShape(fixture, transform, SHAPE_NOT_AWAKE);
      else
        drawShape(fixture, transform, SHAPE_AWAKE);
    }
    if (drawAABBs) {
      drawAABB(fixture, transform);
    }
  }
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-box2d

private Color getColorByBody (Body body) {
  if (body.isActive() == false)
    return SHAPE_NOT_ACTIVE;
  else if (body.getType() == BodyType.StaticBody)
    return SHAPE_STATIC;
  else if (body.getType() == BodyType.KinematicBody)
    return SHAPE_KINEMATIC;
  else if (body.isAwake() == false)
    return SHAPE_NOT_AWAKE;
  else
    return SHAPE_AWAKE;
}

相关文章