demo4 衣服

 var group = Body.nextGroup(true),
            particleOptions = {
                friction: 0.00001,
                collisionFilter: {
                    group: group
                },
                render: {
                    visible: false
                }
            },
            cloth = Composites.softBody(200, 150, 20, 12, 5, 5, false, 8, particleOptions);

        for (var i = 0; i < 20; i++) {
            cloth.bodies[i].isStatic = true;
        }

        World.add(engine.world, [
            cloth,
            Bodies.circle(300, 450, 80, { isStatic: true }),
            Bodies.rectangle(500, 430, 80, 80, { isStatic: true })
        ]);

你可能感兴趣的:(demo4 衣服)