1

I have a body but when I have other bodies inside this body and I put a value on its property "angle", and other bodies are rejected of this body. now, for rotate this body, i tested its properties and found in "constraintImpulse" this property is not found in matters.js documentation, inside "constraintImpulse" it's found "angle" but this dont handle in radians, also, this movement made it with a tween

barra_izquierda_vaso_moleculas = Bodies.rectangle(200,200,10,200,{isStatic: true});
barra_derecha_vaso_moleculas = Bodies.rectangle(500,200,10,200,{isStatic: true});
barra_inferior_vaso_moleculas = Bodies.rectangle(350,300,300,10,{isStatic: true});

vaso_moleculas = Body.create({
    parts: [barra_izquierda_vaso_moleculas,barra_derecha_vaso_moleculas,barra_inferior_vaso_moleculas],
    restitution: 0,
    friction: 0,
    frictionStatic : 0,
    frictionAir: 0,
    inertia: Infinity,
    mass: 1,
    isStatic: true,
    });

World.add(world,vaso_moleculas);

createjs.Tween.get(vaso_moleculas.constraintImpulse).wait(2000).to({angle:0.06},3000);

1 Answers1

0

Maybe you forgot to put update function for tween.

Something like that :

function animate(time) {
    window.requestAnimationFrame(animate);
    TWEEN.update(time);
}

Without update procedure we don't have a animation.

Look at Tween.js Not Calling onUpdate Function

Nikola Lukic
  • 4,001
  • 6
  • 44
  • 75