Skip to main content

aim_camera

Function aim_camera 

Source
pub fn aim_camera(
    world: &mut World,
    scope: Entity,
    entity: Entity,
    eye: Vec3,
    target: Vec3,
    size: (u32, u32),
)
Expand description

Re-aim entity’s camera at target from eye for a frame of size.

The camera hangs in scope, the source that draws it, so the view is its own. The scenes whose camera never moves still call this every frame, so their projection keeps the frame’s own aspect. It is what a scene does in SceneControl::advance instead of capturing the size it was built at.