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

Entity-specific gizmo configuration in bevy integration #56

Open
ThomasAlban opened this issue Apr 24, 2024 · 4 comments
Open

Entity-specific gizmo configuration in bevy integration #56

ThomasAlban opened this issue Apr 24, 2024 · 4 comments

Comments

@ThomasAlban
Copy link
Contributor

ThomasAlban commented Apr 24, 2024

Is there any way with the current system to configure certain GizmoTargets to not be editable in certain gizmo modes? For example, I want some entities to not be rotatable and some not scaleable (the gizmo would just do nothing to those entities' rotations/scales if edited in that mode).
I'm not exactly sure of the best way this could be implemented (unless it is already possible and I'm missing it!). Perhaps an optional GizmoTargetConfig component which contains properties such as use_rotation/use_scale. If the entity has both GizmoTarget and GizmoTargetConfig, the config options would be applied to that specific entity. This approach could be good, as it would open the door to potentially more entity-specific gizmo config options in the future.

@ThomasAlban
Copy link
Contributor Author

To clarify with an example: if an entity has use_rotation: false, then the gizmo does not affect the entity's rotation. If it has GizmoTarget as well as another entity with use_rotation: true, and both entities are rotated about the median point with the gizmo, then the entity with use_rotation: false would still move, but its rotation would not be affected.

@urholaukkarinen
Copy link
Owner

The current system does not support entity-specific configuration, but something like that GizmoTargetConfig could indeed work. In the meantime it could perhaps be implemented outside the gizmo plugin with a system that reverts any changes to scale, rotation or translation, depending on which of them are editable.

@ThomasAlban
Copy link
Contributor Author

ThomasAlban commented Apr 28, 2024

Yeah sounds good. Does the current underlying gizmo implementation support turning off certain axes e.g. for entities which should only be translated in the x and z axes (then the gizmo would only show the relevant arrows)? This would be another feature that would be nice to have in the entity-specific gizmo config if it was implemented!

@urholaukkarinen
Copy link
Owner

The current main version does not yet support that, but that is implemented in the more-modes branch: c7c8992
It allows you to mix and match the "sub-modes" however you like.

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