[LayaAir 2.0]添加了MouseJoint没有效果

代码:
 
let ropePartTexture = Laya.loader.getRes("test/b1.png");
let ropePart : Sprite = new Sprite();
ropePart.texture = ropePartTexture;
ropePart.pos(48*vw,10*vh);
ropePart.width = 4*vw;
ropePart.height = 10*vh;

let boxCollider = new laya.physics.BoxCollider();
boxCollider.width = ropePart.width;
boxCollider.height = ropePart.height;
ropePart.addComponentIntance(boxCollider);

ropePart.addComponent(laya.physics.RigidBody);

// let revoluteJoint = new laya.physics.joint.RevoluteJoint();
// revoluteJoint.otherBody = rigidBody;
// revoluteJoint.anchor = [ropePart.width/2,0];
// ropePart.addComponentIntance(revoluteJoint);

let mouseJoint = new laya.physics.joint.MouseJoint();
mouseJoint.enabled = true;
mouseJoint.selfBody = <laya.physics.RigidBody>ropePart.getComponent(laya.physics.RigidBody);
ropePart.addComponentIntance(mouseJoint);
Laya.stage.addChild(ropePart);
已邀请:

要回复问题请先

商务合作
商务合作