Skip to content

Commit

Permalink
docs: Fix grammar mistakes on docs.rs (jcornaz#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGlolenstine authored Mar 8, 2021
1 parent 03e9c30 commit ed540f7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions core/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use bevy::ecs::{Schedule, System};

/// Extensions for the app builder
pub trait AppBuilderExt {
/// Add a system to the "physics update" stage, so that it runs before each physics step.
/// Add a system to the "physics update" stage so that it runs before each physics step.
///
/// This can be used to add systems that modify transform/velocity or other physics components.
///
/// Typically (and by default) the physics step run at a fixed rate and are out of sync of the bevy update.
///
/// Typically (and by default) physics steps run at a fixed rate and are out of sync with the bevy update.
fn add_physics_system<S: System<In = (), Out = ()>>(&mut self, system: S) -> &mut Self;
}

Expand Down
20 changes: 10 additions & 10 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ mod velocity;

/// Physics stages for user systems. These stages are executed once per physics step.
///
/// That usually means they don't run each frame, and may run more than once in a single frame.
/// That usually means they don't run each frame and may run more than once in a single frame.
///
/// In general end-users shouldn't have to deal with these stages directly.
/// In general, end-users shouldn't have to deal with these stages directly.
///
/// Instead, it is possible to call the [`add_physiscs_system`](ext::AppBuilderExt::add_physics_system) extension function on `AppBuilder`
/// to register systems that should run during the physics update.
Expand All @@ -37,7 +37,7 @@ pub mod stage {
pub const UPDATE: &str = "heron-before-step";
}

/// Plugin that register stage resources and components.
/// Plugin that registers stage resources and components.
///
/// It does **NOT** enable physics behavior.
#[derive(Debug, Copy, Clone)]
Expand Down Expand Up @@ -153,7 +153,7 @@ impl Default for Body {
pub enum BodyType {
/// A dynamic body is normally affected by physic forces and affect the other bodies normally too.
///
/// This is the most "natural" type in the sense that, in the real life, everything is dynamic.
/// This is the most "natural" type in the sense that, in real life, everything is dynamic.
///
/// It is the default type.
Dynamic,
Expand All @@ -167,22 +167,22 @@ pub enum BodyType {

/// A kinematic body is not moved by the physics engine. But it can have user-defined velocity.
///
/// It affects the other bodies normally, but is not affected by them.
/// It affects the other bodies normally but is not affected by them.
///
/// If the transform is updated, then a velocity will be automatically calculated, producing
/// realistic interaction with other bodies.
///
/// It can also have a velocity be applied.
///
/// It is well suited fo moving-platforms.
/// It is well-suited for moving platforms.
Kinematic,

/// A sensor is not affected by physics forces and doesn't affect other bodies either.
///
/// Other bodies will be able to penetrate the sensor. But it still participate in collision events.
/// Other bodies will be able to penetrate the sensor. But it still participates in collision events.
///
/// A sensor is useful when we are only interested in collision events.
/// One may for example add a sensor to detect when the player reach a certain area.
/// One may, for example, add a sensor to detect when the player reaches a certain area.
Sensor,
}

Expand Down Expand Up @@ -245,14 +245,14 @@ pub enum CollisionEvent {
/// ```
#[derive(Debug, Copy, Clone, PartialEq, Reflect)]
pub struct PhysicMaterial {
/// Coefficient of restitution. Affect how much it "bounces" when colliding other objects.
/// Coefficient of restitution. Affect how much it "bounces" when colliding with other objects.
///
/// The higher the value, the more "bouncy".
///
/// Typical values are between 0 (perfectly inelastic) and 1 (perfectly elastic)
pub restitution: f32,

/// Density. Affects how much the body resist to forces.
/// Density. It affects how much the body resists forces.
///
/// The higher the value, the heavier.
///
Expand Down
2 changes: 1 addition & 1 deletion core/src/velocity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::ops::{Mul, MulAssign};
/// Component that defines the linear and angular velocity.
///
/// The linear part is in "unit" per second on each axis, represented as a `Vec3`. (The unit, being your game unit, be it pixel or anything else)
/// The angular part is in radians per second around an axis, represented as a `Quat`
/// The angular part is in radians per second around an axis, represented as a `Quat`.
///
/// # Example
///
Expand Down
12 changes: 6 additions & 6 deletions rapier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct RapierPlugin {
pub parameters: IntegrationParameters,
}

/// Components automatically register, by the plugin that references the body in rapier's world
/// Components automatically register, by the plugin that references the body in rapier's world.
///
/// It can be used to get direct access to rapier's world.
#[derive(Debug, Copy, Clone)]
Expand All @@ -60,11 +60,11 @@ pub struct BodyHandle {
}

impl RapierPlugin {
/// Configure how many times per second the physics world needs to be updated
/// Configure how many times per second the physics world needs to be updated.
///
/// # Panics
///
/// Panic if the number of `steps_per_second` is 0
/// Panic if the number of `steps_per_second` is 0.
pub fn from_steps_per_second(steps_per_second: u8) -> Self {
assert!(
steps_per_second > 0,
Expand Down Expand Up @@ -146,7 +146,7 @@ impl Plugin for RapierPlugin {
}

impl BodyHandle {
/// Creates the new `BodyHandle`
/// Creates the new `BodyHandle`.
#[must_use]
pub fn new(rigid_body: RigidBodyHandle, collider: ColliderHandle) -> BodyHandle {
BodyHandle {
Expand All @@ -155,13 +155,13 @@ impl BodyHandle {
}
}

/// Returns the rapier's rigid body handle
/// Returns the rapier's rigid body handle.
#[must_use]
pub fn rigid_body(&self) -> RigidBodyHandle {
self.rigid_body
}

/// Returns the rapier's collider handle
/// Returns the rapier's collider handle.
#[must_use]
pub fn collider(&self) -> ColliderHandle {
self.collider
Expand Down
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
//! heron = { version = "0.2.0", default-features = false, features = ["2d"] }
//! ```
//!
//! Note: when debugging you may consider enabling the `debug` feature, to render the collision shapes (works only for 2d, at the moment).
//! Note: when debugging, you may consider enabling the `debug` feature to render the collision shapes (works only for 2d, at the moment).
//!
//! ## Install the plugin
//!
//! To enable physics and collision detection, the [`PhysicsPlugin`] should be installed
//! The [`PhysicsPlugin`] should be installed to enable physics and collision detection.
//!
//! ```no_run
//! use bevy::prelude::*;
Expand All @@ -48,7 +48,7 @@
//! To create a rigid body, add the component `Body` to the entity, choosing a collision shape.
//! It will turn the entity into a dynamic rigid body affected by physics.
//!
//! The position, and rotation is defined by the bevy `GlobalTransform` component.
//! The position and rotation are defined by the bevy `GlobalTransform` component.
//!
//! ```
//! # use bevy::prelude::*;
Expand All @@ -72,10 +72,10 @@
//!
//! ## Run systems synchronously with the physics step
//!
//! The physics step runs at fixed rate (60 times per second by default) and is out of sync of the
//! The physics step runs at a fixed rate (60 times per second by default) and is out of sync of the
//! bevy frame.
//!
//! But modifying any physics component (such as the transform or velocity) **must** be done synchronously with
//! But modifying any physics component (such as the transform or velocity), **must** be done synchronously with
//! the physics step.
//!
//! The simplest way is to add these systems with `add_physics_system`:
Expand All @@ -99,18 +99,18 @@
//! # fn update_velocities() {}
//! ```
//!
//! ## Move rigid bodies programatically
//! ## Move rigid bodies programmatically
//!
//! When creating games, it is often useful to interact with the physics engine and move bodies programatically.
//! When creating games, it is often useful to interact with the physics engine and move bodies programmatically.
//! For this, you have two options: Updating the `Transform` or applying a [`Velocity`].
//!
//! ### Option 1: Update the Transform
//!
//! For kinematic bodies ([`BodyType::Kinematic`]), if the transform is udpated,
//! For kinematic bodies ([`BodyType::Kinematic`]), if the transform is updated,
//! the body is moved and get an automatically calculated velocity. Physics rules will be applied normally.
//! Updating the transform is a good way to move a kinematic body.
//!
//! For other type of bodies, if the transform is updated,
//! For other types of bodies, if the transform is updated,
//! the rigid body will be *teleported* to the new position/rotation, **ignoring physic rules**.
//!
//! ### Option 2: Use the Velocity component
Expand All @@ -137,7 +137,7 @@ use heron_rapier::RapierPlugin;

/// Physics behavior powered by [rapier](https://rapier.rs)
///
/// Allow to access the underlying physics world directly
/// Allow access to the underlying physics world directly
pub mod rapier_plugin {
pub use heron_rapier::*;
}
Expand All @@ -150,7 +150,7 @@ pub mod prelude {
};
}

/// Plugin to install in order to enable collision detection and physics behavior.
/// Plugin to install to enable collision detection and physics behavior.
///
/// When creating the plugin, you may choose the number of physics steps per second.
/// For more advanced configuration, you can create the plugin from a rapier `IntegrationParameters` definition.
Expand Down

0 comments on commit ed540f7

Please sign in to comment.