Skip to content

Commit ed68705

Browse files
committed
Fix Undying cloth sims
1 parent 85a6bc1 commit ed68705

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Src/D3D9Render_mesh_processing.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ void UD3D9RenderDevice::renderMeshActor(FSceneNode* frame, AActor* actor, Render
479479
TRefArray<FMeshTri> tris = mesh->GetTris(actor);
480480
INT numVerts = mesh->FrameVerts(actor);
481481

482+
FVector* samples = New<FVector>(GMem, numVerts);
483+
// GetFrame in the normal position first, lets the cloth sims work in the correct space
484+
mesh->GetFrame(samples, sizeof(samples[0]), GMath.UnitCoords, actor, frame);
485+
482486
// The old switcheroo, trick the game to not transform the mesh verts to object position
483487
FVector origLoc = actor->Location;
484488
FVector origPrePiv = actor->PrePivot;
@@ -500,7 +504,6 @@ void UD3D9RenderDevice::renderMeshActor(FSceneNode* frame, AActor* actor, Render
500504
}
501505
actor->DrawScale = 1.0f;
502506

503-
FVector* samples = New<FVector>(GMem, numVerts);
504507
mesh->GetFrame(samples, sizeof(samples[0]), GMath.UnitCoords, actor, frame);
505508
INT numTris = tris.Num();
506509

0 commit comments

Comments
 (0)