use bevy::prelude::*; use bevy_blender::*; // Use pan orbit camera mod camera; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugin(BlenderPlugin) .add_startup_system(setup) .add_system(camera::pan_orbit_camera) .run(); } fn setup(mut commands: Commands, asset_server: ResMut) { spawn_blender_object( &mut commands, &asset_server, "robot.blend", "Cube.002", false, None, ); // Light and camera commands.spawn(PointLightBundle { transform: Transform::from_translation(Vec3::new(4.0, 8.0, 4.0)), ..Default::default() }); let translation = Vec3::new(5.0, 5.0, 5.0); let radius = translation.length(); commands .spawn(Camera3dBundle { transform: Transform::from_translation(translation).looking_at(Vec3::ZERO, Vec3::Y), ..Default::default() }) .insert(camera::PanOrbitCamera { radius, ..Default::default() }); }