Skip to content
New issue

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

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

Already on GitHub? # to your account

Alternate sit mechanism #211

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Gigabyte5671
Copy link
Member

This PR rewrites the sit/animate interaction system. The new system utilises the metadata in GLTF models to create more detailed interaction targets that don't require meshes.

The GLTF metadata contains the following properties:

Property Value Example Description
vircadia_sit_[n]_position "0,0,0" The position of the target, and the position the avatar will snap to when interacting.
vircadia_sit_[n]_rotation "0,0,0" The rotation the avatar will snap to when interacting.
vircadia_sit_[n]_exit_position "0,0,0" The position the avatar will snap to when the interaction has finished.
vircadia_sit_[n]_text "Hello World" The text to display on the label.
vircadia_sit_[n]_icon "chair" An icon to display on the label. Overwrites the text property.
vircadia_sit_[n]_color "#ff0000" The color of the label.
vircadia_sit_[n]_label_distance 2 The distance at which the label should become visible to the avatar.
vircadia_sit_[n]_animation "sit_default" The avatar animation the interaction should trigger.

The new system is also backwards-compatible with the old mesh-based system, so meshes with the name animate_... will still create interaction targets. One benefit of the old system is that - because interaction targets were attached to meshes - they themselves could be moved/animated. For example, attaching a target to the seat of a roller-coaster would pull the avatar along with the coaster. The new metadata-based system does not yet support this.

@Gigabyte5671 Gigabyte5671 added enhancement New feature or request in progress labels Nov 29, 2023
@Gigabyte5671
Copy link
Member Author

Note: It appears that the backwards-compatibility part isn't working at the moment.
@Aitolda You might be able to investigate this bug. The places to look are in InteractionController.ts line 303 onwards, and ModelComponent.ts line 75 onwards.

@Aitolda
Copy link

Aitolda commented Dec 2, 2023

Bugs/unfinished:

  1. icon color property appears to change both the icon AND the bubble color, so it's just a solid bubble, or maybe it's a transparency thing? Not sure how the icon is constructed.
  2. icons remain visible after sit is initialized
  3. Exit position doesn't appear to be working as intended. Behavior erratic and needs further examination
  4. Old sit system not working with the exception of ground sit. (icons appear as expected but user just ground sits)

Suggestions:

  1. We should add "chair" as the default icon if no icon is specified
  2. We should make the default icon color "#ffffff" (white) (currently black)
  3. Perhaps only 1 sit icon is visible at a time, perhaps whichever is closest to the avatar (videogames tend to do things like this to interactive objects to avoid confusion)

ExampleSit

@Aitolda
Copy link

Aitolda commented Dec 4, 2023

Might be out of scope atm moment, but if we add a property "vircadia_custom_animation" (or something like this) that let's us use an animation/action contained with the same GLB, this would allow for more personalization and creativity.

The contained animations could be almost identical to our current "AnimationsBasic.glb" system with a single armature included, and that armature having multiple "actions." (as many as the environment creator desires).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants