Skip to content

Commit

Permalink
Add lobby orbit
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanRJohnston committed Feb 29, 2024
1 parent 7f777de commit 91737e1
Show file tree
Hide file tree
Showing 29 changed files with 306 additions and 947 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 62 additions & 62 deletions assets/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -9127,47 +9127,7 @@
"type": "string",
"typeInfo": "Enum"
},
"simulation::plugins::spectators::Spectator": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
"properties": {},
"required": [],
"short_name": "Spectator",
"title": "simulation::plugins::spectators::Spectator",
"type": "object",
"typeInfo": "Struct"
},
"smallvec::SmallVec<[bevy_ecs::Entity; 8]>": {
"isComponent": false,
"isResource": false,
"items": {
"type": {
"$ref": "#/$defs/bevy_ecs::Entity"
}
},
"short_name": "SmallVec<[Entity; 8]>",
"title": "smallvec::SmallVec<[bevy_ecs::Entity; 8]>",
"type": "array",
"typeInfo": "List"
},
"std::ffi::OsString": {
"isComponent": false,
"isResource": false,
"short_name": "OsString",
"title": "std::ffi::OsString",
"type": "object",
"typeInfo": "Value"
},
"std::path::PathBuf": {
"isComponent": false,
"isResource": false,
"short_name": "PathBuf",
"title": "std::path::PathBuf",
"type": "object",
"typeInfo": "Value"
},
"test::OrbitPoint": {
"simulation::plugins::planets::OrbitPoint": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
Expand All @@ -9188,22 +9148,41 @@
"point"
],
"short_name": "OrbitPoint",
"title": "test::OrbitPoint",
"title": "simulation::plugins::planets::OrbitPoint",
"type": "object",
"typeInfo": "Struct"
},
"simulation::plugins::planets::RotateSpeed": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
"properties": {
"speed": {
"type": {
"$ref": "#/$defs/f32"
}
}
},
"required": [
"speed"
],
"short_name": "RotateSpeed",
"title": "simulation::plugins::planets::RotateSpeed",
"type": "object",
"typeInfo": "Struct"
},
"test::PreGameCamera": {
"simulation::plugins::scenes::pregame::PreGameCamera": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
"properties": {},
"required": [],
"short_name": "PreGameCamera",
"title": "test::PreGameCamera",
"title": "simulation::plugins::scenes::pregame::PreGameCamera",
"type": "object",
"typeInfo": "Struct"
},
"test::PreGameSpawnPoint": {
"simulation::plugins::scenes::pregame::PreGameSpawnPoint": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
Expand All @@ -9218,11 +9197,11 @@
"id"
],
"short_name": "PreGameSpawnPoint",
"title": "test::PreGameSpawnPoint",
"title": "simulation::plugins::scenes::pregame::PreGameSpawnPoint",
"type": "object",
"typeInfo": "Struct"
},
"test::RaceSpawnPoint": {
"simulation::plugins::scenes::race::RaceSpawnPoint": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
Expand All @@ -9237,39 +9216,60 @@
"id"
],
"short_name": "RaceSpawnPoint",
"title": "test::RaceSpawnPoint",
"title": "simulation::plugins::scenes::race::RaceSpawnPoint",
"type": "object",
"typeInfo": "Struct"
},
"test::RaceStartCamera": {
"simulation::plugins::scenes::race::RaceStartCamera": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
"properties": {},
"required": [],
"short_name": "RaceStartCamera",
"title": "test::RaceStartCamera",
"title": "simulation::plugins::scenes::race::RaceStartCamera",
"type": "object",
"typeInfo": "Struct"
},
"test::RotateSpeed": {
"simulation::plugins::spectators::Spectator": {
"additionalProperties": false,
"isComponent": true,
"isResource": false,
"properties": {
"speed": {
"type": {
"$ref": "#/$defs/f32"
}
"properties": {},
"required": [],
"short_name": "Spectator",
"title": "simulation::plugins::spectators::Spectator",
"type": "object",
"typeInfo": "Struct"
},
"smallvec::SmallVec<[bevy_ecs::Entity; 8]>": {
"isComponent": false,
"isResource": false,
"items": {
"type": {
"$ref": "#/$defs/bevy_ecs::Entity"
}
},
"required": [
"speed"
],
"short_name": "RotateSpeed",
"title": "test::RotateSpeed",
"short_name": "SmallVec<[Entity; 8]>",
"title": "smallvec::SmallVec<[bevy_ecs::Entity; 8]>",
"type": "array",
"typeInfo": "List"
},
"std::ffi::OsString": {
"isComponent": false,
"isResource": false,
"short_name": "OsString",
"title": "std::ffi::OsString",
"type": "object",
"typeInfo": "Struct"
"typeInfo": "Value"
},
"std::path::PathBuf": {
"isComponent": false,
"isResource": false,
"short_name": "PathBuf",
"title": "std::path::PathBuf",
"type": "object",
"typeInfo": "Value"
},
"u128": {
"isComponent": false,
Expand Down
6 changes: 2 additions & 4 deletions shared/src/models/monsters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,9 @@ pub fn race(monsters: &[&Monster; 3], seed: u32) -> Results {

#[cfg(test)]
mod test {
use std::collections::HashMap;

use super::{race, Monster, MONSTERS};
use super::{race, MONSTERS};
use quickcheck_macros::quickcheck;
use rand::{thread_rng, RngCore};
use uuid::Uuid;

#[quickcheck]
pub fn same_outcome_for_same_seed(seed: u32) -> bool {
Expand All @@ -140,3 +137,4 @@ mod test {
race(monsters, seed) == race(monsters, seed)
}
}

5 changes: 2 additions & 3 deletions simulation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name = "simulation"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "test"
path = "src/bin/test.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -24,6 +21,8 @@ rand = "0.8.5"
statig = { version = "0.3.1", features = ["bevy"] }
wasm-bindgen = "0.2.91"
web-sys = "0.3.68"
shared = { workspace = true }


[features]
default = ["bevy/dynamic_linking"]
Binary file modified simulation/assets/Scene.glb
Binary file not shown.
Binary file removed simulation/assets/library/Pregame_Spawn_Point.glb
Binary file not shown.
Binary file removed simulation/assets/library/Race_Spawn_Point.glb
Binary file not shown.
Binary file modified simulation/assets/library/Spectator.glb
Binary file not shown.
Binary file modified simulation/game.blend
Binary file not shown.
11 changes: 11 additions & 0 deletions simulation/src/bin/debug.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use bevy_registry_export::*;
use simulation::start;

fn main() {
start(|app| {
app.add_plugins(ExportRegistryPlugin::default())
.add_plugins(WorldInspectorPlugin::default());
});
}

39 changes: 1 addition & 38 deletions simulation/src/bin/simulation.rs
Original file line number Diff line number Diff line change
@@ -1,43 +1,6 @@
use std::f32::consts::PI;

use bevy::{pbr::CascadeShadowConfigBuilder, prelude::*};
use simulation::start;

fn main() {
start(|app| {
app.add_systems(Startup, setup);
});
start(|_| {});
}

fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
commands.spawn(Camera3dBundle {
transform: Transform::from_xyz(5.0, 9.0, 8.0)
.looking_at(Vec3::new(0.0, 0.0, -5.0), Vec3::Y),
..default()
});

commands.spawn(PbrBundle {
mesh: meshes.add(shape::Plane::from_size(10000.0).into()),
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
..default()
});

commands.spawn(DirectionalLightBundle {
transform: Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, 1.0, -PI / 4.)),
directional_light: DirectionalLight {
shadows_enabled: true,
..default()
},
cascade_shadow_config: CascadeShadowConfigBuilder {
first_cascade_far_bound: 20.0,
maximum_distance: 40.0,
..default()
}
.into(),
..default()
});
}
Loading

0 comments on commit 91737e1

Please sign in to comment.