本文整理了Java中org.jbox2d.dynamics.Body.getType()
方法的一些代码示例,展示了Body.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.getType()
方法的具体详情如下:
包路径:org.jbox2d.dynamics.Body
类名称:Body
方法名:getType
暂无
代码示例来源:origin: libgdx/libgdx
/** Get the type of this body. */
public BodyType getType () {
org.jbox2d.dynamics.BodyType type = body.getType();
if (type == org.jbox2d.dynamics.BodyType.DYNAMIC) return BodyType.DynamicBody;
if (type == org.jbox2d.dynamics.BodyType.KINEMATIC) return BodyType.KinematicBody;
if (type == org.jbox2d.dynamics.BodyType.STATIC) return BodyType.StaticBody;
return BodyType.DynamicBody;
}
代码示例来源:origin: libgdx/libgdx
if (seed.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
b.m_flags &= ~Body.e_islandFlag;
if (b.getType() == BodyType.STATIC) {
continue;
代码示例来源:origin: jbox2d/jbox2d
public boolean reportFixture(Fixture argFixture) {
Body body = argFixture.getBody();
if (body.getType() == BodyType.DYNAMIC) {
boolean inside = argFixture.testPoint(point);
if (inside) {
fixture = argFixture;
return false;
}
}
return true;
}
}
代码示例来源:origin: libgdx/libgdx
color.set(0.5f, 0.5f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.STATIC) {
color.set(0.5f, 0.9f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.KINEMATIC) {
color.set(0.5f, 0.5f, 0.9f);
drawShape(f, xf, color, wireframe);
代码示例来源:origin: libgdx/libgdx
if (b.getType() == BodyType.STATIC) {
continue;
代码示例来源:origin: jbox2d/jbox2d
@Override
public void step(TestbedSettings settings) {
super.step(settings);
addTextLine("Keys: (d) dynamic, (s) static, (k) kinematic");
// Drive the kinematic body.
if (m_platform.getType() == BodyType.KINEMATIC) {
Vec2 p = m_platform.getTransform().p;
Vec2 v = m_platform.getLinearVelocity();
if ((p.x < -10.0f && v.x < 0.0f) || (p.x > 10.0f && v.x > 0.0f)) {
v.x = -v.x;
m_platform.setLinearVelocity(v);
}
}
}
代码示例来源: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: jbox2d/jbox2d
if (seed.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
b.m_flags &= ~Body.e_islandFlag;
if (b.getType() == BodyType.STATIC) {
continue;
代码示例来源:origin: jbox2d/jbox2d
switch (argBody.getType()) {
case DYNAMIC:
builder.setType(PbBodyType.DYNAMIC);
default:
UnsupportedObjectException e = new UnsupportedObjectException("Unknown body type: "
+ argBody.getType(), Type.BODY);
if (listener == null || listener.isUnsupported(e)) {
throw e;
代码示例来源:origin: org.jbox2d/jbox2d-testbed
public boolean reportFixture(Fixture argFixture) {
Body body = argFixture.getBody();
if (body.getType() == BodyType.DYNAMIC) {
boolean inside = argFixture.testPoint(point);
if (inside) {
fixture = argFixture;
return false;
}
}
return true;
}
}
代码示例来源:origin: jbox2d/jbox2d
color.set(0.5f, 0.5f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.STATIC) {
color.set(0.5f, 0.9f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.KINEMATIC) {
color.set(0.5f, 0.5f, 0.9f);
drawShape(f, xf, color, wireframe);
代码示例来源:origin: jbox2d/jbox2d
if (b.getType() == BodyType.STATIC) {
continue;
代码示例来源:origin: org.jbox2d/jbox2d-testbed
@Override
public void step(TestbedSettings settings) {
super.step(settings);
addTextLine("Keys: (d) dynamic, (s) static, (k) kinematic");
// Drive the kinematic body.
if (m_platform.getType() == BodyType.KINEMATIC) {
Vec2 p = m_platform.getTransform().p;
Vec2 v = m_platform.getLinearVelocity();
if ((p.x < -10.0f && v.x < 0.0f) || (p.x > 10.0f && v.x > 0.0f)) {
v.x = -v.x;
m_platform.setLinearVelocity(v);
}
}
}
代码示例来源: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
if (seed.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
b.m_flags &= ~Body.e_islandFlag;
if (b.getType() == BodyType.STATIC) {
continue;
代码示例来源:origin: com.github.almasb/fxgl-physics
if (seed.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
continue;
if (b.getType() == BodyType.STATIC) {
b.m_flags &= ~Body.e_islandFlag;
if (b.getType() == BodyType.STATIC) {
continue;
代码示例来源:origin: com.github.almasb/fxgl-physics
boolean activeA = bodyA.isAwake() && bodyA.getType() != BodyType.STATIC;
boolean activeB = bodyB.isAwake() && bodyB.getType() != BodyType.STATIC;
代码示例来源:origin: org.jbox2d/jbox2d-library
color.set(0.5f, 0.5f, 0.3f);
drawShape(f, xf, color);
} else if (b.getType() == BodyType.STATIC) {
color.set(0.5f, 0.9f, 0.3f);
drawShape(f, xf, color);
} else if (b.getType() == BodyType.KINEMATIC) {
color.set(0.5f, 0.5f, 0.9f);
drawShape(f, xf, color);
代码示例来源:origin: andmizi/MobikeTags
color.set(0.5f, 0.5f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.STATIC) {
color.set(0.5f, 0.9f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.KINEMATIC) {
color.set(0.5f, 0.5f, 0.9f);
drawShape(f, xf, color, wireframe);
代码示例来源:origin: com.github.almasb/fxgl-physics
color = Color.color(0.5f, 0.5f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.STATIC) {
color = Color.color(0.5f, 0.9f, 0.3f);
drawShape(f, xf, color, wireframe);
} else if (b.getType() == BodyType.KINEMATIC) {
color = Color.color(0.5f, 0.5f, 0.9f);
drawShape(f, xf, color, wireframe);
内容来源于网络,如有侵权,请联系作者删除!