Skip to content

Instantly share code, notes, and snippets.

//self.inputVideoData is an instanace of RawDataOutput
if let rawData = self.inputVideoData {
rawData.dataAvailableCallbackWithSize = {[weak self] dataArray, frameSize in
let numberOfBytesPerRow = frameSize.width;
let data = Data.init(bytes: dataArray)
data.withUnsafeBytes { (u8Ptr: UnsafePointer<UInt8>) -> Void in
import SceneKit
class Geometry : NSObject {
// Creates a geometry object from given vertex, index and type data
internal func createGeometry(vertices:[SCNVector3], indices:[Int32], primitiveType:SCNGeometryPrimitiveType) -> SCNGeometry {
// Computed property that indicates the number of primitives to create based on primitive type
var primitiveCount:Int {
get {