init
This commit is contained in:
parent
ded2322363
commit
9f9b7b03c7
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
|
**.blend1
|
||||||
|
|||||||
895
Cargo.lock
generated
895
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,9 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[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"] }
|
clap = { version = "4.5.20", features = ["derive"] }
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
lightyear = "0.17.1"
|
lightyear = "0.17.1"
|
||||||
|
|||||||
BIN
art/crooks.blend
Normal file
BIN
art/crooks.blend
Normal file
Binary file not shown.
BIN
art/tile.png
Normal file
BIN
art/tile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/blueprints/Hotel.glb
Normal file
BIN
assets/blueprints/Hotel.glb
Normal file
Binary file not shown.
5
assets/blueprints/Hotel.meta.ron
Normal file
5
assets/blueprints/Hotel.meta.ron
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(
|
||||||
|
assets:
|
||||||
|
[
|
||||||
|
]
|
||||||
|
)
|
||||||
BIN
assets/blueprints/Player.glb
Normal file
BIN
assets/blueprints/Player.glb
Normal file
Binary file not shown.
5
assets/blueprints/Player.meta.ron
Normal file
5
assets/blueprints/Player.meta.ron
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(
|
||||||
|
assets:
|
||||||
|
[
|
||||||
|
]
|
||||||
|
)
|
||||||
1
assets/hotel.glb
Symbolic link
1
assets/hotel.glb
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/mitchell/Documents/3D Models/hotel/hotel.glb
|
||||||
BIN
assets/levels/Scene.glb
Normal file
BIN
assets/levels/Scene.glb
Normal file
Binary file not shown.
5
assets/levels/Scene.meta.ron
Normal file
5
assets/levels/Scene.meta.ron
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(
|
||||||
|
assets:
|
||||||
|
[
|
||||||
|
]
|
||||||
|
)
|
||||||
2
assets/levels/World.assets.ron
Normal file
2
assets/levels/World.assets.ron
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
({
|
||||||
|
})
|
||||||
BIN
assets/levels/World.glb
Normal file
BIN
assets/levels/World.glb
Normal file
Binary file not shown.
11
assets/levels/World.meta.ron
Normal file
11
assets/levels/World.meta.ron
Normal 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" )),
|
||||||
|
]
|
||||||
|
)
|
||||||
BIN
assets/materials/Dots Stroke.glb
Normal file
BIN
assets/materials/Dots Stroke.glb
Normal file
Binary file not shown.
BIN
assets/materials/Material.glb
Normal file
BIN
assets/materials/Material.glb
Normal file
Binary file not shown.
BIN
assets/materials/body.001.glb
Normal file
BIN
assets/materials/body.001.glb
Normal file
Binary file not shown.
BIN
assets/materials/body.glb
Normal file
BIN
assets/materials/body.glb
Normal file
Binary file not shown.
BIN
assets/materials/floor.glb
Normal file
BIN
assets/materials/floor.glb
Normal file
Binary file not shown.
BIN
assets/materials/glasses.001.glb
Normal file
BIN
assets/materials/glasses.001.glb
Normal file
Binary file not shown.
BIN
assets/materials/glasses.glb
Normal file
BIN
assets/materials/glasses.glb
Normal file
Binary file not shown.
BIN
assets/materials/head.001.glb
Normal file
BIN
assets/materials/head.001.glb
Normal file
Binary file not shown.
BIN
assets/materials/head.glb
Normal file
BIN
assets/materials/head.glb
Normal file
Binary file not shown.
16149
assets/registry.json
Normal file
16149
assets/registry.json
Normal file
File diff suppressed because it is too large
Load Diff
57
src/main.rs
57
src/main.rs
@ -1,13 +1,20 @@
|
|||||||
use bevy::log::LogPlugin;
|
use bevy::log::LogPlugin;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::state::app::StatesPlugin;
|
use bevy::state::app::StatesPlugin;
|
||||||
|
use bevy_editor_pls::prelude::*;
|
||||||
|
use blenvy::{BlenvyPlugin, BlueprintInfo, GameWorldTag, HideUntilReady, SpawnBlueprint};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use lightyear::prelude::client::ClientPlugins;
|
use lightyear::prelude::client::ClientPlugins;
|
||||||
use lightyear::prelude::server::ServerPlugins;
|
use lightyear::prelude::server::ServerPlugins;
|
||||||
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
pub mod protocol;
|
pub mod protocol;
|
||||||
pub mod shared_net;
|
pub mod shared_net;
|
||||||
|
|
||||||
|
#[derive(Component, PartialEq, Eq, Default, Reflect)]
|
||||||
|
#[reflect(Component)]
|
||||||
|
pub struct Player;
|
||||||
|
|
||||||
lazy_static::lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
pub static ref CONFIG: Cli = {
|
pub static ref CONFIG: Cli = {
|
||||||
Cli::parse()
|
Cli::parse()
|
||||||
@ -40,7 +47,57 @@ pub struct Cli {
|
|||||||
}
|
}
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
|
.register_type::<Player>()
|
||||||
|
.insert_resource(Msaa::Sample4)
|
||||||
|
.insert_resource(AmbientLight {
|
||||||
|
brightness: 200.0,
|
||||||
|
..default()
|
||||||
|
})
|
||||||
.add_plugins(ClientOrServerPlugin)
|
.add_plugins(ClientOrServerPlugin)
|
||||||
.add_plugins(protocol::ProtocolPlugin)
|
.add_plugins(protocol::ProtocolPlugin)
|
||||||
|
.add_plugins(EditorPlugin::default())
|
||||||
|
.add_plugins(BlenvyPlugin::default())
|
||||||
|
.add_systems(Startup, setup)
|
||||||
.run();
|
.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,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user