cleanup self.

This commit is contained in:
Paul Zabelin
2018-01-04 07:37:02 -08:00
parent de8df37de9
commit adad1ecff8
3 changed files with 8 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ class PerformanceTest: XCTestCase {
)
)
self.measure {
measure {
stride(from:0, to: 100000, by: 1).forEach { _ in
_ = start.projectiveTransform(destination: destination)
}

View File

@@ -38,7 +38,7 @@ extension Matrix3x3Type {
func homogeneousInverse() -> Matrix3x3Type {
#if arch(arm64) || arch(x86_64)
let result = self.inverse
let result = inverse
#else
let result = adjugate()
#endif

View File

@@ -17,21 +17,21 @@ public final class Perspective {
lazy var basisVectorsToPointsMap: Matrix3x3Type! = {
let m = Matrix3x3Type([
self.vectors[0],
self.vectors[1],
self.vectors[2]]
vectors[0],
vectors[1],
vectors[2]]
)
let solution = m.homogeneousInverse() * self.vectors[3]
let solution = m.homogeneousInverse() * vectors[3]
let scale = Matrix3x3Type(diagonal: solution)
let basisToPoints = m * scale
return basisToPoints.zNormalized()
}()
lazy var pointsToBasisVectorsMap: Matrix3x3Type! = {
self.basisVectorsToPointsMap.homogeneousInverse()
basisVectorsToPointsMap.homogeneousInverse()
}()
internal func projection(to:Perspective) -> Matrix3x3Type {
return (to.basisVectorsToPointsMap * pointsToBasisVectorsMap).zNormalized()
}
}
}