8 releases

new 0.1.7 Nov 14, 2024
0.1.6 Nov 14, 2024
0.1.5 Oct 9, 2024
0.1.3 Sep 18, 2024

#482 in Game dev

Download history 306/week @ 2024-09-16 147/week @ 2024-09-23 243/week @ 2024-09-30 265/week @ 2024-10-07 53/week @ 2024-10-14 96/week @ 2024-10-21 110/week @ 2024-10-28 172/week @ 2024-11-04 391/week @ 2024-11-11

770 downloads per month

MIT license

53KB
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::{CameraBundle, 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,
) {
        commands.spawn(CameraBundle::new_with_transform(LookTransform::new(
        Vec3 {
            x: 1.,
            y: 2.5,
            z: 5.0,
        },
        Vec3::ZERO,
        Vec3::Y,
    )));
}

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.1 0.14

Dependencies

~38–75MB
~1.5M SLoC