bevy/crates/bevy_transform/src/components
Rose Hudson d6f1649646
return Direction3d from Transform::up and friends (#11604)
# Objective
Drawing a `Gizmos::circle` whose normal is derived from a Transform's
local axes now requires converting a Vec3 to a Direction3d and
unwrapping the result, and I think we shold move the conversion into
Bevy.

## Solution
We can make
`Transform::{left,right,up,down,forward,back,local_x,local_y,local_z}`
return a Direction3d, because they know that their results will be of
finite non-zero length (roughly 1.0).

---

## Changelog
`Transform::up()` and similar functions now return `Direction3d` instead
of `Vec3`.

## Migration Guide
Callers of `Transform::up()` and similar functions may have to
dereference the returned `Direction3d` to get to the inner `Vec3`.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
2024-02-02 15:05:35 +00:00
..
global_transform.rs Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
mod.rs Split bevy_hierarchy out from bevy_transform (#4168) 2022-03-15 01:54:05 +00:00
transform.rs return Direction3d from Transform::up and friends (#11604) 2024-02-02 15:05:35 +00:00