Method: Ray::Animation::CircularMotion#update_target

Defined in:
lib/ray/animation/circular_motion.rb

#update_targetObject



32
33
34
35
36
37
38
39
# File 'lib/ray/animation/circular_motion.rb', line 32

def update_target
  angle = @from_angle + progression * (@from_angle - @to_angle)

  x = @center.x + (Math.cos(angle) * @radius)
  y = @center.y - (Math.sin(angle) * @radius)

  target.pos = [x, y]
end