1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//! # Kinematic Character Controller for Bevy and Avian3D
//!
//! Ichun provides a modular kinematic character controller (KCC) implementation
//! for the Bevy engine using the Avian3D physics backend. It handles common gameplay
//! features like character movement, jumping, running, and interaction with the environment.
//!
//! ## Features
//!
//! * Kinematic character controller with physics-based collision response
//! * Modular design with separate movement and input systems
//! * Support for slopes, moving platforms and static geometry
//! * Configurable gravity, jump physics, and movement parameters
//! * Optional input handling with customizable key bindings
//!
//! ## Module Structure
//!
//! * `kcc`: Core kinematic character controller functionality and physics
//! * `movement_events`: Movement systems that generate actions to apply velocity from input
//! * `input`: Input handling systems that generate movement events
//! * `actions`: action systems execute movement actions to the character
//! * `system_sets`: Bevy system sets for proper execution ordering
//!
//! ## Usage
//!
//! Add the plugin to your Bevy app:
//!
//! ```rust
//! use bevy::prelude::*;
//! use ichun::IchunPlugin;
//!
//! fn main() {
//! App::new()
//! .add_plugins(DefaultPlugins)
//! .add_plugins(IchunPlugin)
//! .run();
//! }
//! ```
//!
//! Then add the KCC components to your character entity:
//!
//! ```rust
//! use bevy::prelude::*;
//! use bevy_ichun::{IchunPlugin, input::KccInputConfig, kcc::Kcc, movement::KccMovementConfig};
//!
//! fn spawn_character(mut commands: Commands) {
//! commands.spawn((
//! Kcc::default(),
//! KccMovementConfig::default(),
//! KccInputConfig::default(),
//! Mesh3d(meshes.add(Capsule3d::new(0.4, 1.0))),
//! MeshMaterial3d(matl.add(Color::srgb(0.8, 0.7, 0.6))),
//! Transform::from_xyz(0.0, 3.0, 0.0),
//! ));
//! }
//! ```
use *;
use IchunKccPlugin;
use IchunMovementEventsPlugin;
use IchunInputPlugin;
use IchunSystemSetsPlugin;
use IchunActionsPlugin;
;
/// Main plugin for the Ichun character controller.
///
/// This plugin adds all necessary systems and components for the character controller
/// to function. It automatically configures the proper system execution order and
/// adds all required plugins.
///
/// # Features
///
/// The plugin's behavior can be configured using Cargo features:
/// - `kcc_movement_events`: Enables the movement systems (enabled by default)
/// - `kcc_input`: Enables input handling systems (enabled by default)
///
/// # Example
///
/// ```rust
/// use bevy::prelude::*;
/// use bevy_ichun::IchunPlugin;
///
/// fn main() {
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugins(IchunPlugin)
/// .run();
/// }
/// ```