Skip to content

Instantly share code, notes, and snippets.

@timcowlishaw
Last active March 1, 2022 17:26
Show Gist options
  • Save timcowlishaw/0943594a31e483040d36a6991b322e06 to your computer and use it in GitHub Desktop.
Save timcowlishaw/0943594a31e483040d36a6991b322e06 to your computer and use it in GitHub Desktop.
Cenatus PHASE blog post snippet 9
let mesh = MDLMesh.newIcosahedron(withRadius: 2.0, inwardNormals: false, allocator: nil)
let shape = PHASEShape(engine: phaseEngine, mesh: mesh)
let source = PHASESource(engine: phaseEngine, shapes: [shape])
source.transform = the_position_of_the_object_in_our_world // you'll need to provide this :-)
try! phaseEngine.rootObject.addChild(source)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment