-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 quack and duck to bitecs #6072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I just left a few of comments. Feel free to merge or address the feedback.
const obj = APP.world.eid2obj.get(eid); | ||
obj.position.copy(avatarPov.localToWorld(new THREE.Vector3(0, 0, -1.5))); | ||
obj.lookAt(avatarPov.getWorldPosition(new THREE.Vector3())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three lines and the avatarPov
line are repeated twice now. Feels like they should be a component down the line ("spawn-at-view").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, in most cases we use this for spawning media in front of the user:
https://github.com/mozilla/hubs/blob/a0e5eee06395c5cfeb604e03dab03e9a33077620/src/scene-entry-manager.js#L244
If we add a component for this we can also refactor those methods.
Does this preserve the reverse physics (floating) when the duck is scaled? |
Good catch! I wasn't aware of this easter egg feature and thought the physics were similar to the default I can add a flag on |
I modified the |
Thanks! Yeah, it's a bit hidden, but really fun and useful. There is a way with the old loader to have arbitrary GLBs behave as ducks, so we've been able to hack in flying/floating objects that way, e.g. Floating_Lantern.zip. So hopefully either that'll still work, or your suggestion of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea about this behavior 😅 LGTM!
This migrates duck and quack to bitecs and recreates what I believe was the original intended behavior:
I tried to keep everything as near to the original as possible since this is an early change for me. I added comments to the diffs for situations where this was awkward.
part of #5899