我正在使用 MouseJoint 来拖动对象。但是物体的运动太慢了。
我需要以鼠标的速度移动它们。目前,我将这些设置用于MouseJointDef
:
MouseJointDef def = new MouseJointDef();
def.bodyA = groundBody;
def.bodyB = hitBody;
def.collideConnected = true;
def.target.set(testPoint.x, testPoint.y);
def.maxForce = 10000.0f * hitBody.getMass();
def.frequencyHz=100;
def.dampingRatio=0;
这些用于身体:
Body box = world.createBody(def);
MassData mass = new MassData();
mass.mass=100;
//mass.I=1; What is it???
mass.center.set(width/2, height/2);
box.setMassData(mass);
我该怎么办?