Skip to content

An extension of SCNVector3 written in Swift that adds helpful functions to calculate dot products, cross products etc

License

Notifications You must be signed in to change notification settings

Zakalicious/SCNVector3Extensions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

SCNVector3Extensions for macOS

Updated to Swift 5.1 - thanks to @sstadelman

In iOS SCNVector3 uses Float In macOS SCNVector3 uses CGFloat

An extension of SCNVector3 written in Swift that adds helpful functions to calculate dot products, cross products etc. By using this extension you can do (almost) the same math on SCNVector3 as you can with a GLKVector3 using GLKit

What can SCNVector3Extensions do for you?

It extends 'SCNVector3' so you can do:

let v1 = SCNVector3Make(0, 1, 2)
let v2 = SCNVector3Make(1, 2, 3)
let v3 = v1 + v2
let v4 = v3 * 100
println("Vector has length \(v4.length())")
let v5 = v4.normalized()
let dist = v1.distance(v2)

About

An extension of SCNVector3 written in Swift that adds helpful functions to calculate dot products, cross products etc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%