From 6be61e17ccc404890bcca99da7605b64e98e8755 Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Tue, 16 Nov 2021 00:39:33 +0100 Subject: [PATCH] Remove trailing spaces from comments --- README.md | 4 ++-- rg3d-core/src/inspect.rs | 2 +- rg3d-core/src/math/aabb.rs | 2 +- rg3d-core/src/pool.rs | 4 ++-- rg3d-core/src/quadtree.rs | 2 +- rg3d-physics/src/lib.rs | 2 +- rg3d-resource/src/lib.rs | 8 ++++---- rg3d-sound/src/context.rs | 2 +- src/engine/mod.rs | 2 +- src/engine/resource_manager.rs | 2 +- src/material/mod.rs | 10 +++++----- src/material/shader.rs | 2 +- src/renderer/forward_renderer.rs | 2 +- src/scene/base.rs | 4 ++-- src/scene/debug.rs | 2 +- src/scene/mesh/buffer.rs | 4 ++-- src/scene/mod.rs | 2 +- src/scene/particle_system/emitter/sphere.rs | 2 +- src/scene/terrain.rs | 2 +- src/scene/variable.rs | 2 +- 20 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index d649441c7..5e724e9d9 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ use my savings to drive development forward, I'm looking for any financial suppo ## Tutorials and learning materials ### Book -[Read the official rg3d book here.](https://rg3d-book.github.io) +[Read the official rg3d book here.](https://rg3d-book.github.io) ### Writing a 3D Shooter using rg3d: - [#1 Character controller](https://rg3d.rs/tutorials/2021/03/05/tutorial1.html) @@ -240,4 +240,4 @@ JetBrains provided an open-source all-products license for their products which JetBrains logo. -_Copyright © 2000-2021 [JetBrains](https://jb.gg/OpenSource) s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o._ \ No newline at end of file +_Copyright © 2000-2021 [JetBrains](https://jb.gg/OpenSource) s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o._ diff --git a/rg3d-core/src/inspect.rs b/rg3d-core/src/inspect.rs index 1256b96dc..60db0e61d 100644 --- a/rg3d-core/src/inspect.rs +++ b/rg3d-core/src/inspect.rs @@ -140,7 +140,7 @@ impl<'a> PropertyInfo<'a> { /// - `#[inspect(group = "Group Name")]` - override group name. /// - `#[inspect(expand)]` - extends the list of properties in case of composition, in other words it /// "flattens" and exposes the properties of an inner object. Useful when you have a structure that -/// has some fields that are complex objects that implements `Inspect` too. +/// has some fields that are complex objects that implements `Inspect` too. pub trait Inspect { /// Returns information about "public" properties. fn properties(&self) -> Vec>; diff --git a/rg3d-core/src/math/aabb.rs b/rg3d-core/src/math/aabb.rs index 59226bc70..d7bfe6eae 100644 --- a/rg3d-core/src/math/aabb.rs +++ b/rg3d-core/src/math/aabb.rs @@ -186,7 +186,7 @@ impl AxisAlignedBoundingBox { /// Transforms axis-aligned bounding box using given affine transformation matrix. /// /// # References - /// + /// /// Transforming Axis-Aligned Bounding Boxes by Jim Arvo, "Graphics Gems", Academic Press, 1990 #[inline] #[must_use] diff --git a/rg3d-core/src/pool.rs b/rg3d-core/src/pool.rs index ab9f9554b..1eb4ad781 100644 --- a/rg3d-core/src/pool.rs +++ b/rg3d-core/src/pool.rs @@ -388,7 +388,7 @@ impl Pool { /// /// The method has O(n) complexity in worst case, where `n` - amount of free records in the pool. /// In typical uses cases `n` is very low. It should be noted that if a pool is filled entirely - /// and you trying to put an object at the end of pool, the method will have O(1) complexity. + /// and you trying to put an object at the end of pool, the method will have O(1) complexity. #[inline] pub fn spawn_at(&mut self, index: u32, payload: T) -> Result, T> { self.spawn_at_internal(index, INVALID_GENERATION, payload) @@ -401,7 +401,7 @@ impl Pool { /// /// The method has O(n) complexity in worst case, where `n` - amount of free records in the pool. /// In typical uses cases `n` is very low. It should be noted that if a pool is filled entirely - /// and you trying to put an object at the end of pool, the method will have O(1) complexity. + /// and you trying to put an object at the end of pool, the method will have O(1) complexity. pub fn spawn_at_handle(&mut self, handle: Handle, payload: T) -> Result, T> { self.spawn_at_internal(handle.index, handle.generation, payload) } diff --git a/rg3d-core/src/quadtree.rs b/rg3d-core/src/quadtree.rs index 77a2c6021..86fd0bf6c 100644 --- a/rg3d-core/src/quadtree.rs +++ b/rg3d-core/src/quadtree.rs @@ -64,7 +64,7 @@ pub trait BoundsProvider { pub enum QuadTreeBuildError { /// It means that given split threshold is too low for an algorithm to build quad tree. - /// Make it larger and try again. Also this might mean that your initial bounds are too small. + /// Make it larger and try again. Also this might mean that your initial bounds are too small. ReachedRecursionLimit, } diff --git a/rg3d-physics/src/lib.rs b/rg3d-physics/src/lib.rs index 37d85fd9d..3769abeca 100644 --- a/rg3d-physics/src/lib.rs +++ b/rg3d-physics/src/lib.rs @@ -162,7 +162,7 @@ pub struct Intersection { pub position: Point, /// Additional data that contains a kind of the feature with which - /// intersection was detected as well as its index. + /// intersection was detected as well as its index. /// /// # Important notes. /// diff --git a/rg3d-resource/src/lib.rs b/rg3d-resource/src/lib.rs index 1f9e643bb..98539ba5c 100644 --- a/rg3d-resource/src/lib.rs +++ b/rg3d-resource/src/lib.rs @@ -41,7 +41,7 @@ impl ResourceLoadError for T where T: 'static + Debug + Send + Sync {} /// Long answer: when you loading a scene you expect it to be loaded as fast as /// possible, use all available power of the CPU. To achieve that each resource /// ideally should be loaded on separate core of the CPU, but since this is -/// asynchronous, we must have the ability to track the state of the resource. +/// asynchronous, we must have the ability to track the state of the resource. #[derive(Debug)] pub enum ResourceState { /// Resource is loading from external resource or in the queue to load. @@ -55,7 +55,7 @@ pub enum ResourceState { LoadError { /// A path at which it was impossible to load the resource. path: PathBuf, - /// An error. This wrapped in Option only to be Default_ed. + /// An error. This wrapped in Option only to be Default_ed. error: Option>, }, /// Actual resource data when it is fully loaded. @@ -197,7 +197,7 @@ impl Resource { /// there was load error. Usually this is ok because normally you'd chain this call /// like this `resource.await?.data_ref()`. Every resource implements Future trait /// and it returns Result, so if you'll await future then you'll get Result, so - /// call to `data_ref` will be fine. + /// call to `data_ref` will be fine. #[inline] pub fn data_ref(&self) -> ResourceDataRef<'_, T, E> { ResourceDataRef { @@ -333,7 +333,7 @@ impl Default for ResourceState { } } -/// Defines a new resource type via new-type wrapper. +/// Defines a new resource type via new-type wrapper. #[macro_export] macro_rules! define_new_resource { ($(#[$meta:meta])* $name:ident<$state:ty, $error:ty>) => { diff --git a/rg3d-sound/src/context.rs b/rg3d-sound/src/context.rs index dacbadf24..efeff04d2 100644 --- a/rg3d-sound/src/context.rs +++ b/rg3d-sound/src/context.rs @@ -8,7 +8,7 @@ //! for inventory and so on. With this approach of multiple contexts it is very easy to manage such scenes: //! for example your main menu have a complex scene with some sounds and you decide to load a game level - //! once the level is loaded you just set master gain of main menu context and it will no longer produce any -//! sounds, only your level will do. +//! sounds, only your level will do. use crate::pool::Ticket; use crate::{ diff --git a/src/engine/mod.rs b/src/engine/mod.rs index 44d36366e..1cb1ac5e1 100644 --- a/src/engine/mod.rs +++ b/src/engine/mod.rs @@ -42,7 +42,7 @@ pub struct Engine { pub renderer: Renderer, /// User interface allows you to build interface of any kind. UI itself is *not* thread-safe, /// but it uses messages to "talk" with outside world and message queue (MPSC) *is* thread-safe - /// so its sender part can be shared across threads. + /// so its sender part can be shared across threads. pub user_interface: UserInterface, /// Sound context control all sound sources in the engine. It is wrapped into Arc> /// because internally sound engine spawns separate thread to mix and send data to sound diff --git a/src/engine/resource_manager.rs b/src/engine/resource_manager.rs index 30438db8d..3f10b4a7c 100644 --- a/src/engine/resource_manager.rs +++ b/src/engine/resource_manager.rs @@ -1056,7 +1056,7 @@ impl ResourceManagerState { /// Returns percentage of loading progress. This method is useful to show progress on /// loading screen in your game. This method could be used alone if your game depends /// only on external resources, or if your game doing some heavy calculations this value - /// can be combined with progress of your tasks. + /// can be combined with progress of your tasks. pub fn loading_progress(&self) -> usize { let registered = self.count_registered_resources(); if registered > 0 { diff --git a/src/material/mod.rs b/src/material/mod.rs index b228411ec..421d52b96 100644 --- a/src/material/mod.rs +++ b/src/material/mod.rs @@ -94,7 +94,7 @@ pub enum PropertyValue { /// The colors you see on your monitor are in sRGB color space, this is fine for simple cases /// of rendering, but not for complex things like lighting. Such things require color to be /// linear. Value of this variant will be automatically **converted to linear color space** - /// before it passed to shader. + /// before it passed to shader. Color(Color), /// A texture with fallback option. @@ -298,7 +298,7 @@ impl Default for PropertyValue { /// fallback: SamplerFallback::White /// }) /// .unwrap(); -/// +/// /// material /// } /// ``` @@ -322,7 +322,7 @@ impl Default for PropertyValue { /// /// async fn create_grass_material(resource_manager: ResourceManager) -> Material { /// let shader = resource_manager.request_shader("my_grass_shader.ron").await.unwrap(); -/// +/// /// // Here we assume that the material really has the properties defined below. /// let mut material = Material::from_shader(shader, Some(resource_manager)); /// @@ -397,7 +397,7 @@ impl Material { /// fallback: SamplerFallback::White /// }) /// .unwrap(); - /// + /// /// material /// } /// ``` @@ -429,7 +429,7 @@ impl Material { /// /// async fn create_grass_material(resource_manager: ResourceManager) -> Material { /// let shader = resource_manager.request_shader("my_grass_shader.ron").await.unwrap(); - /// + /// /// // Here we assume that the material really has the properties defined below. /// let mut material = Material::from_shader(shader, Some(resource_manager)); /// diff --git a/src/material/shader.rs b/src/material/shader.rs index 0fc21bb77..196e0bc8b 100644 --- a/src/material/shader.rs +++ b/src/material/shader.rs @@ -162,7 +162,7 @@ pub enum PropertyKind { /// The colors you see on your monitor are in sRGB color space, this is fine for simple cases /// of rendering, but not for complex things like lighting. Such things require color to be /// linear. Value of this variant will be automatically **converted to linear color space** - /// before it passed to shader. + /// before it passed to shader. Color { /// Default Red. r: u8, diff --git a/src/renderer/forward_renderer.rs b/src/renderer/forward_renderer.rs index cc4f63f95..4db6c73b9 100644 --- a/src/renderer/forward_renderer.rs +++ b/src/renderer/forward_renderer.rs @@ -1,7 +1,7 @@ //! Forward renderer is used to render transparent meshes and meshes with custom blending options. //! //! # Notes -//! +//! //! This renderer eventually will replace deferred renderer, because deferred renderer is too restrictive. //! For now it is used **only** to render transparent meshes (or any other mesh that has Forward render //! path). diff --git a/src/scene/base.rs b/src/scene/base.rs index a92a4cc2e..fa89c95c2 100644 --- a/src/scene/base.rs +++ b/src/scene/base.rs @@ -78,7 +78,7 @@ pub struct LevelOfDetail { } impl LevelOfDetail { - /// Creates new level of detail. + /// Creates new level of detail. pub fn new(begin: f32, end: f32, objects: Vec>) -> Self { for object in objects.iter() { // Invalid handles are not allowed. @@ -127,7 +127,7 @@ impl LevelOfDetail { /// if distance satisfy cascade range. LOD may significantly improve performance if your scene /// contains lots of high poly objects and objects may be far away from camera. Distant objects /// in this case will be rendered with lower details freeing precious GPU resources for other -/// useful tasks. +/// useful tasks. /// /// Lod group must contain non-overlapping cascades, each cascade with its own set of objects /// that belongs to level of detail. Engine does not care if you create overlapping cascades, diff --git a/src/scene/debug.rs b/src/scene/debug.rs index 895371dde..bebd11a0c 100644 --- a/src/scene/debug.rs +++ b/src/scene/debug.rs @@ -14,7 +14,7 @@ use std::ops::Range; pub struct Line { /// Beginning of the line. pub begin: Vector3, - /// End of the line. + /// End of the line. pub end: Vector3, /// Color of the line. pub color: Color, diff --git a/src/scene/mesh/buffer.rs b/src/scene/mesh/buffer.rs index ee2e9a646..fa96bb067 100644 --- a/src/scene/mesh/buffer.rs +++ b/src/scene/mesh/buffer.rs @@ -2,7 +2,7 @@ //! //! # Limitations //! -//! Vertex size cannot be more than 256 bytes, this limitation shouldn't be a problem because +//! Vertex size cannot be more than 256 bytes, this limitation shouldn't be a problem because //! almost every GPU supports up to 16 vertex attributes with 16 bytes of size each, which //! gives exactly 256 bytes. @@ -566,7 +566,7 @@ impl VertexBuffer { } } - /// Creates iterator that emits read accessors for vertices. + /// Creates iterator that emits read accessors for vertices. pub fn iter(&self) -> impl Iterator> + '_ { VertexViewRefIterator { data: &self.data, diff --git a/src/scene/mod.rs b/src/scene/mod.rs index 6d4bb2fba..73cbea2ef 100644 --- a/src/scene/mod.rs +++ b/src/scene/mod.rs @@ -428,7 +428,7 @@ impl Scene { } /// Removes node from scene with all associated entities, like animations etc. This method - /// should be used all times instead of [Graph::remove_node](crate::scene::graph::Graph::remove_node), + /// should be used all times instead of [Graph::remove_node](crate::scene::graph::Graph::remove_node). /// /// # Panics /// diff --git a/src/scene/particle_system/emitter/sphere.rs b/src/scene/particle_system/emitter/sphere.rs index 823157610..870e39f20 100644 --- a/src/scene/particle_system/emitter/sphere.rs +++ b/src/scene/particle_system/emitter/sphere.rs @@ -1,5 +1,5 @@ //! Sphere emitter uniformly places particles in spherical volume. Can be used with -//! radius = 0, then it represents point emitter. +//! radius = 0, then it represents point emitter. use crate::core::numeric_range::RangeExt; use crate::{ diff --git a/src/scene/terrain.rs b/src/scene/terrain.rs index 69f058d22..b4a39f0b5 100644 --- a/src/scene/terrain.rs +++ b/src/scene/terrain.rs @@ -213,7 +213,7 @@ fn map_to_local(v: Vector3) -> Vector2 { Vector2::new(v.x, v.z) } -/// Ray-terrain intersection result. +/// Ray-terrain intersection result. #[derive(Debug)] pub struct TerrainRayCastResult { /// World-space position of impact point. diff --git a/src/scene/variable.rs b/src/scene/variable.rs index 9d1c801a0..5ec3488df 100644 --- a/src/scene/variable.rs +++ b/src/scene/variable.rs @@ -17,7 +17,7 @@ use std::ops::Deref; /// The question is: what should happen with the instance of the object in the scene? Logical answer would be: /// if it hasn't been modified, then just take the new position from the 3D model. This is where template /// variable comes into play. If you've change the value of such variable, it will remember changes and the object -/// will stay on its new position instead of changed. +/// will stay on its new position instead of changed. #[derive(Debug)] pub struct TemplateVariable { // Actual value.