Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep the camera's initial yaw/pitch, unless some are explicitly provided to FlyCamera #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gnurfos
Copy link

@Gnurfos Gnurfos commented May 9, 2021

Without this, if you do something like:

let cam_transform = Transform::from_xyz(15.0, 15.0, 15.0).looking_at(Vec3::new(5.0, 5.0, 5.0), Vec3::Y);
let mut cam_bundle = commands.spawn_bundle(PerspectiveCameraBundle {
    transform: cam_transform,
    ..Default::default()
});
cam_bundle.insert(FlyCamera {
  ..Default::default()

});

The transform you set will be lost.
This Pull Request makes the FlyCamera take its initial yaw/pitch from the real camera.

It changes some field names. Let me know if I should do something backward-compatible instead (I suppose the code would be a bit more complicated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant