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

smooth speed based mount animations #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

smooth speed based mount animations #37

wants to merge 3 commits into from

Conversation

Loryhoof
Copy link
Contributor

@Loryhoof Loryhoof commented Nov 24, 2021

action.play();
}
if(action.weight < 1) {
action.weight += (1 - Math.pow(smooth, speed)) / 2;
Copy link
Contributor

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.

Copy link
Contributor

@avaer avaer left a 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).

@avaer
Copy link
Contributor

avaer commented Nov 25, 2021

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

@Loryhoof
Copy link
Contributor Author

Loryhoof commented Nov 25, 2021

@avaer I simplified the code now and applied your changes.
I have a question about the hovercraft animation though, do we want the wings to fold out:

  1. quicker/slower based on current speed, but the wings completely fold out at all speeds
    or
  2. only fold out up to a certain point (based on the speed, if we're going faster fold out more..)

@alisaad673
Copy link

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.mp4
WhatsApp.Video.2021-11-26.at.5.19.36.PM.mp4

2- 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

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.

3 participants