Expand description
Module for the drawing of Frustums.
Camera entities are spawned with a Frustum component,
which describes a camera’s field of vision. With this module,
a camera’s frustum can be drawn with gizmos. This is useful
for debugging what a camera can see and what entities in the scene
will be subject to the camera’s frustum culling, especially when
combined with drawing Aabb
gizmos.
There are two ways to enable gizmo drawing of a Frustum:
- The
ShowFrustumGizmocomponent can be added to individual camera entities.
fn setup(mut commands: Commands) {
commands.spawn((Camera2d, ShowFrustumGizmo::default()));
}- Setting the
FrustumGizmoConfigGroupconfiguration’sdraw_allfield totruewill draw every frustum. Note that this will include drawingbevy_lightSpotLightFrustums.
fn turn_on_frustum_gizmos(mut config: ResMut<GizmoConfigStore>) {
config.config_mut::<FrustumGizmoConfigGroup>().1.draw_all = true;
}Structs§
- Frustum
Gizmo Config Group - The
GizmoConfigGroupused for debug visualizations ofFrustumcomponents on entities - Frustum
Gizmo Plugin - A
Pluginthat provides visualization ofFrustums for debugging. - Frustum
Gizmo Systems - Frustum Gizmo system set. This exists in
PostUpdate. - Show
Frustum Gizmo - Add this
Componentto an entity to draw itsFrustumcomponent.