PhAT is inconsistent on when it does and doesn't apply scale to Constraint positions. This leads to cases where the positions provided create constraints that may not work when the Preview Skeletal Mesh has a non-identity Scale.
Testing this issue in 4.13 and 4.14 with the provided mesh, the default constraints created would cause the mesh to collapse into itself because the constraints didn't have scale. Deleting bodies / re-initializing the constraints would cause things to work because the constraints did have scale.
In 4.15, changes were added to skeletal mesh to handle constraints in terms of Component and Skeletal Mesh scale. This meant the previous behavior flipped (constraints would work upon creation, but not after re-initializing).
Fixing the consistency issues won't fix already broken content, but that should be limited. Unfortunately, since we never tracked scale with FConstraintInstances, there's no fool-proof way to fix already broken content.
// Do this separately so both are logged if invalid. const bool Body1Valid = ValidateBody(Body1, ConInst->ConstraintBone1); const bool Body2Valid = ValidateBody(Body2, ConInst->ConstraintBone2);
((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[0])->DefaultInstance).Pos1 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[0])->DefaultInstance).Pos2 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[1])->DefaultInstance).Pos1 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[1])->DefaultInstance).Pos2 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[2])->DefaultInstance).Pos1 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[2])->DefaultInstance).Pos2 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[3])->DefaultInstance).Pos1 ((((UPhysicsConstraintTemplate **)((PhysAsset).ConstraintSetup).AllocatorInstance.Data)[3])->DefaultInstance).Pos2
EXPECTED:
All Pos1 values in the watch window should be 0 vectors (0, 0, 0).
All Pos2 values in the watch window should be non-0 vectors with the values (0, 0, 0.2)
Notes: Some amount of rounding error is OK, not all constraint may have values (e.g. [2] and [3] won't have values.
ACTUAL:
All Pos1 values in the watch window should be 0 vectors (0, 0, 0).
All Pos2 values in the watch window are non-0 vectors with the values (0, 0, 20).
EXPECTED:
All Pos1 values in the watch window should be 0 vectors (0, 0, 0).
All Pos2 values in the watch window should be non-0 vectors with the values (0, 0, 0.1)
Notes: Some amount of rounding error is OK, not all constraint may have values.
ACTUAL:
Matches expected in this case.
EXPECTED:
All Pos1 values in the watch window should be 0 vectors (0, 0, 0).
All Pos2 values in the watch window should be non-0 vectors with the values (0, 0, 0.2)
Notes: Some amount of rounding error is OK, not all constraint may have values.
ACTUAL:
All Pos1 values in the watch window should be 0 vectors (0, 0, 0).
All Pos2 values in the watch window are non-0 vectors with the values (0, 0, 20).
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-42531 in the post.
0 |
Component | UE - Simulation - Physics |
---|---|
Affects Versions | 4.15 |
Target Fix | 4.17 |
Fix Commit | 3494937 |
---|---|
Main Commit | 3502661 |
Created | Mar 3, 2017 |
---|---|
Resolved | Jun 16, 2017 |
Updated | Apr 27, 2018 |