Skip to content

Try to avoid calling queue_redraw in 2D ray and shape cast set_enabled methods#118207

Open
RyanVail wants to merge 1 commit into
godotengine:masterfrom
RyanVail:lazy-redraws
Open

Try to avoid calling queue_redraw in 2D ray and shape cast set_enabled methods#118207
RyanVail wants to merge 1 commit into
godotengine:masterfrom
RyanVail:lazy-redraws

Conversation

@RyanVail
Copy link
Copy Markdown
Contributor

@RyanVail RyanVail commented Apr 4, 2026

This commit tries to avoid calling queue_redraw, when possible, in the RayCast2D::set_enabled and ShapeCast2D::set_enabled methods so the redraw logic can be skipped.

Adds a fast path if set_enabled was called with the existing enabled value, meaning it has no effect.

Adds a check that only queues a redraw if collisions are being debugged because, based on what I can tell, ray casts and shape casts are only drawn when collisions are being debugged.

…thods

Adds a fast path if `set_enabled` was called with the existing `enabled`
value, meaning it has no effect.

Only queue a redraw if collisions are being debugged, so when debugging
is disabled the cost of the redraw logic can be skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants