getDistance()方法在Cocos2d-x中不起作用

时间:2018-03-01 09:42:14

标签: c++ xcode cocos2d-x game-physics physics-engine

// - 联合创作。

auto fixedjointleft = PhysicsJointDistance::construct(upperbody, leftbody, upperbody->getPosition(),leftbody->getPosition() );

auto fixedjointright = PhysicsJointDistance::construct(upperbody, rightbody, upperbody->getPosition(), rightbody->getPosition());

auto jointgear = PhysicsJointGear ::construct(leftball->getPhysicsBody(), rightball->getPhysicsBody(), 200.0,4.0);

// - 添加到PhysicsWorld

physics_world->addJoint(jointgear);
physics_world->addJoint(fixedjointleft);
physics_world->addJoint(fixedjointright);

CCLOG("  distance = %f", fixedjointleft->getDistance());

0 个答案:

没有答案