mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
Remove trailing spaces from comments
This commit is contained in:
@@ -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
|
||||
|
||||
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" alt="JetBrains logo." width="200" height="200">
|
||||
|
||||
_Copyright © 2000-2021 [JetBrains](https://jb.gg/OpenSource) s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o._
|
||||
_Copyright © 2000-2021 [JetBrains](https://jb.gg/OpenSource) s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o._
|
||||
|
||||
@@ -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<PropertyInfo<'_>>;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -388,7 +388,7 @@ impl<T> Pool<T> {
|
||||
///
|
||||
/// 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<Handle<T>, T> {
|
||||
self.spawn_at_internal(index, INVALID_GENERATION, payload)
|
||||
@@ -401,7 +401,7 @@ impl<T> Pool<T> {
|
||||
///
|
||||
/// 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<T>, payload: T) -> Result<Handle<T>, T> {
|
||||
self.spawn_at_internal(handle.index, handle.generation, payload)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ pub struct Intersection {
|
||||
pub position: Point<f32>,
|
||||
|
||||
/// 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.
|
||||
///
|
||||
|
||||
@@ -41,7 +41,7 @@ impl<T> 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<T: ResourceData, E: ResourceLoadError> {
|
||||
/// Resource is loading from external resource or in the queue to load.
|
||||
@@ -55,7 +55,7 @@ pub enum ResourceState<T: ResourceData, E: ResourceLoadError> {
|
||||
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<Arc<E>>,
|
||||
},
|
||||
/// Actual resource data when it is fully loaded.
|
||||
@@ -197,7 +197,7 @@ impl<T: ResourceData, E: ResourceLoadError> Resource<T, E> {
|
||||
/// 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<T: ResourceData, E: ResourceLoadError> Default for ResourceState<T, E> {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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>) => {
|
||||
|
||||
@@ -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::{
|
||||
|
||||
+1
-1
@@ -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<Mutex<>>
|
||||
/// because internally sound engine spawns separate thread to mix and send data to sound
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+5
-5
@@ -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));
|
||||
///
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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).
|
||||
|
||||
+2
-2
@@ -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<Handle<Node>>) -> 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,
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ use std::ops::Range;
|
||||
pub struct Line {
|
||||
/// Beginning of the line.
|
||||
pub begin: Vector3<f32>,
|
||||
/// End of the line.
|
||||
/// End of the line.
|
||||
pub end: Vector3<f32>,
|
||||
/// Color of the line.
|
||||
pub color: Color,
|
||||
|
||||
@@ -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<Item = VertexViewRef<'_>> + '_ {
|
||||
VertexViewRefIterator {
|
||||
data: &self.data,
|
||||
|
||||
+1
-1
@@ -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
|
||||
///
|
||||
|
||||
@@ -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::{
|
||||
|
||||
@@ -213,7 +213,7 @@ fn map_to_local(v: Vector3<f32>) -> Vector2<f32> {
|
||||
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.
|
||||
|
||||
@@ -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<T> {
|
||||
// Actual value.
|
||||
|
||||
Reference in New Issue
Block a user