Object not facing correct axis with .looking_at()
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.9.1
## \[Optional\] Relevant system information
If you cannot get Bevy to build or run on your machine, please include:
- the Rust version you're using (you can get this by running `cargo --version`)
- Bevy relies on the "latest stable release" of Rust
- nightly should generally work, but there are sometimes regressions: please let us know!
- the operating system or browser used, including its version
- e.g. Windows 10, Ubuntu 18.04, iOS 14
If your bug is rendering-related, copy the adapter info that appears when you run Bevy.
```ignore
`AdapterInfo { name: "NVIDIA GeForce RTX 2070", vendor: 4318, device: 7938, device_type: DiscreteGpu, backend: Vulkan }`
```
You should also consider testing the examples of our upstream dependencies to help isolate any setup-specific issue:
- [`wgpu`](https://github.com/gfx-rs/wgpu) for rendering problems
- [`winit`](https://github.com/rust-windowing/winit) for input and window management
- [`gilrs`](https://docs.rs/gilrs/latest/gilrs/) for gamepad inputs
## What you did
Minimal code example with blender and gltf file provided for convenience: https://github.com/dmyyy/camera_test
## What went wrong
- Blender asset is exported facing the -y-axis in Blender as a gltf
- Camera is located on -z-axis (0,5,-10) looking at the +z-axis (0,0,5)
- Object defaults to looking away from the camera (that is located on the -z-axis) (spawn object at 0,0,0 and don't rotate)
- Tell the object to look at the -z-axis (0,0,-100)
Expected: Object looks at the camera (located on the -z-axis)
Actual: Object orientation doesn't change
## Additional information
Other information that can be used to further reproduce or isolate the problem.
This commonly includes:
Contributor guide
Research direction
Start by running the linked camera_test reproduction with Bevy 0.9.1 and inspect the .looking_at() entry point alongside the Blender/glTF asset orientation. Compare the object's and camera's reported axes and transforms for the stated positions. Done means the object faces the camera after looking at (0,0,-100), with the behavior verified against the reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100