Crate bevy_fpc

source ·
Expand description

First-person-controller plugin for the Bevy game-engine.

The controller benefits from the features offered by the rapier character controller.

Plugins initialization:

// Require the `bevy_rapier3d` crate
App::new()
	.add_plugins(RapierPhysicsPlugin::<NoUserData>::default())
	.add_plugins(FpcPlugin);

Spawn and embody an fpc entity:

commands.spawn(FpcBundle::default()).insert(Player);

Custom configuration:

app.insert_resource(FpcConfiguration{
  keyboard_linear_inputs: LINEAR_AZERTY_LAYOUT,
  ..Default::default()
});

§Features

Structs§

  • Fpc marker
  • Bundle containing all neccessary components for the base of a first person controller entity.
  • A resource for specifying configuration information about first person controllers.
  • The bevy_fpc structure implementing the bevy Plugin trait. This plugin require the bevy_rapier3d plugin.
  • A resource for specifying configuration information about bevy_fpc sprinting feature.
  • Structure for the keyboard linear inputs configuration
  • Marker used for embodying the associated first person controller.
  • Component used to mutate speed of controller horizontal translations when sprinting. Contain one value by which the WalkSpeed will be multiplied.
  • Component used to mutate speed of controller horizontal translations when walking. Contain one value by which the linear velocity will be multiplied.

Enums§

  • State used to eithers contains the mouse cursor while allowing angular movements or let the mouse cursor free while preventing angular movements.

Constants§