bevy icon indicating copy to clipboard operation
bevy copied to clipboard

slerp functions for directions (Vec2 and Vec3)

Open lotus128 opened this issue 1 year ago • 2 comments

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

Linear interpolation is unsuited for transitioning of directions.

What solution would you like?

I would like a spherical interpolation function (slerp) for Vec2 and Vec3 directions.

Additional context

This is a common feature in existing game engines: https://docs.godotengine.org/en/stable/classes/class_vector3.html#class-vector3-method-slerp https://docs.unity3d.com/ScriptReference/Vector3.Slerp.html

lotus128 avatar May 17 '24 06:05 lotus128

Vec2 and Vec3 is part of glam crate, this problem should be solved there, futhermore there is already long living issue

bugsweeper avatar May 17 '24 11:05 bugsweeper

@bugsweeper You're right that the vector types are owned by glam, but on the other hand, we could easily implement slerp functions for the Dir2/Dir3 types that we do own, and I think those would be quite useful.

mweatherley avatar May 17 '24 11:05 mweatherley