I have object with physic:
BodyDef bodyDef = new BodyDef();
bodyDef.type = BodyDef.BodyType.DynamicBody;
bodyDef.position.set(position);
bodyDef.angle = angle;
this.body = world.createBody(bodyDef);
//init shape
FixtureDef fixtureDef = new FixtureDef();
fixtureDef.density = 1.0f;
fixtureDef.friction = 0.6f;
fixtureDef.restitution = 2.94f;
fixtureDef.isSensor = false;
PolygonShape carShape = new PolygonShape();
carShape.setAsBox(this.width / 2, this.length / 2);
fixtureDef.shape = carShape;
this.body.createFixture(fixtureDef); `
addWheels(..);
There is defined carShape like rectangle with physic. Next code is adding wheels. I want add to the center of car another shape or line, which won’t have affect to physic of car and without physic – only rendered but moving with the car. Visible for information purposes only. What is the easiest option to make it?
For example red line:
