bytestring-net / bevy_lunex

Blazingly fast path based retained layout engine for Bevy entities, built around vanilla Bevy ECS.
https://bytestring-net.github.io/bevy_lunex/
Apache License 2.0
512 stars 21 forks source link

can't use multiple cameras #7

Closed gamedevalice closed 3 months ago

gamedevalice commented 11 months ago

Using multiple cameras is quite common, for example with a HUD or minimap. Currently, this line panics when multiple cameras exist: https://github.com/bytestring-net/bevy-lunex/blob/672d977d793bd215f46bcbc44a8277b3c413d81f/crates/bevy_lunex_ui/src/code/cursor.rs#L64

Perhaps tag the expected camera with a LunexCamera component and add that to the query. So instead of this query:

cameras: Query<(&Camera, &Transform), Without<Cursor>>

you'd have this:

cameras: Query<(&Camera, &Transform, &LunexCamera), Without<Cursor>>
UkoeHB commented 11 months ago

Maybe we can tie the camera type to the cursor with an associated type like I do with interaction sources.

IDEDARY commented 11 months ago

The solution for cursor currently in place is just something that "works", but is also a placeholder for deeper, more thought out system, so I can focus on more hot problems. This would be patching something that will be changed in the future. Im very busy as of now, but if someone made PR i would gladly merge it for the reasons stated above. Otherwise feel free to comment any cursor changes you have in mind, we have a lot of work to do on that one 💯, so we need to brainstorm ideas and solutions (like camera rotation and 3D in general)

IDEDARY commented 3 months ago

From version 0.1.0 and forward multiple cameras are supported