This commit is contained in:
Mitchell Marino 2024-10-30 23:38:57 -05:00
parent ded2322363
commit 9f9b7b03c7
26 changed files with 17113 additions and 22 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
**.blend1

895
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,9 @@ version = "0.1.0"
edition = "2021"
[dependencies]
bevy = "0.14.2"
bevy = { version = "0.14.2", features = ["jpeg"] }
bevy_editor_pls = "0.10.0"
blenvy = "0.1.0-alpha.1"
clap = { version = "4.5.20", features = ["derive"] }
lazy_static = "1.5.0"
lightyear = "0.17.1"

BIN
art/crooks.blend Normal file

Binary file not shown.

BIN
art/tile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
assets/blueprints/Hotel.glb Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
(
assets:
[
]
)

Binary file not shown.

View File

@ -0,0 +1,5 @@
(
assets:
[
]
)

1
assets/hotel.glb Symbolic link
View File

@ -0,0 +1 @@
/home/mitchell/Documents/3D Models/hotel/hotel.glb

BIN
assets/levels/Scene.glb Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
(
assets:
[
]
)

View File

@ -0,0 +1,2 @@
({
})

BIN
assets/levels/World.glb Normal file

Binary file not shown.

View File

@ -0,0 +1,11 @@
(
assets:
[
("Player", File ( path: "blueprints/Player.glb" )),
("glasses.001", File ( path: "materials/glasses.001.glb" )),
("body.001", File ( path: "materials/body.001.glb" )),
("head.001", File ( path: "materials/head.001.glb" )),
("Hotel", File ( path: "blueprints/Hotel.glb" )),
("floor", File ( path: "materials/floor.glb" )),
]
)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/materials/body.glb Normal file

Binary file not shown.

BIN
assets/materials/floor.glb Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/materials/head.glb Normal file

Binary file not shown.

16149
assets/registry.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,20 @@
use bevy::log::LogPlugin;
use bevy::prelude::*;
use bevy::state::app::StatesPlugin;
use bevy_editor_pls::prelude::*;
use blenvy::{BlenvyPlugin, BlueprintInfo, GameWorldTag, HideUntilReady, SpawnBlueprint};
use clap::Parser;
use lightyear::prelude::client::ClientPlugins;
use lightyear::prelude::server::ServerPlugins;
use std::f32::consts::PI;
pub mod protocol;
pub mod shared_net;
#[derive(Component, PartialEq, Eq, Default, Reflect)]
#[reflect(Component)]
pub struct Player;
lazy_static::lazy_static! {
pub static ref CONFIG: Cli = {
Cli::parse()
@ -40,7 +47,57 @@ pub struct Cli {
}
fn main() {
App::new()
.register_type::<Player>()
.insert_resource(Msaa::Sample4)
.insert_resource(AmbientLight {
brightness: 200.0,
..default()
})
.add_plugins(ClientOrServerPlugin)
.add_plugins(protocol::ProtocolPlugin)
.add_plugins(EditorPlugin::default())
.add_plugins(BlenvyPlugin::default())
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// commands.spawn(PointLightBundle {
// transform: Transform::from_translation(Vec3::Y * 30.),
// point_light: PointLight {
// intensity: 20_000_000.0,
// shadows_enabled: true,
// range: 100.,
// ..default()
// },
// ..default()
// });
commands.spawn((
DirectionalLightBundle {
transform: Transform::from_translation(Vec3::Y * 10.).with_rotation(Quat::from_euler(
EulerRot::XYZ,
3. * PI / 2.,
0.,
0.,
)),
directional_light: DirectionalLight {
shadows_enabled: true,
..default()
},
..default()
},
Name::new("Sun"),
));
// commands.spawn(SceneBundle {
// scene: asset_server.load("hotel.glb#Scene0"),
// ..Default::default()
// });
commands.spawn((
BlueprintInfo::from_path("levels/World.glb"),
SpawnBlueprint,
HideUntilReady,
GameWorldTag,
));
}