Skip to main content

Crate lightyear_avian3d

Crate lightyear_avian3d 

Source
Expand description

§Lightyear Avian Integration

This crate integrates Lightyear replication, prediction, rollback, frame interpolation, and lag compensation with the Avian physics engine.

For networked physics, install plugin::LightyearAvianPlugin and disable Avian’s PhysicsTransformPlugin and PhysicsInterpolationPlugin. The default and recommended plugin::AvianReplicationMode::Position keeps Avian Position and Rotation authoritative and writes their final visual values to Bevy Transform in PostUpdate. Setting its sync_to_transform field to true synchronizes that authoritative pose to Transform before FixedUpdate, allowing fixed-tick gameplay to use Transform.

Position mode also registers the standard rigid-body Position, Rotation, LinearVelocity, and AngularVelocity networking rules by default. Add this plugin after the Lightyear networking plugins or your component protocol. Specialized protocols can disable those defaults with plugin::LightyearAvianPlugin::register_physics_components.

Re-exports§

pub use types_3d as types;

Modules§

lag_compensation
Provides systems and components for lag compensation with Avian. Provides helpers to perform lag compensation so that client-predicted entities can interact with interpolated entities.
plugin
Helpers to network avian components.
prelude
Commonly used items for Lightyear Avian integration.
types_3d
Implement lightyear traits for some common bevy types