13 releases

0.2.4 Mar 5, 2025
0.2.3 Mar 4, 2025
0.2.2 Feb 25, 2025
0.2.0 Dec 10, 2024
0.1.3 Sep 18, 2024

#318 in Game dev

Download history 234/week @ 2024-12-04 145/week @ 2024-12-11 62/week @ 2024-12-18 28/week @ 2025-01-08 11/week @ 2025-01-15 2/week @ 2025-01-22 27/week @ 2025-01-29 34/week @ 2025-02-05 185/week @ 2025-02-12 99/week @ 2025-02-19 199/week @ 2025-02-26 259/week @ 2025-03-05 12/week @ 2025-03-12 19/week @ 2025-03-19

555 downloads per month

MIT license

54KB
1K SLoC

bevy_map_camera

docs.rs crates.io

A 3D camera controller inspired by Google Maps, f4maps and Charge Finder.

bevy_map_camera example

Based upon LookTransform, LookAngles and Orbital Camera Controller from smooth-bevy-cameras.

Features

  • Orbital camera
  • Zoom towards pointer
  • Grab pan
    • Configurable height
  • Camera target follows XZ-plane
  • Support for Perspective and Orthographic projection
  • Smoothed movement
  • Customizable keyboard/mouse controls
  • Touch support
    • One finger pan
    • Two finger rotate
    • Pinch to zoom
  • Supports Easing though bevy_easings, part of default features.
    • Implemented for LookTransform
  • Supports Tweening through bevy_tweening, requires bevy_tweening feature.
    • Lenses
      • LookTransformLens
      • GrabHeightLens

Quick Start

use bevy::prelude::*;

use bevy_map_cam::{MapCamera, LookTransform, MapCameraPlugin};

fn main() {
    let mut app = App::new();
    app.add_plugins(DefaultPlugins);
    app.add_plugins(MapCameraPlugin::default());

    app.add_systems(Startup, setup);
    app.run();
}

fn setup(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
) {
    // plane
    commands.spawn((
        Mesh3d(meshes.add(Plane3d::default().mesh().size(10., 10.))),
        MeshMaterial3d(materials.add(Color::from(DARK_GREEN))),
    ));

    // Camera
    commands.spawn(MapCamera);
}

Check out the projection example to see how to change between Perspective and Orthographic.

Compatible Bevy versions

The main branch is compatible with the latest Bevy release.

bevy_map_camera bevy
0.2 0.15
0.1 0.14

Dependencies

~47–84MB
~1.5M SLoC