v3.14 使用 Physics3D 崩溃

scene->getPhysics3DWorld()->setDebugDrawEnable(true);

添加这行崩溃了

崩溃位置

void Camera::apply()
{
崩溃 this 为空
_viewProjectionUpdated = _transformUpdated;
applyFrameBufferObject();
applyViewport();
}

空场景,只加了这一行,以前版本正常。
auto scene = Scene::createWithPhysics();
scene->getPhysics3DWorld()->setDebugDrawEnable(true);

没瞎说,v3.14是真崩溃了,我用v3.12就没事。
还有这个帖子:http://forum.cocos.com/t/v3-14/42914/5

@linshun

在哪里添加的这行代码?

createScene
就加在这个函数里,3.12正常,3.14就崩溃了

哪里的createScene?能否把代码贴一下?

Scene* HelloWorld::createScene()
{
// ‘scene’ is an autorelease object
auto scene = Scene::createWithPhysics();
scene->getPhysics3DWorld()->setDebugDrawEnable(true);

// 'layer' is an autorelease object
auto layer = HelloWorld::create();

// add layer as a child to scene
scene->addChild(layer);

// return the scene
return scene;

}

你应该使用Scene::createWithPhysics(),同时需要这个PR:https://github.com/cocos2d/cocos2d-x/pull/17139(这是3.14版本的一个bug),否则需要自己设置debug camera。