基本上全按照Demo来写的:
1、
void setPhyWorld(PhysicsWorld* world){ m_world = world;}
2、
auto scene = Scene::createWithPhysics();
scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);
auto layer = HelloWorld::create();
layer->setPhyWorld(scene->getPhysicsWorld());
3、
if (m_world != nullptr)
{
m_world->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition()));
}
执行addJoint的时候就报错了,是我使用方法不对吗,求大牛指点