ejeinc / MetalScope

Metal-backed 360° panorama view for iOS
MIT License
324 stars 72 forks source link

Added move types #33

Closed Allui closed 1 year ago

Allui commented 7 years ago

Added feature: Three movement mode of panorama

touch motion all (touch and motion) Example "MonoImage" changed for demonstrate new feature.

(I accidentally broke the old pull request while doing the rebase, so I made a new one. D:)

junpluse commented 7 years ago

Hi @Allui,

Thanks for your PR!

We are also considering features like movement mode for PanoramaView.

In your code, you defined enum PanoramaMoveType as a single value to toggle rotation methods. However, if specify them all at once, every associated parts are updated every time, which is slightly inconvenient for thread-safe implementation.

How about implementing this feature as separated variables like this? (#34)

// PanoramaView.swift

public var isDeviceMotionEnabled: Bool { get set }

public var isPanGestureEnabled: Bool { get set }
Allui commented 7 years ago

Hi @junpluse,

This (#34) solution is better, but how to reset camera position to zero, when changing movement mode on the fly?

For this i made:

// OrientationNode.swift

public func fullyResetRotation() {
         userRotationNode.transform = SCNMatrix4Identity
         referenceRotationNode.transform = SCNMatrix4Identity
         deviceOrientationNode.transform = SCNMatrix4Identity
 }