File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1444,11 +1444,26 @@ bool CSkelMeshInstance::BuildMorphVerts()
1444
1444
// Copy unmodified vertices
1445
1445
memcpy (MorphedVerts, Lod.Verts , Lod.NumVerts * sizeof (CSkelMeshVertex));
1446
1446
1447
- // Apply delta
1447
+ // Apply deltas
1448
1448
for (const CMorphVertex& Delta : Deltas)
1449
1449
{
1450
1450
CSkelMeshVertex& V = MorphedVerts[Delta.VertexIndex ];
1451
+ // Morph position
1451
1452
VectorAdd (V.Position , Delta.PositionDelta , V.Position );
1453
+ // Morph normal
1454
+ CVec3 Normal;
1455
+ int8 W = V.Normal .GetW ();
1456
+ Unpack (Normal, V.Normal );
1457
+ VectorAdd (Normal, Delta.NormalDelta , Normal);
1458
+ Pack (V.Normal , Normal);
1459
+ V.Normal .SetW (W);
1460
+ // Adjust tangent vector to make basis orthonormal
1461
+ CVec3 Tangent;
1462
+ Unpack (Tangent, V.Tangent );
1463
+ float shift = dot (Normal, Tangent); // it will be zero if vertices are perpendicular
1464
+ VectorMA (Tangent, -shift, Normal); // shift alongside the normal to make vertices perpendicular again
1465
+ Tangent.NormalizeFast (); // ensure result is normalized
1466
+ Pack (V.Tangent , Tangent);
1452
1467
}
1453
1468
1454
1469
return true ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ keyboard shortcuts by pressing 'H' (Help) key. Here's the list of some shortcuts
98
98
Shift+Up/Down change scene FOV
99
99
Ctrl+L switch lighting modes
100
100
Ctrl+Q toggle visualization of debug information (text, 3D axis etc)
101
- Ctrl+G toggle OpenGL 2.0 / OpenGL 1.1 renderer
101
+ Ctrl+G toggle between OpenGL 2.0 (using shaders) and OpenGL 1.1 (no shaders)
102
102
Esc exit from the umodel
103
103
104
104
You may attach the AnimSet to the SkeletalMesh object using Ctrl+A key. Animation
@@ -212,6 +212,10 @@ detex
212
212
213
213
Changes
214
214
~~~~~~~
215
+ 15.10.2019
216
+ - loading and visualizing of UE3 and UE4 MorphTargets; switching between morphs is done with Ctrl+[ and Ctrl+]
217
+ keys
218
+
215
219
13.10.2019
216
220
- added full vertex color support (loading, viewing, exporting)
217
221
You can’t perform that action at this time.
0 commit comments