mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
Make world-grid plane double-sided
This commit is contained in:
@@ -59,18 +59,36 @@ fn spawn_scene(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Plane
|
// Plane
|
||||||
|
let plane = meshes.add(Mesh::from(shape::Plane {
|
||||||
|
size: 200.0,
|
||||||
|
subdivisions: 0,
|
||||||
|
}));
|
||||||
|
let proc_grid = mat_proc_grid.add(ProceduralGridMaterial {});
|
||||||
|
|
||||||
cmd.spawn((
|
cmd.spawn((
|
||||||
MaterialMeshBundle {
|
SpatialBundle::from_transform(Transform::IDENTITY),
|
||||||
mesh: meshes.add(Mesh::from(shape::Plane {
|
|
||||||
size: 200.0,
|
|
||||||
subdivisions: 0,
|
|
||||||
})),
|
|
||||||
material: mat_proc_grid.add(ProceduralGridMaterial {}),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
NotShadowCaster,
|
|
||||||
WorldGridPlane,
|
WorldGridPlane,
|
||||||
));
|
))
|
||||||
|
.with_children(|parent| {
|
||||||
|
parent.spawn((
|
||||||
|
MaterialMeshBundle {
|
||||||
|
mesh: plane.clone(),
|
||||||
|
material: proc_grid.clone(),
|
||||||
|
transform: Transform::IDENTITY,
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
NotShadowCaster,
|
||||||
|
));
|
||||||
|
parent.spawn((
|
||||||
|
MaterialMeshBundle {
|
||||||
|
mesh: plane,
|
||||||
|
material: proc_grid,
|
||||||
|
transform: Transform::IDENTITY.looking_to(Vec3::Z, Vec3::NEG_Y),
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
NotShadowCaster,
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn move_plane_with_camera(
|
fn move_plane_with_camera(
|
||||||
|
|||||||
Reference in New Issue
Block a user