Skip to content

Commit 03c457d

Browse files
committed
Automatic merge of T1.5.1-351-gc9abcd22b and 8 pull requests
- Pull request #570 at de7a14f: Experimental glTF 2.0 support with PBR lighting - Pull request #732 at 1edb2e5: Improvements for air brakes - Pull request #751 at 00981a2: Web interface to control cab controls with external hardware - Pull request #767 at 82c5f1c: Refine sunrise and sunset - Pull request #799 at eb92d81: Consolidated wind simulation - Pull request #803 at 7157e08: Various adjustments to steam adhesion - Pull request #809 at f67822a: Some on-screen messages not suppressed, Bug #2008012 - Pull request #813 at a8e9d9b: Refactored garbage generators
10 parents 5bc27ec + c9abcd2 + de7a14f + 1edb2e5 + 00981a2 + 82c5f1c + eb92d81 + 7157e08 + f67822a + a8e9d9b commit 03c457d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Source/RunActivity/Viewer3D/GltfShape.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public GltfShape(Viewer viewer, string filePath)
101101
CustomAnimationFPS = 1;
102102
EnableAnimations = viewer.Game.Settings.GltfAnimations;
103103
ShapeWarnings = !viewer.Game.Settings.SuppressShapeWarnings;
104+
105+
if (ConsistGenerator.GltfVisualTestRun)
106+
{
107+
if (!SampleModelsAdjustments.TryGetValue(Path.GetFileNameWithoutExtension(FilePath), out SampleModelsAdjustment))
108+
SampleModelsAdjustment = Matrix.Identity;
109+
}
104110
}
105111

106112
protected override void LoadContent()
@@ -185,8 +191,8 @@ public override Matrix SetRenderMatrices(ShapePrimitive baseShapePrimitive, Matr
185191
Matrix.Multiply(ref bone, ref PlusZToForward, out bone);
186192

187193
// The ConsistGenerator is used to show all the Khronos sample models for testing purposes. However they need adjustments to show them all at once.
188-
if (ConsistGenerator.GltfVisualTestRun && SampleModelsAdjustments.TryGetValue(Path.GetFileNameWithoutExtension(FilePath), out var adjustment))
189-
Matrix.Multiply(ref bone, ref adjustment, out bone);
194+
if (ConsistGenerator.GltfVisualTestRun)
195+
bone *= SampleModelsAdjustment;
190196

191197
Matrix.Multiply(ref bone, ref tileTranslation, out bone);
192198

@@ -1793,6 +1799,7 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
17931799
{ "VertexColorTest".ToLower(), Matrix.CreateScale(2) * Matrix.CreateTranslation(0, 2, 0) },
17941800
{ "WaterBottle".ToLower(), Matrix.CreateScale(7) * Matrix.CreateTranslation(0, 2, 0) },
17951801
};
1802+
readonly Matrix SampleModelsAdjustment;
17961803
}
17971804

17981805
class GltfAnimation

0 commit comments

Comments
 (0)