我用搅拌机制作了 3d 模型,我想在场景套件中使用它。
var platform = SCNNode();
let dae = SCNScene(named:"platform.dae");
platform = dae!.rootNode;
platform.position = SCNVector3(x: 0,y: 0,z:0);
if platform.geometry == nil {
print("geo is nil.")
}
platform.geometry?.firstMaterial?.diffuse.contents = "wood.png";
platform.geometry?.firstMaterial?.diffuse.wrapS = SCNWrapMode.Repeat
platform.geometry?.firstMaterial?.diffuse.wrapT = SCNWrapMode.Repeat
platform.physicsBody = SCNPhysicsBody(type: SCNPhysicsBodyType.Static, shape: SCNPhysicsShape(node: platform, options: nil));
scene.rootNode.addChildNode(platform);
它总是打印出“geo is nil”。所以我无法为模型制作物理实体。谁能告诉我为什么会这样?