mapbox / mapbox-scenekit

Other
231 stars 51 forks source link

Polyline drawing #29

Closed jim-martin closed 6 years ago

jim-martin commented 6 years ago

Partially Addresses #20

Changes

  1. Adds PolylineNode class, which generates line geometry through a list of positions.
  2. Adds an addPolyline extension to the TerrainNode which converts a CLLocation array into SCNVector3, then generates a polyline through those positions.
  3. Adds metal shader functions, used for rendering the polyline.
  4. Adds SCNProgram extensions to access framework shader functions.
  5. Adds an internal BezierSpline3D class to help with line interpolation.
  6. Updates the PlacementViewController to use the new polyline class.
  7. Updates API error logging to be more verbose.

Issues

  1. .metal shaders aren't compatible with the iOS simulator. This update doesn't block compilation, but polylines won't appear in the simulator. Ideally, we would check the platform and provide a fallback.

Todo @natalia-osa mentioned a need to avoid terrain intersections along nodes. The addPolyline extension includes a TODO for a later update.