Skip to content

Commit 1271ae2

Browse files
committed
1 parent 4b6238d commit 1271ae2

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed

crates/bevy_math/src/geometry.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use glam::Vec2;
33
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
44

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

2829
/// A rect, as defined by its "side" locations
30+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/ui/ui.rs)
2931
#[derive(Copy, Clone, PartialEq, Debug, Reflect)]
3032
#[reflect(PartialEq)]
3133
pub struct Rect<T: Reflect + PartialEq> {

crates/bevy_pbr/src/entity.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use bevy_render::{
1111
use bevy_transform::prelude::{GlobalTransform, Transform};
1212

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

4344
/// A component bundle for "light" entities
45+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/pbr.rs)
4446
#[derive(Debug, Bundle, Default)]
4547
pub struct PointLightBundle {
4648
pub point_light: PointLight,

crates/bevy_pbr/src/light.rs

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl DirectionalLightUniform {
153153
}
154154

155155
// Ambient light color.
156+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/load_gltf.rs)
156157
#[derive(Debug)]
157158
pub struct AmbientLight {
158159
pub color: Color,

crates/bevy_pbr/src/material.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use bevy_render::{color::Color, renderer::RenderResources, shader::ShaderDefs, t
44

55
/// A material with "standard" properties used in PBR lighting
66
/// Standard property values with pictures here https://google.github.io/filament/Material%20Properties.pdf
7+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/texture.rs)
78
#[derive(Debug, RenderResources, ShaderDefs, TypeUuid)]
89
#[uuid = "dace545e-4bc6-4595-a79d-c224fc694975"]
910
pub struct StandardMaterial {

crates/bevy_render/src/entity.rs

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use bevy_ecs::bundle::Bundle;
1414
use bevy_transform::components::{GlobalTransform, Transform};
1515

1616
/// A component bundle for "mesh" entities
17+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/shader/array_texture.rs)
1718
#[derive(Bundle, Default)]
1819
pub struct MeshBundle {
1920
pub mesh: Handle<Mesh>,
@@ -28,6 +29,7 @@ pub struct MeshBundle {
2829
/// Component bundle for camera entities with perspective projection
2930
///
3031
/// Use this for 3D rendering.
32+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/3d_scene.rs)
3133
#[derive(Bundle)]
3234
pub struct PerspectiveCameraBundle {
3335
pub camera: Camera,
@@ -74,6 +76,8 @@ impl Default for PerspectiveCameraBundle {
7476
/// Component bundle for camera entities with orthographic projection
7577
///
7678
/// Use this for 2D games, isometric games, CAD-like 3D views.
79+
/// [Example usage in 2D.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/orthographic.rs)
80+
/// [Example usage in 3D.](https://github.com/bevyengine/bevy/blob/latest/examples/3d/orthographic.rs)
7781
#[derive(Bundle)]
7882
pub struct OrthographicCameraBundle {
7983
pub camera: Camera,
@@ -84,6 +88,7 @@ pub struct OrthographicCameraBundle {
8488
}
8589

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

112+
/// [Example usage](https://github.com/bevyengine/bevy/blob/latest/examples/3d/orthographic.rs)
107113
pub fn new_3d() -> Self {
108114
OrthographicCameraBundle {
109115
camera: Camera {

crates/bevy_render/src/render_graph/base.rs

+3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ use bevy_reflect::Reflect;
1515
use bevy_window::WindowId;
1616

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

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

3335
impl Msaa {
36+
/// [Example usage.](https://github.com/bevyengine/bevy/blob/latest/examples/window/multiple_windows.rs)
3437
pub fn color_attachment(
3538
&self,
3639
attachment: TextureAttachment,

0 commit comments

Comments
 (0)