This repository was archived by the owner on May 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Lower body animations fix #72
Open
AdamTadeusz
wants to merge
4
commits into
NeotokyoRevamp:dev
Choose a base branch
from
AdamTadeusz:lowerBodyAnimationsFix
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
61b75cb
convert vector passed to update to angles in degrees and now using do…
AdamTadeusz a0f8ccb
Removed unused code
AdamTadeusz dcb7cfe
Workaround for upper body animations not networking properly, and a l…
AdamTadeusz 40c0da5
added smoke grenade and detpack animations, fixed zoom problem when s…
AdamTadeusz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -428,41 +428,30 @@ void CPlayerAnimState::ComputePoseParam_BodyXY(void) | |
| ((speed / ((GetOuter()->GetFlags() & FL_DUCKING) ? NEO_RECON_CROUCH_SPEED : NEO_RECON_NORM_SPEED))), | ||
| 0, 1); | ||
|
|
||
| int forwardSign = 0; | ||
| if (GetOuter()->m_nButtons & IN_FORWARD) | ||
| { | ||
| if (!(GetOuter()->m_nButtons & IN_BACK)) | ||
| { | ||
| forwardSign = 1; | ||
| } | ||
| } | ||
| else if (GetOuter()->m_nButtons & IN_BACK) | ||
| { | ||
| forwardSign = -1; | ||
| } | ||
| Vector eyeForward; | ||
| GetOuter()->EyeVectors(&eyeForward, NULL, NULL); | ||
| Assert(eyeForward.IsValid()); | ||
| Vector velocity = GetOuter()->GetLocalVelocity(); | ||
|
|
||
| int sideSign = 0; | ||
| if (GetOuter()->m_nButtons & IN_MOVERIGHT) | ||
| { | ||
| if (!(GetOuter()->m_nButtons & IN_MOVELEFT)) | ||
| { | ||
| sideSign = 1; | ||
| } | ||
| } | ||
| else if (GetOuter()->m_nButtons & IN_MOVELEFT) | ||
| { | ||
| sideSign = -1; | ||
| } | ||
| Vector2D eyeForward2D = eyeForward.AsVector2D(); | ||
| Vector2D velocity2D = velocity.AsVector2D(); | ||
|
|
||
| float speed_x = speedScale * forwardSign; | ||
| float speed_y = speedScale * sideSign; | ||
| eyeForward2D.NormalizeInPlace(); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normalizing a vector involves division which could make this a very expensive operation |
||
| velocity2D.NormalizeInPlace(); | ||
|
|
||
| float forwardDot = eyeForward2D[0] * velocity2D[0] + eyeForward2D[1] * velocity2D[1]; | ||
| Vector2D eyeRight2D = Vector2D(eyeForward2D[1], eyeForward2D[0] * -1); // eyeForward2D rotated by 90 degrees | ||
| float sideDot = eyeRight2D[0] * velocity2D[0] + eyeRight2D[1] * velocity2D[1]; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is nice to read but maybe to save some resources we could delete line 443 and have line 444 read |
||
|
|
||
| float speed_x = speedScale * forwardDot; | ||
| float speed_y = speedScale * sideDot; | ||
|
|
||
| GetOuter()->SetPoseParameter(poseparam_move_x, speed_x); | ||
| GetOuter()->SetPoseParameter("move_y", speed_y); | ||
|
|
||
| bool bIsMoving; | ||
| const float flPlaybackRate = CalcMovementPlaybackRate(speed, GetOuter()->GetSequenceGroundSpeed(GetOuter()->GetSequence()), &bIsMoving) * sv_neo_animrate_scale.GetFloat(); | ||
|
|
||
| if (bIsMoving) | ||
| { | ||
| GetOuter()->SetPlaybackRate(flPlaybackRate); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Potentially don't have to define new vectors if we can somehow isolate and normalise the first two components of this 3D vector on their own