Skip to content

Commit

Permalink
Add cargo doc to CI and fix doc links (#582)
Browse files Browse the repository at this point in the history
# Objective

Some doc links are currently broken. CI should catch this!

## Solution

Add `cargo doc` to CI and fix doc links. Also fixed some heading capitalization inconsistency.
  • Loading branch information
Jondolf authored Dec 7, 2024
1 parent d3a3310 commit 5b8e64c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ jobs:
- name: Run cargo check
run: cargo check

docs:
name: Check Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo doc
run: cargo doc --workspace --no-deps --document-private-items --keep-going
env:
RUSTDOCFLAGS: "-D warnings"

test:
name: Test Suite
strategy:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ For larger changes and additions, it's better to open an issue or ask me for inp
before making a pull request.

You can also ask for help or ask questions on the [Bevy Discord](https://discord.com/invite/gMUk5Ph)
server's `Avian Physics` thread in `#crate-help`. My username on the Discord is `Jondolf` (`@jondolfdev`).
server's Avian Physics topic in `#ecosystem-crates`. My username on the Discord is `Jondolf` (`@jondolfdev`).

## Acknowledgements

Expand Down
14 changes: 9 additions & 5 deletions crates/avian2d/examples/interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ use bevy::{
fn main() {
let mut app = App::new();

// Add the `PhysicsInterpolationPlugin` to enable interpolation and extrapolation functionality.
//
// By default, interpolation and extrapolation must be enabled for each entity manually.
// Use `PhysicsInterpolationPlugin::interpolate_all()` to enable interpolation for all rigid bodies.
// Interpolation and extrapolation functionality is enabled by the `PhysicsInterpolationPlugin`.
// It is included in the `PhysicsPlugins` by default.
app.add_plugins((
DefaultPlugins,
PhysicsPlugins::default().with_length_unit(50.0),
PhysicsInterpolationPlugin::default(),
));

// By default, interpolation must be enabled for each entity manually
// by adding the `TransformInterpolation` component.
//
// It can also be enabled for all rigid bodies with `PhysicsInterpolationPlugin::interpolate_all()`:
//
// app.add_plugins(PhysicsPlugins::default().set(PhysicsInterpolationPlugin::interpolate_all()));

// Set gravity.
app.insert_resource(Gravity(Vector::NEG_Y * 900.0));

Expand Down
4 changes: 2 additions & 2 deletions src/dynamics/solver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ use self::{
///
/// 1. [Generate and prepare constraints](collision::narrow_phase::NarrowPhaseSet::GenerateConstraints)
/// 2. Substepping loop (runs the [`SubstepSchedule`] [`SubstepCount`] times)
/// 1. [Integrate velocities](IntegrationSet::Velocity)
/// 1. [Integrate velocities](super::integrator::IntegrationSet::Velocity)
/// 2. [Warm start](SubstepSolverSet::WarmStart)
/// 3. [Solve constraints with bias](SubstepSolverSet::SolveConstraints)
/// 4. [Integrate positions](IntegrationSet::Position)
/// 4. [Integrate positions](super::integrator::IntegrationSet::Position)
/// 5. [Solve constraints without bias to relax velocities](SubstepSolverSet::Relax)
/// 6. [Solve XPBD constraints (joints)](SubstepSolverSet::SolveXpbdConstraints)
/// 7. [Solve user-defined constraints](SubstepSolverSet::SolveUserConstraints)
Expand Down
2 changes: 2 additions & 0 deletions src/dynamics/solver/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ pub enum SolverSet {
ApplyTranslation,
/// Copies contact impulses from [`ContactConstraints`] to the contacts in [`Collisions`].
/// They will be used for [warm starting](SubstepSolverSet::WarmStart) the next frame or substep.
///
/// [`ContactConstraints`]: super::ContactConstraints
StoreContactImpulses,
}

Expand Down
26 changes: 13 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
//! You can also check out the [FAQ](#frequently-asked-questions), and if you encounter
//! any further problems, consider saying hello on the [Bevy Discord](https://discord.gg/bevy)!
//!
//! ## Getting started
//! ## Getting Started
//!
//! This short guide should help you get started with Avian.
//!
//! ### Add the dependency
//! ### Add the Dependency
//!
//! First, add `avian2d` or `avian3d` to the dependencies in your `Cargo.toml`:
//!
Expand Down Expand Up @@ -42,7 +42,7 @@
//! avian3d = { version = "0.1", default-features = false, features = ["3d", "f64", "parry-f64"] }
//! ```
//!
//! ### Feature flags
//! ### Feature Flags
//!
//! | Feature | Description | Default feature |
//! | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
Expand All @@ -67,7 +67,7 @@
//!
//! [SIMD]: https://en.wikipedia.org/wiki/Single_instruction,_multiple_data
//!
//! ### Add the plugins
//! ### Add the Plugins
//!
//! Avian is designed to be very modular. It is built from several [plugins](PhysicsPlugins) that
//! manage different parts of the engine. These plugins can be easily initialized and configured through
Expand Down Expand Up @@ -111,12 +111,12 @@
//! You can find lots of [usage examples](https://github.com/Jondolf/avian#more-examples)
//! in the project's [repository](https://github.com/Jondolf/avian).
//!
//! ## Table of contents
//! ## Table of Contents
//!
//! Below is a structured overview of the documentation for the various
//! features of the engine.
//!
//! ### Rigid body dynamics
//! ### Rigid Body Dynamics
//!
//! - [Rigid body types](RigidBody#rigid-body-types)
//! - [Creating rigid bodies](RigidBody#creation)
Expand All @@ -136,7 +136,7 @@
//!
//! See the [`dynamics`] module for more details about rigid body dynamics in Avian.
//!
//! ### Collision detection
//! ### Collision Detection
//!
//! - [Colliders](Collider)
//! - [Creation](Collider#creation)
Expand All @@ -155,7 +155,7 @@
//!
//! See the [`collision`] module for more details about collision detection and colliders in Avian.
//!
//! ### Constraints and joints
//! ### Constraints and Joints
//!
//! - [Joints](dynamics::solver::joints)
//! - [Fixed joint](FixedJoint)
Expand All @@ -167,7 +167,7 @@
//!
//! Joint motors and articulations are not supported yet, but they will be implemented in a future release.
//!
//! ### Spatial queries
//! ### Spatial Queries
//!
//! - [Spatial query types](spatial_query)
//! - [Raycasting](spatial_query#raycasting) and [`RayCaster`]
Expand All @@ -191,7 +191,7 @@
//! - [`PhysicsSet`]
//! - [`PhysicsSchedule`] and [`PhysicsStepSet`]
//! - [`SubstepSchedule`]
//! - [`SolverSet`] and [`SubstepSolverSet`](dynamics::solver::SubstepSolverSet)
//! - [`SolverSet`] and [`SubstepSolverSet`](dynamics::solver::schedule::SubstepSolverSet)
//! - [`PostProcessCollisions`] schedule
//! - [`PrepareSet`](prepare::PrepareSet)
//! - Many more internal system sets
Expand All @@ -207,7 +207,7 @@
//! - [Custom XPBD constraints](dynamics::solver::xpbd#custom-constraints)
//! - [Custom joints](dynamics::solver::joints#custom-joints)
//!
//! ## Frequently asked questions
//! ## Frequently Asked Questions
//!
//! - [How does Avian compare to Rapier and bevy_rapier?](#how-does-avian-compare-to-rapier-and-bevy_rapier)
//! - [Why is nothing happening?](#why-is-nothing-happening)
Expand Down Expand Up @@ -396,7 +396,7 @@
//! [open a new issue](https://github.com/Jondolf/avian/issues/new) if there already isn't one regarding your problem.
//!
//! You can also come and say hello on the [Bevy Discord server](https://discord.com/invite/gMUk5Ph).
//! There you can find a avian thread on the crate-help channel where you can ask questions.
//! There, you can find an Avian Physics topic on the `#ecosystem-crates` channel where you can ask questions.
//!
//! ## License
//!
Expand Down Expand Up @@ -616,7 +616,7 @@ use prelude::*;
///
/// First, create a new plugin. If you want to run your systems in the engine's schedules, get either the [`PhysicsSchedule`]
/// or the [`SubstepSchedule`]. Then you can add your systems to that schedule and control system ordering with system sets like
/// [`PhysicsStepSet`], [`SolverSet`], or [`SubstepSolverSet`](dynamics::solver::SubstepSolverSet).
/// [`PhysicsStepSet`], [`SolverSet`], or [`SubstepSolverSet`](dynamics::solver::schedule::SubstepSolverSet).
///
/// Here we will create a custom broad phase plugin that will replace the default [`BroadPhasePlugin`]:
///
Expand Down

0 comments on commit 5b8e64c

Please sign in to comment.