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

Add components for opening / closing doors and door behavior preview #139

Closed
wants to merge 8 commits into from

Conversation

luca-della-vedova
Copy link
Member

New feature implementation

Implemented feature

This PR builds on top of #138 and closes #76. The door behavior is currently more of a "teleport to destination" rather than smoothly open or close but doors can be commanded and their states read.

Screencast.from.2023-06-23.15-36-37.webm

Implementation description

To avoid dependency on physics engines the transforms for door opening / closing are currently done manually.
A DoorComand and DoorState component have been added, they are mostly the same but while DoorCommand is only Open or Close, DoorState has an additional Moving variant.
Since doors effectively teleport right now this state is never reached, however all the infrastructure is in place to populate that once a door's transform is detected to be neither fully open nor fully closed.
There are some TODOs in place for better system ordering, had to hack around to avoid off-by-one-frame glitches, however since we will need to pretty much rewrite our whole state / system pipeline when migrating to bevy 0.10+ I didn't put too much effort into creating new stages and setting them up.
Ideally there would be a new Simulate stage separate from the others so animation systems don't conflict with other update systems (i.e. a system that opens a door + a system that moves the door because its anchors' positions changed).

I have a feeling the preview model should not live in interaction anymore and each site module should manage its own preview, but I didn't do the refactor here to avoid making the diff explode with physical camera preview changes.

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova luca-della-vedova marked this pull request as ready for review June 26, 2023 03:39
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova luca-della-vedova linked an issue Jul 17, 2023 that may be closed by this pull request
3 tasks
@luca-della-vedova
Copy link
Member Author

Closing for now, this might be implemented following a different architecture / pattern.

@luca-della-vedova luca-della-vedova deleted the luca/door_live_preview branch August 31, 2023 02:48
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

Successfully merging this pull request may close these issues.

Better door displays
1 participant