This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1142: Use new_observer_frame in Transform::look_at r=magnonellie a=JamesAngstrom Make the forward vector of and entity to point towards position (See #1134) when using Transform::look_at, as per the documentation. In particular, for a camera: ```rust camera_transform.look_at(point, world_up); ``` should point the camera towards point, as in Unity's Transform.LookAt example: https://docs.unity3d.com/ScriptReference/Transform.LookAt.html I have an example that demonstrates this change here: https://github.com/JamesAngstrom/look_at you can switch between my branch and current amethyst master in Cargo.toml and see how the camera behavior changes. Before (camera rotates away from the sphere): ![before](https://user-images.githubusercontent.com/44684728/48505476-0d635f00-e83f-11e8-8277-317ed2384076.png) After (camera points at sphere and rotates around it): ![after](https://user-images.githubusercontent.com/44684728/48505512-22d88900-e83f-11e8-9f24-131771c0cd26.png) We could also have a separate function that has the new behavior with a different name, as suggested in the issue thread, but I think the above is likely going to be the expected behavior of look_at, and matches other game engines. Co-authored-by: James Angstrom <james.angstrom@gmail.com>
- Loading branch information