bevy icon indicating copy to clipboard operation
bevy copied to clipboard

"smooth_damp" functions for primitives and math structs

Open vveisard opened this issue 9 months ago • 4 comments

What problem does this solve or what need does it fill?

I need to smoothly move a value towards a target value over time using velocity and other parameters (see below).

What solution would you like?

I would like a set of "smooth_damp" functions for primitives and which have:

  • current
  • target
  • velocity
  • smooth time
  • max value delta
  • time delta

Importantly, I would also like a spherical smooth_damp for Vec2 and Vec3.

What alternative(s) have you considered?

A similar effect can be achieved using interpolation functions while updating the start value. However, this lacks all the parameters of a smooth_damp function.

Additional context

https://docs.unity3d.com/ScriptReference/Vector3.SmoothDamp.html

vveisard avatar May 17 '24 06:05 vveisard