pub struct PlaneMeshBuilder {
pub plane: Plane3d,
pub subdivisions: u32,
}Fields§
§plane: Plane3dThe Plane3d shape.
subdivisions: u32The number of subdivisions in the mesh.
0 - is the original plane geometry, the 4 points in the XZ plane.
1 - is split by 1 line in the middle of the plane on both the X axis and the Z axis, resulting in a plane with 4 quads / 8 triangles.
2 - is a plane split by 2 lines on both the X and Z axes, subdividing the plane into 3 equal sections along each axis, resulting in a plane with 9 quads / 18 triangles.
and so on…
Implementations§
Source§impl PlaneMeshBuilder
impl PlaneMeshBuilder
Sourcepub fn new(normal: Dir3, size: Vec2) -> PlaneMeshBuilder
pub fn new(normal: Dir3, size: Vec2) -> PlaneMeshBuilder
Creates a new PlaneMeshBuilder from a given normal and size.
Sourcepub fn from_size(size: Vec2) -> PlaneMeshBuilder
pub fn from_size(size: Vec2) -> PlaneMeshBuilder
Creates a new PlaneMeshBuilder from the given size, with the normal pointing upwards.
Sourcepub fn from_length(length: f32) -> PlaneMeshBuilder
pub fn from_length(length: f32) -> PlaneMeshBuilder
Creates a new PlaneMeshBuilder from the given length, with the normal pointing upwards,
and the resulting PlaneMeshBuilder being a square.
Sourcepub fn normal(self, normal: Dir3) -> PlaneMeshBuilder
pub fn normal(self, normal: Dir3) -> PlaneMeshBuilder
Sets the normal of the plane, aka the direction the plane is facing.
Examples found in repository?
28fn setup_environment(
29 mut commands: Commands,
30 mut mesh_assets: ResMut<Assets<Mesh>>,
31 mut material_assets: ResMut<Assets<StandardMaterial>>,
32) {
33 let description = "(left to right)\n\
34 0: Normal skinned mesh.\n\
35 1: Mesh asset is missing skinning attributes.\n\
36 2: One joint entity is missing.\n\
37 3: Mesh entity is missing SkinnedMesh component.";
38
39 commands.spawn((
40 Text::new(description),
41 Node {
42 position_type: PositionType::Absolute,
43 top: px(12),
44 left: px(12),
45 ..default()
46 },
47 ));
48
49 commands.spawn((
50 Camera3d::default(),
51 Transform::from_xyz(0.0, 0.0, 1.0).looking_at(Vec3::new(0.0, 0.0, 0.0), Vec3::Y),
52 Projection::Orthographic(OrthographicProjection {
53 scaling_mode: ScalingMode::AutoMin {
54 min_width: 19.0,
55 min_height: 6.0,
56 },
57 ..OrthographicProjection::default_3d()
58 }),
59 // Add motion blur so we can check if it's working for skinned meshes.
60 // This also exercises the renderer's prepass path.
61 MotionBlur {
62 // Use an unrealistically large shutter angle so that motion blur is clearly visible.
63 shutter_angle: 3.0,
64 samples: 2,
65 },
66 // MSAA and MotionBlur together are not compatible on WebGL.
67 #[cfg(all(feature = "webgl2", target_arch = "wasm32", not(feature = "webgpu")))]
68 Msaa::Off,
69 ));
70
71 // Add a directional light to make sure we exercise the renderer's shadow path.
72 commands.spawn((
73 Transform::from_xyz(1.0, 1.0, 3.0).looking_at(Vec3::ZERO, Vec3::Y),
74 DirectionalLight {
75 shadows_enabled: true,
76 ..default()
77 },
78 ));
79
80 // Add a plane behind the meshes so we can see the shadows.
81 commands.spawn((
82 Transform::from_xyz(0.0, 0.0, -1.0),
83 Mesh3d(mesh_assets.add(Plane3d::default().mesh().size(100.0, 100.0).normal(Dir3::Z))),
84 MeshMaterial3d(material_assets.add(StandardMaterial {
85 base_color: Color::srgb(0.05, 0.05, 0.15),
86 reflectance: 0.2,
87 ..default()
88 })),
89 ));
90}
91
92fn setup_meshes(
93 mut commands: Commands,
94 mut mesh_assets: ResMut<Assets<Mesh>>,
95 mut material_assets: ResMut<Assets<StandardMaterial>>,
96 mut inverse_bindposes_assets: ResMut<Assets<SkinnedMeshInverseBindposes>>,
97) {
98 // Create a mesh with two rectangles.
99 let unskinned_mesh = Mesh::new(
100 PrimitiveTopology::TriangleList,
101 RenderAssetUsages::default(),
102 )
103 .with_inserted_attribute(
104 Mesh::ATTRIBUTE_POSITION,
105 vec![
106 [-0.3, -0.3, 0.0],
107 [0.3, -0.3, 0.0],
108 [-0.3, 0.3, 0.0],
109 [0.3, 0.3, 0.0],
110 [-0.4, 0.8, 0.0],
111 [0.4, 0.8, 0.0],
112 [-0.4, 1.8, 0.0],
113 [0.4, 1.8, 0.0],
114 ],
115 )
116 .with_inserted_attribute(Mesh::ATTRIBUTE_NORMAL, vec![[0.0, 0.0, 1.0]; 8])
117 .with_inserted_indices(Indices::U16(vec![0, 1, 3, 0, 3, 2, 4, 5, 7, 4, 7, 6]));
118
119 // Copy the mesh and add skinning attributes that bind each rectangle to a joint.
120 let skinned_mesh = unskinned_mesh
121 .clone()
122 .with_inserted_attribute(
123 Mesh::ATTRIBUTE_JOINT_INDEX,
124 VertexAttributeValues::Uint16x4(vec![
125 [0, 0, 0, 0],
126 [0, 0, 0, 0],
127 [0, 0, 0, 0],
128 [0, 0, 0, 0],
129 [1, 0, 0, 0],
130 [1, 0, 0, 0],
131 [1, 0, 0, 0],
132 [1, 0, 0, 0],
133 ]),
134 )
135 .with_inserted_attribute(
136 Mesh::ATTRIBUTE_JOINT_WEIGHT,
137 vec![[1.00, 0.00, 0.0, 0.0]; 8],
138 );
139
140 let unskinned_mesh_handle = mesh_assets.add(unskinned_mesh);
141 let skinned_mesh_handle = mesh_assets.add(skinned_mesh);
142
143 let inverse_bindposes_handle = inverse_bindposes_assets.add(vec![
144 Mat4::IDENTITY,
145 Mat4::from_translation(Vec3::new(0.0, -1.3, 0.0)),
146 ]);
147
148 let mesh_material_handle = material_assets.add(StandardMaterial::default());
149
150 let background_material_handle = material_assets.add(StandardMaterial {
151 base_color: Color::srgb(0.05, 0.15, 0.05),
152 reflectance: 0.2,
153 ..default()
154 });
155
156 #[derive(PartialEq)]
157 enum Variation {
158 Normal,
159 MissingMeshAttributes,
160 MissingJointEntity,
161 MissingSkinnedMeshComponent,
162 }
163
164 for (index, variation) in [
165 Variation::Normal,
166 Variation::MissingMeshAttributes,
167 Variation::MissingJointEntity,
168 Variation::MissingSkinnedMeshComponent,
169 ]
170 .into_iter()
171 .enumerate()
172 {
173 // Skip variations that are currently broken. See https://github.com/bevyengine/bevy/issues/16929,
174 // https://github.com/bevyengine/bevy/pull/18074.
175 if (variation == Variation::MissingSkinnedMeshComponent)
176 || (variation == Variation::MissingMeshAttributes)
177 {
178 continue;
179 }
180
181 let transform = Transform::from_xyz(((index as f32) - 1.5) * 4.5, 0.0, 0.0);
182
183 let joint_0 = commands.spawn(transform).id();
184
185 let joint_1 = commands
186 .spawn((ChildOf(joint_0), AnimatedJoint, Transform::IDENTITY))
187 .id();
188
189 if variation == Variation::MissingJointEntity {
190 commands.entity(joint_1).despawn();
191 }
192
193 let mesh_handle = match variation {
194 Variation::MissingMeshAttributes => &unskinned_mesh_handle,
195 _ => &skinned_mesh_handle,
196 };
197
198 let mut entity_commands = commands.spawn((
199 Mesh3d(mesh_handle.clone()),
200 MeshMaterial3d(mesh_material_handle.clone()),
201 transform,
202 ));
203
204 if variation != Variation::MissingSkinnedMeshComponent {
205 entity_commands.insert(SkinnedMesh {
206 inverse_bindposes: inverse_bindposes_handle.clone(),
207 joints: vec![joint_0, joint_1],
208 });
209 }
210
211 // Add a square behind the mesh to distinguish it from the other meshes.
212 commands.spawn((
213 Transform::from_xyz(transform.translation.x, transform.translation.y, -0.8),
214 Mesh3d(mesh_assets.add(Plane3d::default().mesh().size(4.3, 4.3).normal(Dir3::Z))),
215 MeshMaterial3d(background_material_handle.clone()),
216 ));
217 }
218}Sourcepub fn size(self, width: f32, height: f32) -> PlaneMeshBuilder
pub fn size(self, width: f32, height: f32) -> PlaneMeshBuilder
Sets the size of the plane mesh.
Examples found in repository?
45fn setup(
46 mut commands: Commands,
47 mut meshes: ResMut<Assets<Mesh>>,
48 mut materials: ResMut<Assets<StandardMaterial>>,
49) {
50 // plane
51 commands.spawn((
52 Mesh3d(meshes.add(Plane3d::default().mesh().size(20., 20.))),
53 MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
54 Ground,
55 ));
56
57 // light
58 commands.spawn((
59 DirectionalLight::default(),
60 Transform::from_translation(Vec3::ONE).looking_at(Vec3::ZERO, Vec3::Y),
61 ));
62
63 // camera
64 commands.spawn((
65 Camera3d::default(),
66 Transform::from_xyz(15.0, 5.0, 15.0).looking_at(Vec3::ZERO, Vec3::Y),
67 ));
68}More examples
185fn setup_scene(
186 mut commands: Commands,
187 mut meshes: ResMut<Assets<Mesh>>,
188 mut materials: ResMut<Assets<StandardMaterial>>,
189) {
190 // Camera
191 commands.spawn((
192 Camera3d::default(),
193 Transform::from_xyz(10.0, 10.0, 15.0).looking_at(Vec3::new(0.0, 0.0, 0.0), Vec3::Y),
194 ));
195
196 // Light
197 commands.spawn((
198 DirectionalLight {
199 shadows_enabled: true,
200 ..default()
201 },
202 Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, 1.0, -PI / 4.)),
203 ));
204
205 // Plane
206 commands.spawn((
207 Mesh3d(meshes.add(Plane3d::default().mesh().size(50000.0, 50000.0))),
208 MeshMaterial3d(materials.add(Color::srgb(0.7, 0.2, 0.2))),
209 Loading,
210 ));
211}
212
213// A run condition for all assets being loaded.
214fn assets_loaded(barrier: Option<Res<AssetBarrier>>) -> bool {
215 // If our barrier isn't ready, return early and wait another cycle
216 barrier.map(|b| b.is_ready()) == Some(true)
217}
218
219// This showcases how to wait for assets using sync code and systems.
220//
221// This function only runs if `assets_loaded` returns true.
222fn wait_on_load(
223 mut commands: Commands,
224 foxes: Res<OneHundredThings>,
225 gltfs: Res<Assets<Gltf>>,
226 mut meshes: ResMut<Assets<Mesh>>,
227 mut materials: ResMut<Assets<StandardMaterial>>,
228) {
229 // Change color of plane to green
230 commands.spawn((
231 Mesh3d(meshes.add(Plane3d::default().mesh().size(50000.0, 50000.0))),
232 MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
233 Transform::from_translation(Vec3::Z * -0.01),
234 ));
235
236 // Spawn our scenes.
237 for i in 0..10 {
238 for j in 0..10 {
239 let index = i * 10 + j;
240 let position = Vec3::new(i as f32 - 5.0, 0.0, j as f32 - 5.0);
241 // All gltfs must exist because this is guarded by the `AssetBarrier`.
242 let gltf = gltfs.get(&foxes.0[index]).unwrap();
243 let scene = gltf.scenes.first().unwrap().clone();
244 commands.spawn((SceneRoot(scene), Transform::from_translation(position)));
245 }
246 }
247}30fn setup_3d(
31 mut commands: Commands,
32 mut meshes: ResMut<Assets<Mesh>>,
33 mut materials: ResMut<Assets<StandardMaterial>>,
34) {
35 // plane
36 commands.spawn((
37 Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
38 MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
39 ));
40 // cube
41 commands.spawn((
42 Mesh3d(meshes.add(Cuboid::default())),
43 MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
44 Transform::from_xyz(0.0, 0.5, 0.0),
45 ));
46 // light
47 commands.spawn((
48 PointLight {
49 shadows_enabled: true,
50 ..default()
51 },
52 Transform::from_xyz(4.0, 8.0, 4.0),
53 ));
54 // camera
55 commands.spawn((
56 Camera3d::default(),
57 Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
58 ));
59}106fn setup_3d(
107 mut commands: Commands,
108 mut meshes: ResMut<Assets<Mesh>>,
109 mut materials: ResMut<Assets<StandardMaterial>>,
110) {
111 // plane
112 commands.spawn((
113 Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
114 MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
115 ));
116 // cube
117 commands.spawn((
118 Mesh3d(meshes.add(Cuboid::default())),
119 MeshMaterial3d(materials.add(Color::srgb(0.8, 0.7, 0.6))),
120 Transform::from_xyz(0.0, 0.5, 0.0),
121 ));
122 // light
123 commands.spawn((
124 PointLight {
125 shadows_enabled: true,
126 ..default()
127 },
128 Transform::from_xyz(4.0, 8.0, 4.0),
129 ));
130 // camera
131 commands.spawn((
132 Camera3d::default(),
133 Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
134 ));
135}98fn setup_camera_and_environment(
99 mut commands: Commands,
100 mut meshes: ResMut<Assets<Mesh>>,
101 mut materials: ResMut<Assets<StandardMaterial>>,
102) {
103 // Camera
104 commands.spawn((
105 Camera3d::default(),
106 Transform::from_xyz(100.0, 100.0, 150.0).looking_at(Vec3::new(0.0, 20.0, 0.0), Vec3::Y),
107 ));
108
109 // Plane
110 commands.spawn((
111 Mesh3d(meshes.add(Plane3d::default().mesh().size(500000.0, 500000.0))),
112 MeshMaterial3d(materials.add(Color::srgb(0.3, 0.5, 0.3))),
113 ));
114
115 // Light
116 commands.spawn((
117 Transform::from_rotation(Quat::from_euler(EulerRot::ZYX, 0.0, 1.0, -PI / 4.)),
118 DirectionalLight {
119 shadows_enabled: true,
120 ..default()
121 },
122 CascadeShadowConfigBuilder {
123 first_cascade_far_bound: 200.0,
124 maximum_distance: 400.0,
125 ..default()
126 }
127 .build(),
128 ));
129}21fn setup(
22 mut commands: Commands,
23 asset_server: Res<AssetServer>,
24 mut meshes: ResMut<Assets<Mesh>>,
25 mut custom_materials: ResMut<Assets<CustomMaterial>>,
26 mut standard_materials: ResMut<Assets<StandardMaterial>>,
27) {
28 commands.spawn((
29 Mesh3d(meshes.add(Plane3d::default().mesh().size(5.0, 5.0))),
30 MeshMaterial3d(standard_materials.add(Color::srgb(0.3, 0.5, 0.3))),
31 ));
32 commands.spawn((PointLight::default(), Transform::from_xyz(4.0, 8.0, 4.0)));
33
34 commands.spawn((
35 Mesh3d(meshes.add(Cuboid::default())),
36 MeshMaterial3d(custom_materials.add(CustomMaterial {
37 texture: asset_server.load(
38 "models/FlightHelmet/FlightHelmet_Materials_LensesMat_OcclusionRoughMetal.png",
39 ),
40 })),
41 Transform::from_xyz(0.0, 0.5, 0.0),
42 ));
43
44 // camera
45 commands.spawn((
46 Camera3d::default(),
47 Transform::from_xyz(4.0, 2.5, 4.0).looking_at(Vec3::ZERO, Vec3::Y),
48 MainCamera,
49 ));
50}- examples/camera/camera_orbit.rs
- examples/window/screenshot.rs
- examples/3d/two_passes.rs
- examples/movement/smooth_follow.rs
- examples/3d/vertex_colors.rs
- examples/3d/orthographic.rs
- examples/3d/spherical_area_lights.rs
- examples/gizmos/axes.rs
- examples/animation/animated_mesh_events.rs
- examples/animation/eased_motion.rs
- examples/3d/wireframe.rs
- examples/ecs/error_handling.rs
- examples/camera/projection_zoom.rs
- examples/3d/visibility_range.rs
- examples/animation/animated_mesh_control.rs
- examples/testbed/3d.rs
- tests/3d/test_invalid_skinned_mesh.rs
- examples/3d/shadow_caster_receiver.rs
- examples/3d/anti_aliasing.rs
- examples/gizmos/3d_gizmos.rs
- examples/transforms/align.rs
- examples/math/random_sampling.rs
- examples/3d/transparency_3d.rs
- examples/3d/meshlet.rs
- examples/3d/spotlight.rs
- examples/3d/3d_shapes.rs
- examples/stress_tests/many_cubes.rs
- examples/shader/shader_prepass.rs
- examples/3d/shadow_biases.rs
- examples/3d/split_screen.rs
- examples/picking/mesh_picking.rs
- examples/stress_tests/many_foxes.rs
- examples/math/sampling_primitives.rs
- examples/3d/parallax_mapping.rs
- examples/3d/deferred_rendering.rs
- examples/3d/blend_modes.rs
- examples/3d/lighting.rs
- examples/3d/camera_sub_view.rs
- examples/3d/transmission.rs
Sourcepub fn subdivisions(self, subdivisions: u32) -> PlaneMeshBuilder
pub fn subdivisions(self, subdivisions: u32) -> PlaneMeshBuilder
Sets the subdivisions of the plane mesh.
0 - is the original plane geometry, the 4 points in the XZ plane.
1 - is split by 1 line in the middle of the plane on both the X axis and the Z axis, resulting in a plane with 4 quads / 8 triangles.
2 - is a plane split by 2 lines on both the X and Z axes, subdividing the plane into 3 equal sections along each axis, resulting in a plane with 9 quads / 18 triangles.
Examples found in repository?
54fn setup(
55 mut commands: Commands,
56 mut meshes: ResMut<Assets<Mesh>>,
57 mut images: ResMut<Assets<Image>>,
58 mut materials: ResMut<Assets<StandardMaterial>>,
59) {
60 let debug_material = materials.add(StandardMaterial {
61 base_color_texture: Some(images.add(uv_debug_texture())),
62 ..default()
63 });
64
65 let shapes = [
66 meshes.add(Cuboid::default()),
67 meshes.add(Tetrahedron::default()),
68 meshes.add(Capsule3d::default()),
69 meshes.add(Torus::default()),
70 meshes.add(Cylinder::default()),
71 meshes.add(Cone::default()),
72 meshes.add(ConicalFrustum::default()),
73 meshes.add(Sphere::default().mesh().ico(5).unwrap()),
74 meshes.add(Sphere::default().mesh().uv(32, 18)),
75 meshes.add(Segment3d::default()),
76 meshes.add(Polyline3d::new(vec![
77 Vec3::new(-0.5, 0.0, 0.0),
78 Vec3::new(0.5, 0.0, 0.0),
79 Vec3::new(0.0, 0.5, 0.0),
80 ])),
81 ];
82
83 let extrusions = [
84 meshes.add(Extrusion::new(Rectangle::default(), 1.)),
85 meshes.add(Extrusion::new(Capsule2d::default(), 1.)),
86 meshes.add(Extrusion::new(Annulus::default(), 1.)),
87 meshes.add(Extrusion::new(Circle::default(), 1.)),
88 meshes.add(Extrusion::new(Ellipse::default(), 1.)),
89 meshes.add(Extrusion::new(RegularPolygon::default(), 1.)),
90 meshes.add(Extrusion::new(Triangle2d::default(), 1.)),
91 ];
92
93 let num_shapes = shapes.len();
94
95 for (i, shape) in shapes.into_iter().enumerate() {
96 commands.spawn((
97 Mesh3d(shape),
98 MeshMaterial3d(debug_material.clone()),
99 Transform::from_xyz(
100 -SHAPES_X_EXTENT / 2. + i as f32 / (num_shapes - 1) as f32 * SHAPES_X_EXTENT,
101 2.0,
102 Z_EXTENT / 2.,
103 )
104 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
105 Shape,
106 ));
107 }
108
109 let num_extrusions = extrusions.len();
110
111 for (i, shape) in extrusions.into_iter().enumerate() {
112 commands.spawn((
113 Mesh3d(shape),
114 MeshMaterial3d(debug_material.clone()),
115 Transform::from_xyz(
116 -EXTRUSION_X_EXTENT / 2.
117 + i as f32 / (num_extrusions - 1) as f32 * EXTRUSION_X_EXTENT,
118 2.0,
119 -Z_EXTENT / 2.,
120 )
121 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
122 Shape,
123 ));
124 }
125
126 commands.spawn((
127 PointLight {
128 shadows_enabled: true,
129 intensity: 10_000_000.,
130 range: 100.0,
131 shadow_depth_bias: 0.2,
132 ..default()
133 },
134 Transform::from_xyz(8.0, 16.0, 8.0),
135 ));
136
137 // ground plane
138 commands.spawn((
139 Mesh3d(meshes.add(Plane3d::default().mesh().size(50.0, 50.0).subdivisions(10))),
140 MeshMaterial3d(materials.add(Color::from(SILVER))),
141 ));
142
143 commands.spawn((
144 Camera3d::default(),
145 Transform::from_xyz(0.0, 7., 14.0).looking_at(Vec3::new(0., 1., 0.), Vec3::Y),
146 ));
147
148 #[cfg(not(target_arch = "wasm32"))]
149 commands.spawn((
150 Text::new("Press space to toggle wireframes"),
151 Node {
152 position_type: PositionType::Absolute,
153 top: px(12),
154 left: px(12),
155 ..default()
156 },
157 ));
158}More examples
43fn setup_scene(
44 mut commands: Commands,
45 mut meshes: ResMut<Assets<Mesh>>,
46 mut materials: ResMut<Assets<StandardMaterial>>,
47) {
48 // Set up the materials.
49 let white_matl = materials.add(Color::WHITE);
50 let ground_matl = materials.add(Color::from(GRAY_300));
51 let hover_matl = materials.add(Color::from(CYAN_300));
52 let pressed_matl = materials.add(Color::from(YELLOW_300));
53
54 let shapes = [
55 meshes.add(Cuboid::default()),
56 meshes.add(Tetrahedron::default()),
57 meshes.add(Capsule3d::default()),
58 meshes.add(Torus::default()),
59 meshes.add(Cylinder::default()),
60 meshes.add(Cone::default()),
61 meshes.add(ConicalFrustum::default()),
62 meshes.add(Sphere::default().mesh().ico(5).unwrap()),
63 meshes.add(Sphere::default().mesh().uv(32, 18)),
64 ];
65
66 let extrusions = [
67 meshes.add(Extrusion::new(Rectangle::default(), 1.)),
68 meshes.add(Extrusion::new(Capsule2d::default(), 1.)),
69 meshes.add(Extrusion::new(Annulus::default(), 1.)),
70 meshes.add(Extrusion::new(Circle::default(), 1.)),
71 meshes.add(Extrusion::new(Ellipse::default(), 1.)),
72 meshes.add(Extrusion::new(RegularPolygon::default(), 1.)),
73 meshes.add(Extrusion::new(Triangle2d::default(), 1.)),
74 ];
75
76 let num_shapes = shapes.len();
77
78 // Spawn the shapes. The meshes will be pickable by default.
79 for (i, shape) in shapes.into_iter().enumerate() {
80 commands
81 .spawn((
82 Mesh3d(shape),
83 MeshMaterial3d(white_matl.clone()),
84 Transform::from_xyz(
85 -SHAPES_X_EXTENT / 2. + i as f32 / (num_shapes - 1) as f32 * SHAPES_X_EXTENT,
86 2.0,
87 Z_EXTENT / 2.,
88 )
89 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
90 Shape,
91 ))
92 .observe(update_material_on::<Pointer<Over>>(hover_matl.clone()))
93 .observe(update_material_on::<Pointer<Out>>(white_matl.clone()))
94 .observe(update_material_on::<Pointer<Press>>(pressed_matl.clone()))
95 .observe(update_material_on::<Pointer<Release>>(hover_matl.clone()))
96 .observe(rotate_on_drag);
97 }
98
99 let num_extrusions = extrusions.len();
100
101 for (i, shape) in extrusions.into_iter().enumerate() {
102 commands
103 .spawn((
104 Mesh3d(shape),
105 MeshMaterial3d(white_matl.clone()),
106 Transform::from_xyz(
107 -EXTRUSION_X_EXTENT / 2.
108 + i as f32 / (num_extrusions - 1) as f32 * EXTRUSION_X_EXTENT,
109 2.0,
110 -Z_EXTENT / 2.,
111 )
112 .with_rotation(Quat::from_rotation_x(-PI / 4.)),
113 Shape,
114 ))
115 .observe(update_material_on::<Pointer<Over>>(hover_matl.clone()))
116 .observe(update_material_on::<Pointer<Out>>(white_matl.clone()))
117 .observe(update_material_on::<Pointer<Press>>(pressed_matl.clone()))
118 .observe(update_material_on::<Pointer<Release>>(hover_matl.clone()))
119 .observe(rotate_on_drag);
120 }
121
122 // Ground
123 commands.spawn((
124 Mesh3d(meshes.add(Plane3d::default().mesh().size(50.0, 50.0).subdivisions(10))),
125 MeshMaterial3d(ground_matl.clone()),
126 Pickable::IGNORE, // Disable picking for the ground plane.
127 ));
128
129 // Light
130 commands.spawn((
131 PointLight {
132 shadows_enabled: true,
133 intensity: 10_000_000.,
134 range: 100.0,
135 shadow_depth_bias: 0.2,
136 ..default()
137 },
138 Transform::from_xyz(8.0, 16.0, 8.0),
139 ));
140
141 // Camera
142 commands.spawn((
143 Camera3d::default(),
144 Transform::from_xyz(0.0, 7., 14.0).looking_at(Vec3::new(0., 1., 0.), Vec3::Y),
145 ));
146
147 // Instructions
148 commands.spawn((
149 Text::new("Hover over the shapes to pick them\nDrag to rotate"),
150 Node {
151 position_type: PositionType::Absolute,
152 top: px(12),
153 left: px(12),
154 ..default()
155 },
156 ));
157}Trait Implementations§
Source§impl Clone for PlaneMeshBuilder
impl Clone for PlaneMeshBuilder
Source§fn clone(&self) -> PlaneMeshBuilder
fn clone(&self) -> PlaneMeshBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlaneMeshBuilder
impl Debug for PlaneMeshBuilder
Source§impl Default for PlaneMeshBuilder
impl Default for PlaneMeshBuilder
Source§fn default() -> PlaneMeshBuilder
fn default() -> PlaneMeshBuilder
Source§impl FromArg for PlaneMeshBuilder
impl FromArg for PlaneMeshBuilder
Source§impl FromReflect for PlaneMeshBuilder
impl FromReflect for PlaneMeshBuilder
Source§fn from_reflect(
reflect: &(dyn PartialReflect + 'static),
) -> Option<PlaneMeshBuilder>
fn from_reflect( reflect: &(dyn PartialReflect + 'static), ) -> Option<PlaneMeshBuilder>
Self from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self using,
constructing the value using from_reflect if that fails. Read moreSource§impl GetOwnership for PlaneMeshBuilder
impl GetOwnership for PlaneMeshBuilder
Source§impl GetTypeRegistration for PlaneMeshBuilder
impl GetTypeRegistration for PlaneMeshBuilder
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl IntoReturn for PlaneMeshBuilder
impl IntoReturn for PlaneMeshBuilder
Source§fn into_return<'into_return>(self) -> Return<'into_return>where
PlaneMeshBuilder: 'into_return,
fn into_return<'into_return>(self) -> Return<'into_return>where
PlaneMeshBuilder: 'into_return,
Source§impl MeshBuilder for PlaneMeshBuilder
impl MeshBuilder for PlaneMeshBuilder
Source§impl PartialReflect for PlaneMeshBuilder
impl PartialReflect for PlaneMeshBuilder
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn try_apply(
&mut self,
value: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<PlaneMeshBuilder>) -> ReflectOwned
fn reflect_owned(self: Box<PlaneMeshBuilder>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<PlaneMeshBuilder>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<PlaneMeshBuilder>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
Source§fn into_partial_reflect(self: Box<PlaneMeshBuilder>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<PlaneMeshBuilder>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Source§fn reflect_partial_eq(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Self using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn to_dynamic(&self) -> Box<dyn PartialReflect>
fn to_dynamic(&self) -> Box<dyn PartialReflect>
Source§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails. Read moreSource§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Reflect for PlaneMeshBuilder
impl Reflect for PlaneMeshBuilder
Source§fn into_any(self: Box<PlaneMeshBuilder>) -> Box<dyn Any>
fn into_any(self: Box<PlaneMeshBuilder>) -> Box<dyn Any>
Box<dyn Any>. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<PlaneMeshBuilder>) -> Box<dyn Reflect>
fn into_reflect(self: Box<PlaneMeshBuilder>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
Source§impl Struct for PlaneMeshBuilder
impl Struct for PlaneMeshBuilder
Source§fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>
fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>
name as a &dyn PartialReflect.Source§fn field_mut(
&mut self,
name: &str,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_mut( &mut self, name: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>
name as a
&mut dyn PartialReflect.Source§fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
index as a
&dyn PartialReflect.Source§fn field_at_mut(
&mut self,
index: usize,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_at_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>
index
as a &mut dyn PartialReflect.Source§fn name_at(&self, index: usize) -> Option<&str>
fn name_at(&self, index: usize) -> Option<&str>
index.Source§fn iter_fields(&self) -> FieldIter<'_> ⓘ
fn iter_fields(&self) -> FieldIter<'_> ⓘ
Source§fn to_dynamic_struct(&self) -> DynamicStruct
fn to_dynamic_struct(&self) -> DynamicStruct
DynamicStruct from this struct.Source§fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
None if TypeInfo is not available.Source§impl TypePath for PlaneMeshBuilder
impl TypePath for PlaneMeshBuilder
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl Typed for PlaneMeshBuilder
impl Typed for PlaneMeshBuilder
impl Copy for PlaneMeshBuilder
Auto Trait Implementations§
impl Freeze for PlaneMeshBuilder
impl RefUnwindSafe for PlaneMeshBuilder
impl Send for PlaneMeshBuilder
impl Sync for PlaneMeshBuilder
impl Unpin for PlaneMeshBuilder
impl UnwindSafe for PlaneMeshBuilder
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.