Commit d2c8755c by Daniel Dahan

updated rotation Transition

parent 18169434
...@@ -151,9 +151,9 @@ public extension MotionTransition { ...@@ -151,9 +151,9 @@ public extension MotionTransition {
static func rotate(x: CGFloat = 0, y: CGFloat = 0, z: CGFloat = 0) -> MotionTransition { static func rotate(x: CGFloat = 0, y: CGFloat = 0, z: CGFloat = 0) -> MotionTransition {
return MotionTransition { return MotionTransition {
var t = $0.transform ?? CATransform3DIdentity var t = $0.transform ?? CATransform3DIdentity
t = CATransform3DRotate(t, x, 1, 0, 0) t = CATransform3DRotate(t, CGFloat(Double.pi) * x / 180, 1, 0, 0)
t = CATransform3DRotate(t, y, 0, 1, 0) t = CATransform3DRotate(t, CGFloat(Double.pi) * y / 180, 0, 1, 0)
$0.transform = CATransform3DRotate(t, z, 0, 0, 1) $0.transform = CATransform3DRotate(t, CGFloat(Double.pi) * z / 180, 0, 0, 1)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment