Skip to content

Commit

Permalink
Fix: Using SCNQuaternion constructor instead of tuple-assignment
Browse files Browse the repository at this point in the history
* In order to quell the warning in Xcode 9 that _“initializer for struct 'SCNVector4' must use "self.init(...)" or "self = ..." because the struct was imported from C”_, switched from doing `x`/`y`/`z`/`w`-tuple assignment to just using the 4-arg constructor.  
	▸ It appears the 4-arg constructor has always been there; I just didn't use it for some reason before.

Also:

* Bumped project version to 1.3.1.
  • Loading branch information
capnslipp committed May 7, 2018
1 parent dbde726 commit ad5a356
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SCNMathExtensions.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SCNMathExtensions'
s.version = '1.3.0'
s.version = '1.3.1'
s.summary = 'A Swift µ-Library of Math Extensions for SCNVector3, SCNQuaternion, SCNMatrix4'
s.description = "A Swift micro-library that provides commonplace math extensions for SceneKit's SCNVector3, SCNQuaternion, & SCNMatrix4 types, and bridging to/from GLKVector3, simd.float3, GLKQuaternion, GLKMatrix4, & simd.float4x4."
s.homepage = 'https://github.com/capnslipp/SCNMathExtensions'
Expand Down
4 changes: 2 additions & 2 deletions SCNMathExtensions.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.3.0;
CURRENT_PROJECT_VERSION = 1.3.1;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = YES;
Expand All @@ -282,7 +282,7 @@
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 1.3.0;
CURRENT_PROJECT_VERSION = 1.3.1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_OPTIMIZATION_LEVEL = s;
Expand Down
2 changes: 1 addition & 1 deletion Sources/SCNMathExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ extension SCNQuaternion
// looks to be explained at: http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
let s = sqrt((1.0 + dotProduct) * 2.0)
let xyz = aNormal.crossProduct(bNormal) / s
(self.x, self.y, self.z, self.w) = (xyz.x, xyz.y, xyz.z, (s * 0.5))
self = SCNQuaternion(xyz.x, xyz.y, xyz.z, (s * 0.5))
}
}

Expand Down

0 comments on commit ad5a356

Please sign in to comment.