Fix hair vertices linking incorrectly in some cases

This commit is contained in:
Lwmte 2024-12-14 12:25:50 +01:00
parent 2f6114deba
commit 19528ea3bd
2 changed files with 3 additions and 4 deletions

View file

@ -16,6 +16,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
* Fixed incorrect slide directions for sub-click geometry.
* Fixed stutter during jumps between cameras in a flyby sequence.
* Fixed uzi targeting issues after using flycheat.
* Fixed hair object vertices not always linking properly.
* Fixed snow particles not always melting on the ground.
* Fixed enemies not damaging Lara if she is staying on the sector where enemies were triggered.
* Fixed enemy pickups dropping on death sectors.

View file

@ -773,13 +773,11 @@ namespace TEN::Renderer
int y2 = _moveablesVertices[parentBucket->StartVertex + v2].Position.y + parentBone->GlobalTranslation.y;
int z2 = _moveablesVertices[parentBucket->StartVertex + v2].Position.z + parentBone->GlobalTranslation.z;
if (abs(x1 - x2) < 2 && abs(y1 - y2) < 2 && abs(z1 - z2) < 2)
if (x1 == x2 && y1 == y2 && z1 == z2)
{
currentVertex->Bone = j;
currentVertex->Position = parentVertex->Position;
currentVertex->Normal = parentVertex->Normal;
currentVertex->AnimationFrameOffset = parentVertex->AnimationFrameOffset;
currentVertex->Tangent = parentVertex->Tangent;
break;
}
}
@ -854,7 +852,7 @@ namespace TEN::Renderer
int y2 = _moveablesVertices[parentBucket->StartVertex + v2].Position.y + parentBone->GlobalTranslation.y;
int z2 = _moveablesVertices[parentBucket->StartVertex + v2].Position.z + parentBone->GlobalTranslation.z;
if (abs(x1 - x2) < 2 && abs(y1 - y2) < 2 && abs(z1 - z2) < 2)
if (x1 == x2 && y1 == y2 && z1 == z2)
{
currentVertex->Bone = j;
currentVertex->Position = parentVertex->Position;