bevy_xpbd icon indicating copy to clipboard operation
bevy_xpbd copied to clipboard

Unnecessary `RotationValue`?

Open stargazing-dino opened this issue 2 years ago • 0 comments
trafficstars

After your contacts PR, I saw you went with the method of doing this for function arguments:

position1: impl Into<Position>,
rotation1: impl Into<Rotation>,
// ...

In pipeline.rs (and a few other places) though you still use this method:

origin: Vector,
shape_rotation: RotationValue,
// ...

I think you could entirely remove:

/// Radians
#[cfg(feature = "2d")]
pub(crate) type RotationValue = Scalar;
/// Quaternion
#[cfg(feature = "3d")]
pub(crate) type RotationValue = Quaternion;

and some of the cfg checks you have in code if you moved most code to instead take the iml Into<T> alternative.

(I thought to write a PR but wanted to hear your thoughts first :))

stargazing-dino avatar Oct 09 '23 16:10 stargazing-dino