Smooth 0.1.1

Smooth 0.1.1

ryohey维护。



Smooth 0.1.1

  • ryohey

Smooth.swift

CocoaPods Carthage compatible

将数组转换为平滑函数。插值函数移植自Smooth.js

安装

CocoaPods

pod 'Smooth'

Carthage

github "ryohey/Smooth.swift"

输入

2018-07-28 13 22 52

插值

2018-07-28 13 22 23

平滑处理

2018-07-28 13 22 33

与SceneKit结合使用

为了尽量减少依赖,Smooth.swift没有使用SceneKit,但为了便于使用,添加了VectorType。由于SCNVector3SCNVector4已经实现了VectorType的具体类型,您可以通过扩展简单地使用VectorInterpolator

extension SCNVector3: Vector3, VectorType {}
extension SCNVector4: Vector4, VectorType {}

VectorInterpolator是通过提供用于每个元素的Interpolator来生成的。

VectorInterpolator(points: [SCNVector3(0.1, 0.2, 0.5), SCNVector3(0.5, 0.6, 0.1)], interpolatorCreator: { LinearInterpolator(points: $0).interpolate })