package com.mygdx.game.box2d;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.EdgeShape;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef;
public class Bridge extends Box2DTest {
int e_count = 30;
@Override
protected void createWorld (World world) {
Body ground;
{
BodyDef bd = new BodyDef();
ground = world.createBody(bd);
EdgeShape shape = new EdgeShape();
shape.set(new Vector2(-40, 0), new Vector2(40.0f, 0));
ground.createFixture(shape, 0);
shape.dispose();
}
{
PolygonShape shape = new PolygonShape();
shape.se
[LIBGDX学习]LibGDX代码详解(十一)Box2D bridge
最新推荐文章于 2022-01-13 17:59:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)