25
25
using System . Security . AccessControl ;
26
26
using xivModdingFramework . Models . Enums ;
27
27
using MathNet . Numerics . LinearAlgebra ;
28
+ using System . Security . Cryptography ;
28
29
29
30
namespace xivModdingFramework . Models . Helpers
30
31
{
@@ -1357,6 +1358,7 @@ public static async Task ApplyRacialDeform(TTModel model, XivRace targetRace, bo
1357
1358
Vector3 normal = Vector3 . Zero ;
1358
1359
Vector3 binormal = Vector3 . Zero ;
1359
1360
Vector3 tangent = Vector3 . Zero ;
1361
+ Vector3 flow = Vector3 . Zero ;
1360
1362
1361
1363
// And each bone in that vertex.
1362
1364
for ( var b = 0 ; b < v . Weights . Length ; b ++ )
@@ -1381,12 +1383,17 @@ public static async Task ApplyRacialDeform(TTModel model, XivRace targetRace, bo
1381
1383
normal += MatrixTransform ( v . Normal , normalMatrix ) * boneWeight ;
1382
1384
binormal += MatrixTransform ( v . Binormal , matrix ) * boneWeight ;
1383
1385
tangent += MatrixTransform ( v . Tangent , matrix ) * boneWeight ;
1386
+ if ( v . FlowDirection != Vector3 . Zero )
1387
+ {
1388
+ flow += MatrixTransform ( v . FlowDirection , matrix ) * boneWeight ;
1389
+ }
1384
1390
}
1385
1391
1386
1392
v . Position = position ;
1387
1393
v . Normal = normal ;
1388
1394
v . Binormal = binormal ;
1389
1395
v . Tangent = tangent ;
1396
+ v . FlowDirection = flow ;
1390
1397
}
1391
1398
1392
1399
// Same thing, but for the Shape Data parts.
@@ -1398,6 +1405,7 @@ public static async Task ApplyRacialDeform(TTModel model, XivRace targetRace, bo
1398
1405
Vector3 normal = Vector3 . Zero ;
1399
1406
Vector3 binormal = Vector3 . Zero ;
1400
1407
Vector3 tangent = Vector3 . Zero ;
1408
+ Vector3 flow = Vector3 . Zero ;
1401
1409
1402
1410
// And each bone in that vertex.
1403
1411
for ( var b = 0 ; b < v . Weights . Length ; b ++ )
@@ -1422,12 +1430,17 @@ public static async Task ApplyRacialDeform(TTModel model, XivRace targetRace, bo
1422
1430
normal += MatrixTransform ( v . Normal , normalMatrix ) * boneWeight ;
1423
1431
binormal += MatrixTransform ( v . Binormal , matrix ) * boneWeight ;
1424
1432
tangent += MatrixTransform ( v . Tangent , matrix ) * boneWeight ;
1433
+ if ( v . FlowDirection != Vector3 . Zero )
1434
+ {
1435
+ flow += MatrixTransform ( v . FlowDirection , matrix ) * boneWeight ;
1436
+ }
1425
1437
}
1426
1438
1427
1439
v . Position = position ;
1428
1440
v . Normal = normal ;
1429
1441
v . Binormal = binormal ;
1430
1442
v . Tangent = tangent ;
1443
+ v . FlowDirection = flow ;
1431
1444
}
1432
1445
}
1433
1446
0 commit comments