Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Fixed hands rendering in strange positions
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Oct 20, 2023
1 parent abf8d01 commit e9c2c28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Entities/Arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ namespace RTE {

void Arm::UpdateArmFrame() {
float halfMaxLength = m_MaxLength / 2.0F;
int newFrame = static_cast<unsigned int>((m_HandCurrentOffset.GetMagnitude() - halfMaxLength) / halfMaxLength) * static_cast<float>(m_FrameCount);
m_Frame = std::clamp<int>(newFrame, 0, m_FrameCount - 1);
float newFrame = std::floor(((m_HandCurrentOffset.GetMagnitude() - halfMaxLength) / halfMaxLength) * static_cast<float>(m_FrameCount));
m_Frame = static_cast<unsigned int>(std::clamp(newFrame, 0.0F, static_cast<float>(m_FrameCount - 1)));
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit e9c2c28

Please sign in to comment.