update with main branch
This commit is contained in:
51
Cargo.lock
generated
51
Cargo.lock
generated
@@ -353,6 +353,36 @@ dependencies = [
|
||||
"v_frame",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "avian3d"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "263f406c08c5ec296039ba06d7aa50e54f9ecd996f682aaa63eae25709e8935b"
|
||||
dependencies = [
|
||||
"avian_derive",
|
||||
"bevy",
|
||||
"bevy_math",
|
||||
"bitflags 2.6.0",
|
||||
"derive_more",
|
||||
"fxhash",
|
||||
"indexmap",
|
||||
"itertools 0.13.0",
|
||||
"nalgebra 0.32.6",
|
||||
"parry3d 0.15.1",
|
||||
"parry3d-f64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "avian_derive"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4adeeecb6d4628d3ca11836ce9af8309f9552d4bd3e3f6e4368440d8163260c"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.86",
|
||||
"quote 1.0.36",
|
||||
"syn 2.0.70",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "avif-serialize"
|
||||
version = "0.8.1"
|
||||
@@ -1953,6 +1983,19 @@ dependencies = [
|
||||
"syn 0.15.44",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more"
|
||||
version = "0.99.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce"
|
||||
dependencies = [
|
||||
"convert_case",
|
||||
"proc-macro2 1.0.86",
|
||||
"quote 1.0.36",
|
||||
"rustc_version",
|
||||
"syn 2.0.70",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dispatch"
|
||||
version = "0.2.0"
|
||||
@@ -3227,8 +3270,8 @@ dependencies = [
|
||||
"glam",
|
||||
"matrixmultiply",
|
||||
"nalgebra-macros",
|
||||
"num-complex",
|
||||
"num-rational",
|
||||
"num-complex 0.4.6",
|
||||
"num-rational 0.4.2",
|
||||
"num-traits",
|
||||
"simba 0.8.1",
|
||||
"typenum",
|
||||
@@ -4354,7 +4397,7 @@ dependencies = [
|
||||
"built",
|
||||
"cfg-if",
|
||||
"interpolate_name",
|
||||
"itertools",
|
||||
"itertools 0.12.1",
|
||||
"libc",
|
||||
"libfuzzer-sys",
|
||||
"log",
|
||||
@@ -4715,7 +4758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae"
|
||||
dependencies = [
|
||||
"approx",
|
||||
"num-complex",
|
||||
"num-complex 0.4.6",
|
||||
"num-traits",
|
||||
"paste",
|
||||
"wide",
|
||||
|
||||
@@ -21,7 +21,7 @@ bevy_asset_loader = { version = "0.21.0", features = [
|
||||
"3d",
|
||||
] }
|
||||
ron = "0.8.1"
|
||||
avian3d = { version = "0.1.1" }
|
||||
avian3d = { version = "0.1.2" }
|
||||
image = "0.25.2"
|
||||
|
||||
[features]
|
||||
|
||||
Submodule game/main/assets updated: 3bb0aaab5b...d9e7ec8297
@@ -3,8 +3,6 @@ use bevy::ecs::world::CommandQueue;
|
||||
use bevy::prelude::*;
|
||||
use bevy::tasks::*;
|
||||
use bevy::utils::futures;
|
||||
use bevy_rapier3d::geometry::Collider;
|
||||
use bevy_rapier3d::geometry::TriMeshFlags;
|
||||
use shared::events::ChunkModifiedEvent;
|
||||
use shared::events::TileModifiedEvent;
|
||||
use world_generation::prelude::Map;
|
||||
|
||||
@@ -4,14 +4,12 @@ use crate::utlis::editor_plugin::EditorPlugin;
|
||||
use crate::utlis::render_distance_system::RenderDistancePlugin;
|
||||
use crate::utlis::tile_selection_plugin::TileSelectionPlugin;
|
||||
use crate::{camera_system::camera_plugin::PhosCameraPlugin, utlis::debug_plugin::DebugPlugin};
|
||||
use avian3d::{math::*, prelude::*};
|
||||
use bevy::{
|
||||
pbr::{wireframe::WireframeConfig, CascadeShadowConfig},
|
||||
prelude::*,
|
||||
};
|
||||
use bevy_asset_loader::prelude::*;
|
||||
use bevy_rapier3d::dynamics::{Ccd, RigidBody, Velocity};
|
||||
use bevy_rapier3d::geometry::Collider;
|
||||
use bevy_rapier3d::plugin::{NoUserData, RapierPhysicsPlugin};
|
||||
use buildings::BuildingPugin;
|
||||
use iyes_perf_ui::prelude::*;
|
||||
use shared::sets::GameplaySet;
|
||||
@@ -61,7 +59,7 @@ impl Plugin for PhosGamePlugin {
|
||||
.add_plugins(PerfUiPlugin);
|
||||
|
||||
//Physics
|
||||
app.add_plugins(RapierPhysicsPlugin::<NoUserData>::default());
|
||||
app.add_plugins(PhysicsPlugins::default());
|
||||
// app.add_plugins(RapierDebugRenderPlugin::default());
|
||||
|
||||
app.insert_resource(WireframeConfig {
|
||||
@@ -148,10 +146,9 @@ fn spawn_sphere(
|
||||
transform: Transform::from_translation(cam_transform.translation),
|
||||
..default()
|
||||
},
|
||||
Collider::ball(0.3),
|
||||
Collider::sphere(0.3),
|
||||
RigidBody::Dynamic,
|
||||
Ccd::enabled(),
|
||||
Velocity::linear(cam_transform.forward() * 50.),
|
||||
LinearVelocity(cam_transform.forward() * 50.),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use bevy::{prelude::*, window::PrimaryWindow};
|
||||
use bevy_inspector_egui::bevy_egui::{systems::InputEvents, EguiContexts};
|
||||
use bevy_inspector_egui::egui;
|
||||
use bevy_rapier3d::prelude::*;
|
||||
use shared::resources::TileUnderCursor;
|
||||
use shared::states::GameplayState;
|
||||
use shared::tags::MainCamera;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use avian3d::prelude::{SpatialQuery, SpatialQueryFilter};
|
||||
use bevy::{prelude::*, window::PrimaryWindow};
|
||||
use bevy_rapier3d::{plugin::RapierContext, prelude::QueryFilter};
|
||||
use shared::{
|
||||
resources::{TileContact, TileUnderCursor},
|
||||
tags::MainCamera,
|
||||
@@ -20,7 +20,7 @@ impl Plugin for TileSelectionPlugin {
|
||||
fn update_tile_under_cursor(
|
||||
cam_query: Query<(&GlobalTransform, &Camera), With<MainCamera>>,
|
||||
window: Query<&Window, With<PrimaryWindow>>,
|
||||
rapier_context: Res<RapierContext>,
|
||||
spatial_query: SpatialQuery,
|
||||
map: Res<Map>,
|
||||
mut tile_under_cursor: ResMut<TileUnderCursor>,
|
||||
) {
|
||||
@@ -34,15 +34,16 @@ fn update_tile_under_cursor(
|
||||
return;
|
||||
};
|
||||
|
||||
let collision = rapier_context.cast_ray(
|
||||
let collision = spatial_query.cast_ray(
|
||||
cam_ray.origin,
|
||||
cam_ray.direction.into(),
|
||||
500.,
|
||||
true,
|
||||
QueryFilter::only_fixed(),
|
||||
SpatialQueryFilter::default(),
|
||||
);
|
||||
|
||||
if let Some((_e, dist)) = collision {
|
||||
if let Some(data) = collision {
|
||||
let dist = data.time_of_impact;
|
||||
let contact_point = cam_ray.get_point(dist);
|
||||
let contact_coord = HexCoord::from_world_pos(contact_point);
|
||||
//todo: handle correct tile detection when contacting a tile from the side
|
||||
|
||||
Reference in New Issue
Block a user