fn print_space_impl<F: FnMut(&str)>(
    space: &Space,
    direction: impl Into<Vector3<FreeCoordinate>>,
    mut write: F,
) -> RaytraceInfo {
    // TODO: optimize height (and thus aspect ratio) for the shape of the space
    let mut camera = Camera::new(
        GraphicsOptions::default(),
        Viewport {
            nominal_size: Vector2::new(40., 40.),
            framebuffer_size: Vector2::new(80, 40),
        },
    );
    camera.set_view_matrix(Matrix4::look_at_rh(
        eye_for_look_at(space.grid(), direction.into()),
        space.grid().center(),
        Vector3::new(0., 1., 0.),
    ));

    SpaceRaytracer::<CharacterBuf>::new(space, GraphicsOptions::default())
        .trace_scene_to_text(&camera, &"\n", move |s| {
            write(s);
            let r: Result<(), ()> = Ok(());
            r
        })
        .unwrap()
}
/// Version of `print_space` that takes a destination, for testing.
Version of `print_space` that takes a destination, for testing.
Version of ` print_space ` that takes a destination for testing .
fn print_space_impl<F: FnMut(&str)>(
    space: &Space,
    direction: impl Into<Vector3<FreeCoordinate>>,
    mut write: F,
) -> RaytraceInfo {
    // TODO: optimize height (and thus aspect ratio) for the shape of the space
    let mut camera = Camera::new(
        GraphicsOptions::default(),
        Viewport {
            nominal_size: Vector2::new(40., 40.),
            framebuffer_size: Vector2::new(80, 40),
        },
    );
    camera.set_view_matrix(Matrix4::look_at_rh(
        eye_for_look_at(space.grid(), direction.into()),
        space.grid().center(),
        Vector3::new(0., 1., 0.),
    ));
    SpaceRaytracer::<CharacterBuf>::new(space, GraphicsOptions::default())
        .trace_scene_to_text(&camera, &"\n", move |s| {
            write(s);
            let r: Result<(), ()> = Ok(());
            r
        })
        .unwrap()
}
fn print_space_impl < F : FnMut ( & str ) > ( space : & Space , direction : impl Into < Vector3 < FreeCoordinate > > , mut write : F , ) -> RaytraceInfo { // TODO: optimize height (and thus aspect ratio) for the shape of the space let mut camera = Camera :: new ( GraphicsOptions :: default ( ) , Viewport { nominal_size : Vector2 :: new ( 40. , 40. ) , framebuffer_size : Vector2 :: new ( 80 , 40 ) , } , ) ; camera . set_view_matrix ( Matrix4 :: look_at_rh ( eye_for_look_at ( space . grid ( ) , direction . into ( ) ) , space . grid ( ) . center ( ) , Vector3 :: new ( 0. , 1. , 0. ) , ) ) ; SpaceRaytracer :: < CharacterBuf > :: new ( space , GraphicsOptions :: default ( ) ) . trace_scene_to_text ( & camera , & " \n " , move | s | { write ( s ) ; let r : Result < ( ) , ( ) > = Ok ( ( ) ) ; r } ) . unwrap ( ) }
Version of `print_space` that takes a destination, for testing.
Version of ` print_space ` that takes a destination for testing .
space
&Space
direction
impl Into<Vector3<FreeCoordinate>>
write
F