Skip to content

Commit d042f8d

Browse files
authored
Make it possible to statically construct gizmo buffers (#22105)
# Objective - statically construct gizmo buffers for some shenanigans ## Solution - expose a const constructor ## Testing -
1 parent c342e25 commit d042f8d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/bevy_gizmos/src/gizmos.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ where
308308
Clear: 'static + Send + Sync,
309309
{
310310
fn default() -> Self {
311+
GizmoBuffer::new()
312+
}
313+
}
314+
315+
impl<Config, Clear> GizmoBuffer<Config, Clear>
316+
where
317+
Config: GizmoConfigGroup,
318+
Clear: 'static + Send + Sync,
319+
{
320+
/// Constructs an empty `GizmoBuffer`.
321+
pub const fn new() -> Self {
311322
GizmoBuffer {
312323
enabled: true,
313324
list_positions: Vec::new(),

0 commit comments

Comments
 (0)