machine = {
const body1 = world.CreateBody(earth.bd);
addRevoluteJoint(body1, -1, -2);
addRevoluteJoint(body1, 1, -2);
addBox(body1, 1.7, 2, 2, 0.05, 45);
addBox(body1, -1.7, 2, 2, 0.05, -45);
addBox(body1, 0.28, -4.4, 5, 0.05, 90);
addBox(body1, -0.28, -4.4, 5, 0.05, 90);
{
const length = 0.2,
width = 0.03,
xOffset = 0.22,
yOffsets = [0.0, -0.4, -0.8, -1.2, -1.6, -2.0],
directionFactor = directionToggle ? 1 : -1;
yOffsets.map((yOffset) => {
addBox(body1, xOffset, yOffset, length, width, directionFactor * 45);
addBox(
body1,
-xOffset,
yOffset,
length,
width,
-1 * directionFactor * 45
);
});
}
const particleSystem = world.CreateParticleSystem(psd);
addPraticleGroup(particleSystem, 1, 1.2, 0, 5);
return { world };
}