Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
IceSentry committed Jul 27, 2021
1 parent d3ae816 commit a712071
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_math/src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use glam::Vec2;
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};

/// A two dimensional "size" as defined by a width and height
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/ui/ui.rs)
#[derive(Copy, Clone, PartialEq, Debug, Reflect)]
#[reflect(PartialEq)]
pub struct Size<T: Reflect + PartialEq = f32> {
Expand All @@ -26,6 +27,7 @@ impl<T: Default + Reflect + PartialEq> Default for Size<T> {
}

/// A rect, as defined by its "side" locations
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/ui/ui.rs)
#[derive(Copy, Clone, PartialEq, Debug, Reflect)]
#[reflect(PartialEq)]
pub struct Rect<T: Reflect + PartialEq> {
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_pbr/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use bevy_render::{
use bevy_transform::prelude::{GlobalTransform, Transform};

/// A component bundle for "pbr mesh" entities
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/pbr.rs)
#[derive(Bundle)]
pub struct PbrBundle {
pub mesh: Handle<Mesh>,
Expand Down Expand Up @@ -41,6 +42,7 @@ impl Default for PbrBundle {
}

/// A component bundle for "light" entities
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/pbr.rs)
#[derive(Debug, Bundle, Default)]
pub struct PointLightBundle {
pub point_light: PointLight,
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_pbr/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ impl DirectionalLightUniform {
}

// Ambient light color.
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/load_gltf.rs)
#[derive(Debug)]
pub struct AmbientLight {
pub color: Color,
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use bevy_render::{color::Color, renderer::RenderResources, shader::ShaderDefs, t

/// A material with "standard" properties used in PBR lighting
/// Standard property values with pictures here https://google.github.io/filament/Material%20Properties.pdf
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/texture.rs)
#[derive(Debug, RenderResources, ShaderDefs, TypeUuid)]
#[uuid = "dace545e-4bc6-4595-a79d-c224fc694975"]
pub struct StandardMaterial {
Expand Down
6 changes: 6 additions & 0 deletions crates/bevy_render/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use bevy_ecs::bundle::Bundle;
use bevy_transform::components::{GlobalTransform, Transform};

/// A component bundle for "mesh" entities
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/shader/array_texture.rs)
#[derive(Bundle, Default)]
pub struct MeshBundle {
pub mesh: Handle<Mesh>,
Expand All @@ -28,6 +29,7 @@ pub struct MeshBundle {
/// Component bundle for camera entities with perspective projection
///
/// Use this for 3D rendering.
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/3d_scene.rs)
#[derive(Bundle)]
pub struct PerspectiveCameraBundle {
pub camera: Camera,
Expand Down Expand Up @@ -74,6 +76,8 @@ impl Default for PerspectiveCameraBundle {
/// Component bundle for camera entities with orthographic projection
///
/// Use this for 2D games, isometric games, CAD-like 3D views.
/// [Example usage in 2D.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/orthographic.rs)
/// [Example usage in 3D.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/orthographic.rs)
#[derive(Bundle)]
pub struct OrthographicCameraBundle {
pub camera: Camera,
Expand All @@ -84,6 +88,7 @@ pub struct OrthographicCameraBundle {
}

impl OrthographicCameraBundle {
/// [Example usage](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite.rs)
pub fn new_2d() -> Self {
// we want 0 to be "closest" and +far to be "farthest" in 2d, so we offset
// the camera's translation by far and use a right handed coordinate system
Expand All @@ -104,6 +109,7 @@ impl OrthographicCameraBundle {
}
}

/// [Example usage](https://github.com/bevyengine/bevy/blob/latest/examples/3d/orthographic.rs)
pub fn new_3d() -> Self {
OrthographicCameraBundle {
camera: Camera {
Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_render/src/render_graph/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ use bevy_reflect::Reflect;
use bevy_window::WindowId;

/// A component that indicates that an entity should be drawn in the "main pass"
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/window/multiple_windows.rs)
#[derive(Clone, Debug, Default, Reflect)]
#[reflect(Component)]
pub struct MainPass;

/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/msaa.rs)
#[derive(Debug)]
pub struct Msaa {
pub samples: u32,
Expand All @@ -31,6 +33,7 @@ impl Default for Msaa {
}

impl Msaa {
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/window/multiple_windows.rs)
pub fn color_attachment(
&self,
attachment: TextureAttachment,
Expand Down

0 comments on commit a712071

Please sign in to comment.