This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State var moved: CGFloat = 0 | |
@State var startTime: Date? | |
var body: some View { | |
//0 means that it acts like a press | |
//coordinateSpace local means local to the view its added to | |
let tap = DragGesture(minimumDistance: 0, coordinateSpace: .local) | |
.onChanged { value in | |
//store distance the touch has moved as a sum of all movements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sceneView.scene!.rootNode.enumerateChildNodesUsingBlock (){ | |
node, stop in | |
if let materials = node.geometry?.materials { | |
for material in materials { | |
//Blender export doesn't support multiple textures per object, so we add our lightmap to the 2nd UV channel here | |
let image = SCNImage(named:"WorldLightmap") | |
material.multiply.contents = image | |
material.multiply.intensity = 0.7 | |
material.multiply.mappingChannel = 1 | |
} |