Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Way to Re-Initialize Debug Lines? #25

Closed
zicklag opened this issue Aug 11, 2022 · 5 comments
Closed

Provide a Way to Re-Initialize Debug Lines? #25

zicklag opened this issue Aug 11, 2022 · 5 comments

Comments

@zicklag
Copy link

zicklag commented Aug 11, 2022

I have a use-case where I want to reset my whole world. I do this by deleting all entities other than the Camera. The issue is that it also deletes the debug lines meshes.

I could filter out the debug lines meshes from my query for all entities to delete, but DebugLinesMesh is the only defining component, and it's not public.

Alternatively I could delete all entities and have a way to re-initialize debug lines, but the setup system is private, too.

@Toqozz
Copy link
Owner

Toqozz commented Aug 14, 2022

Hmm. This sounds logical and I'm happy to open up DebugLinesMesh, but how do you handle re-initializing the other bevy plugins like UiPlugin? Or maybe none of the other plugins spawn game objects?

@zicklag
Copy link
Author

zicklag commented Aug 14, 2022

So far I haven't seen any other plugins that spawn game objects.

I wonder if you could somehow stick those debug line meshes inside the render world, without sticking them in the game world?

I haven't looked deep enough into it to know, but I know there's like a separate Bevy world used by the render sub-app. I wonder if that could be utilized somehow.

@Toqozz
Copy link
Owner

Toqozz commented Aug 14, 2022

I've made DebugLinesMesh public in 0.8.1.

I think the real solution is supposed to be something with using different worlds, but I'm not really sure and it doesn't seem trivial. You can use RenderWorld, but it's cleared every frame and "only available during the extract stage" so doesn't seem like a good place for our mesh to live.

@zicklag
Copy link
Author

zicklag commented Aug 14, 2022

Sweet, thanks. 👍

@zicklag
Copy link
Author

zicklag commented Aug 14, 2022

Since I'm just curious about it, I might take a quick look at separate worlds if I get the chance.

@zicklag zicklag closed this as completed Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants