Skip to content

Commit

Permalink
Better playground scene, minor bug fixes (#15)
Browse files Browse the repository at this point in the history
* Change example to use a gltf scene

* Add debug text, clean up basis transforms with matrices

* In progress update

* Update

* Prevent falling off ledge with edge cases

* Add step offset but disable by default

* Update README.md

* Add no friction to readme, cleanup

* Remove config toml
  • Loading branch information
qhdwight authored Feb 28, 2023
1 parent 022d469 commit 7111389
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 234 deletions.
66 changes: 33 additions & 33 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_fps_controller"
version = "0.1.7-dev"
version = "0.1.8-dev"
edition = "2021"
authors = ["bevy_fps_controller"]
repository = "https://github.com/qhdwight/bevy_fps_controller"
Expand Down
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Inspired from Source engine movement, this plugin implements movement suitable f

### Features

* Air strafing
* Bunny hopping (hold down jump)
* Sprinting
* Air strafing and bunny hopping (hold down jump key)
* Support for sloped ground
* Crouching (prevents falling off ledges), sprinting
* Noclip mode
* Configurable settings
* SOON: crouching, walking

### Examples

See [main.rs](./examples/minimal.rs)

```bash
cargo run --example minimal
```
Expand All @@ -34,13 +34,22 @@ fn main() {
...
.add_plugin(RapierPhysicsPlugin::<NoUserData>::default())
.add_plugin(FpsControllerPlugin)
.add_startup_system(setup)
...
}

fn setup(...) {
fn setup(mut commands: Commands, ...) {
...
commands.spawn((
Collider::capsule(Vec3::Y * 0.5, Vec3::Y * 1.5, 0.5),
Friction {
coefficient: 0.0,
combine_rule: CoefficientCombineRule::Min,
},
Restitution {
coefficient: 0.0,
combine_rule: CoefficientCombineRule::Min,
},
ActiveEvents::COLLISION_EVENTS,
Velocity::zero(),
RigidBody::Dynamic,
Expand Down Expand Up @@ -68,6 +77,6 @@ fn setup(...) {

### Demo

Used by my other project: https://github.com/qhdwight/voxel-game-rs
https://user-images.githubusercontent.com/20666629/221995601-2ec352fe-a8b0-4f8c-9a81-beaf898b2b41.mp4

https://user-images.githubusercontent.com/20666629/157115719-719a1e7b-a308-4239-919f-8daa9f2ef6e3.mp4
Used by my other project: https://github.com/qhdwight/voxel-game-rs
Binary file added assets/fira_mono.ttf
Binary file not shown.
Binary file added assets/playground.blend
Binary file not shown.
Binary file added assets/playground.glb
Binary file not shown.
Binary file added assets/texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7111389

Please sign in to comment.