我正在尝试加载一个目前只有3个墙,一个天花板和一个地板的场景.我正在加载我在搅拌机中创建的场景并加载它.然而,SCNNode具有SCNBox正好几何形状的a 恰好穿过.盒子上附有一个动态物理体,我手动将其设置walls/floor为静态节点.下面是我用来设置场景和添加框的代码,.dae如果需要我也可以发布.任何人都对可能发生的事情有任何想法?
//Load the scene from file
SCNScene *scene = [SCNScene sceneNamed:@"mainScene.dar"];
//Get each node in the scene, and give it a static physics bodt
for (SCNNode *node in [[scene rootNode] childNodes]) {
SCNPhysicsBody *staticBody = [SCNPhysicsBody staticBody];
staticBody.restitution = 1.0;
node.presentationNode.physicsBody = staticBody;
NSLog(@"node.name %@",node.name);
}
//Create box
SCNNode *block = [SCNNode node];
block.position = SCNVector3Make(0, 0, 3);
//Set up the geometry
block.geometry = [SCNBox boxWithWidth:.8 height:.8 length:.8 chamferRadius:0.05];
block.geometry.firstMaterial.diffuse.mipFilter = …Run Code Online (Sandbox Code Playgroud)