6 releases (breaking)
Uses new Rust 2024
| 0.6.0 | Nov 3, 2025 |
|---|---|
| 0.5.0 | Aug 2, 2025 |
| 0.4.0 | May 10, 2025 |
| 0.3.0 | Apr 18, 2025 |
| 0.1.0 | Mar 4, 2025 |
#457 in Game dev
91KB
1K
SLoC
Ichun (行ちゅん)
bevy-ichun (Okinawan dialect for the Japanese word 行く, meaning 'to go') is a simple kinematic character controller for Bevy with Avian3D.
Versions
| Bevy | Avian | Ichun |
|---|---|---|
| 0.17 | 0.4 | 0.6 |
| 0.16 | 0.3 | 0.4 & 0.5 |
| 0.15 | 0.2 | <= 0.3 |
Features
This library has four main components:
Kcc
The Kcc component provides the basic functionality for a kinematic character controller:
- applying gravity
- handling slopes
- handling moving platforms
- collision handling with static geometry
Kcc actions (enabled by default kcc_actions)
The KccActions component stores actions which should be executed each frame.
The actions will be reset in the post-update loop and thus need to be set each frame.
Following actions are possible:
- moving
- jumping
- rotating (mouse movement as Vec3, looking at and looking to)
- gravity modification
Kcc movement (kcc_movement_events)
The KccMovementEventsConfig component provides events which can be used to move the Kcc around.
The events will add kcc_actions and provide a nice and clean API but not as much freedom as using the actions on your own:
- moving
- running
- jumping
- floating
- rotating
Kcc input (kcc_input)
This component handles user defined input and uses the kcc_movement_events to move the Kcc around.
- forward, backward, left and right
- run
- jump
- float
- optional key to activate roation
- disable input handling for each
Kcc& globally
Defining a key to handle roation is not yet implemented (the mouse is used).
This feature is depending on the kcc_movement_events.
Examples
Examples are in the examples folder.
It can be run with following command: cargo r --example simple-kcc.
Or to check out the event based approach: cargo r --example simple-kcc-with-events --features "kcc_input kcc_movement_events".
Reference material
- The Avian3d example for the kcc: https://github.com/Jondolf/avian/tree/main/crates/avian3d/examples/kinematic_character_3d
License
Dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Dependencies
~47–67MB
~1M SLoC