bevy/examples/gizmos
Robert Walter d7cb781977
Switch rotation & translation in grid gizmos (#14656)
# Objective

- Fixes #14655

## Solution

Rotation should happen first as this is more easier to conceptualize in
the mind: We rotate around the coordinate origin `Vec3::ZERO` and then
we just shift the geometry so that its center is exactly on the
specified position

## Testing && Showcase

Code:

```rust
    gizmos.grid(
        Vec3::ONE * 10.0,
        Quat::from_rotation_x(PI / 3. * 2.),
        UVec2::splat(20),
        Vec2::new(2., 2.),
        PURPLE,
    );
    gizmos.sphere(Vec3::ONE * 10.0, Quat::default(), 1.0, PURPLE);
```

Before picture:


![image](https://github.com/user-attachments/assets/7fea2e71-e62b-4763-9f9f-7a1ecd630ada)

After picture:


![image](https://github.com/user-attachments/assets/899dad64-010a-4e4b-86ae-53b85fef0bbc)


## Migration Guide

- Users might have to double check their already existing calls to all
the `grid` methods. It should be more intuitive now though.
2024-08-16 23:40:06 +00:00
..
2d_gizmos.rs Add cross gizmos (#13883) 2024-06-17 15:45:32 +00:00
3d_gizmos.rs Switch rotation & translation in grid gizmos (#14656) 2024-08-16 23:40:06 +00:00
axes.rs Adding explanation to seeded rng used in examples (#12593) 2024-03-26 19:40:18 +00:00
light_gizmos.rs Updates default Text font size to 24px (#13603) 2024-05-31 16:41:27 +00:00