在沿着路径动画时,将对象保持朝向某个点

时间:2022-11-05 19:45:54

I'm trying to animate an object along a path...while it's moving it should continue to "point" towards another object (or CGPoint). What should I be looking for in the framework (Cocoa-Touch) to accomplish this? Maybe something in CAShapeLayer? Though I think that's more for animating the path itself... It's not jumping out at me...

我试图沿路径动画一个物体......当它移动时它应该继续“指向”另一个物体(或CGPoint)。我应该在框架(Cocoa-Touch)中寻找什么才能实现这一目标?也许是CAShapeLayer的东西?虽然我认为这更像是为了让路径本身动起来......但它并没有跳出来......

1 个解决方案

#1


0  

I believe you're looking for the "bearing" between two points. Here's a good starting point to get you going.

我相信你正在寻找两点之间的“轴承”。这是一个很好的起点让你前进。

#1


0  

I believe you're looking for the "bearing" between two points. Here's a good starting point to get you going.

我相信你正在寻找两点之间的“轴承”。这是一个很好的起点让你前进。