This file contains hidden or 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
cornerEase = 3; // sets the amount to look ahead and behind for gradual turns | |
pre = position.valueAtTime(time-thisComp.frameDuration*cornerEase); | |
post = position.valueAtTime(time+thisComp.frameDuration*cornerEase); | |
delta = post-pre; | |
if (delta[0] == 0 && delta[1] == 0) { | |
// if there is no change in vector maintain the current heading | |
rotation; | |
} else { | |
// use the vector direction to orient. Flip the Y to account for cartesian Y being up and AE Y being down | |
radiansToDegrees(Math.atan2(delta[0],-delta[1])); |
This file contains hidden or 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
// Logo in place of title function (Swift 4) | |
// call this from viewDidLoad() | |
private func setSwooshTitle() { | |
// set the navigation title to a bundled image | |
let logoWidth = 60 | |
let logoHeight = 44 // this is actually the height of the navbar | |
let bundle = Bundle(for: type(of: self)) // get the asset bundle | |
let logo = UIImage(named: "icons.logo", in: bundle, compatibleWith: self.traitCollection)! | |
let imageView = UIImageView(frame: CGRect(x: -logoWidth/2, y: -logoHeight/2, width: logoWidth, height: logoHeight)) // set the bounds and positioning for the logo |