本文整理了Java中com.badlogic.gdx.physics.box2d.Body.isAwake()
方法的一些代码示例,展示了Body.isAwake()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.isAwake()
方法的具体详情如下:
包路径:com.badlogic.gdx.physics.box2d.Body
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!