aboutsummaryrefslogtreecommitdiff
path: root/plugins/gravity/src/gravity.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-08 15:49:38 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-08 15:49:38 +0800
commit8ff60fdeb0dda7cb6eb7ed91c5084fc107f33365 (patch)
tree8b72bc3e2aa684b28e5623ac91653ee713fd638e /plugins/gravity/src/gravity.rs
parentebd8f440ae5a2d131cd4e6c064b2d97209cf0858 (diff)
feat: add gravity and gravity-movement plugins
Add CHGravityPlugin to manage the global gravity resource and CHGravityMovementGluePlugin to apply gravity to movement velocity each fixed update. Update workspace dependencies and include the new crates in the main app.
Diffstat (limited to 'plugins/gravity/src/gravity.rs')
-rw-r--r--plugins/gravity/src/gravity.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/gravity/src/gravity.rs b/plugins/gravity/src/gravity.rs
new file mode 100644
index 0000000..6d7030c
--- /dev/null
+++ b/plugins/gravity/src/gravity.rs
@@ -0,0 +1,12 @@
+use bevy::{
+ ecs::resource::Resource,
+ math::Vec3,
+ prelude::{Deref, DerefMut},
+};
+
+/// Represents the global gravity
+#[derive(Resource, Deref, DerefMut, PartialEq, Default, Clone)]
+pub struct Gravity {
+ #[deref]
+ pub(crate) gravity: Vec3,
+}