-
Notifications
You must be signed in to change notification settings - Fork 19
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
smooth speed based mount animations #37
base: main
Are you sure you want to change the base?
Conversation
type_templates/glb.js
Outdated
action.play(); | ||
} | ||
if(action.weight < 1) { | ||
action.weight += (1 - Math.pow(smooth, speed)) / 2; |
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.
This is not frame time independent.
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 don't think the math on this is quite right or physically accurate, and it shows in the testing.
IMO it should be animation.weight = speed * factor
. I don't know if anything else is needed.
I also don't understand what the components are being used for in the hovercraft app: https://github.com/webaverse/hovercraft/pull/4/files#diff-fd0eb2318d432bd8f51a9d017045591e1e62e62a56c5c55f78c6b9b10ca2ad46R11
Or the dragon app: https://github.com/webaverse/dragon-mount/pull/2/files#diff-fd0eb2318d432bd8f51a9d017045591e1e62e62a56c5c55f78c6b9b10ca2ad46R10
That needs to be cleaned up and perfectly understood. Right now it just looks like more components are being thrown in and nobody understands how it's supposed to work (which means we can't even document it).
It is really hard to tell what I should set to make the hovercraft behave cleanly, and this math is pretty complicated and time-dependent (also depends on frame rate).
Note that our avatars blend (which IMO looks quite good) is purely a lerp based on the speed, with no additional math trickery (like a fake velocity decay): https://github.com/webaverse/app/blob/a5346a446e519283317f746a2e7856c59c9c3fae/avatars/avatars.js#L1749 |
@avaer I simplified the code now and applied your changes.
|
The Dragon and hovercraft are working fine now As they are supposed to work. It stops when W is not pressed. But there are some other issues, Those I am not sure if they are related to this PR or not but they are related to Dragon. 1-While riding the dragon, if F is pressed, the dragon keeps hoping while standing, and they become unrideable(no E appears when avatar goes close to it.) WhatsApp.Video.2021-11-26.at.5.28.17.PM.1.mp4WhatsApp.Video.2021-11-26.at.5.19.36.PM.mp42- The wings of hovercraft don't move. They are still now. Is it deliberate? WhatsApp.Video.2021-11-26.at.5.28.17.PM.mp4 |
webaverse/app#1843
webaverse/app#1842