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
//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 |
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
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 { |