NeotokyoRevamp / neo

This project has moved to: https://github.com/NeotokyoRebuild/neo
Other
30 stars 14 forks source link

Lower body animations fix #72

Open AdamTadeusz opened 4 months ago

AdamTadeusz commented 4 months ago

m_pPlayerAnimState->Update() expects two angles (pitch and yaw) in degrees, not two parts of a vector. Now its fixed

ComputePoseParam_BodyXY used m_nButtons to work out in which direction the legs should move. Since m_nButtons is not a networked variable, it wasn't possible to play leg animations for any other players except the local player. Now ComputePoseParam_BodyXY instead computes the player direction of travel in relation to the players camera (dot product between camera angle and velocity for whether player is going forwards or backwards and dot product between camera angle rotated by 90 degrees and velocity for whether the player is going left or right)

Retaining the speedscale and normalising the two vectors results in the smoothest animation. NOTE Since division is a computationally expensive operation, can discuss whether normalising the two vectors for every player object every update is worth it

AdamTadeusz commented 4 months ago

Could edit this slightly so in ComputePoseParam_BodyXY instead of defining a third vector eyeSide2D which is eyeForward2D rotated by 90 degrees, we just use eyeForward2D in the sideDot(Product) definition but with x and y switched around and x multiplied by -1. Less readable but will save us a bit of memory and maybe a bit of computational complexity

AdamTadeusz commented 4 months ago

Could also define our own normalisation function which only divides the first two values of a 3D vector by the magnitude of only the first two values, allowing us to use the 3D Vectors in the dot product calculation and removing the need to define eyeForward2D and velocity2D

AdamTadeusz commented 4 months ago

Went ahead and added my workaround for the upper body animations too to this branch @Rainyan

Rainyan commented 4 months ago

Hi, thanks a lot for the PRs. I'll try and get to reviewing these ASAP, hopefully this weekend.