forked from devindazzle/SCNVector3Extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added description of what the extension can do for you
- Loading branch information
1 parent
af182c1
commit 30a7cc6
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
SCNVector3Extensions | ||
==================== | ||
# SCNVector3Extensions | ||
|
||
An extension of SCNVector3 that adds helpful functions to calculate dot products, cross products etc | ||
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' sp you can do: | ||
|
||
```swift | ||
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) | ||
``` |